Created
December 27, 2012 16:46
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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