Skip to content

Instantly share code, notes, and snippets.

@dpoindexter
Created December 27, 2012 16:46
Show Gist options
  • Save dpoindexter/4389740 to your computer and use it in GitHub Desktop.
Save dpoindexter/4389740 to your computer and use it in GitHub Desktop.
Extension to get the AjaxPro path of the current ASP.Net WebForms control
using System;
using System.Linq;
using System.Web.UI;
namespace MyProject.Extensions
{
public static class ControlExtensions
{
public static string GetAjaxProPath(this Control control)
{
var controlType = control.GetType().BaseType;
if (controlType == null) return String.Empty;
var fullName = controlType.FullName;
var assemblyName = controlType.Assembly.FullName.Split(',').First();
return String.Format("/ajaxpro/{0},{1}.ashx", fullName, assemblyName);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment