Geeks With Blogs
Sharvan Dhaka blog
//Function to get the HTML name of the server control from the Client Id

// Parameters:

// clientId - Control.ClientId

// serverId - Control.id


private string GetHTMLNameById(string clientId, string serverId)

{

int pos = serverId.IndexOf('_');

string HTMLName = "";

if(pos >= 0)

{

pos = clientId.IndexOf(serverId);

HTMLName = clientId.Remove(pos, serverId.Length);

HTMLName = HTMLName.Replace('_', '$');

HTMLName += serverId;

}

else

HTMLName = clientId.Replace('_', '$');

return HTMLName;

}
Posted on Sunday, October 15, 2006 5:49 PM Asp.net , Tricky Solution/ Code | Back to top


Comments on this post: How to get the HTML name attribute of ASP.Net Control c# as.net

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Sharvan Dhaka | Powered by: GeeksWithBlogs.net