Gaurav Taneja

Great dreams... never even get out of the box. It takes an uncommon amount of guts to put your dreams on the line, to hold them up and say, "How good or how bad am I?" That's where courage comes in.

  Home  |   Contact  |   Syndication    |   Login
  82 Posts | 1 Stories | 40 Comments | 7 Trackbacks

News




Google RankGoogle PR™ - Post your Page Rank with MyGooglePageRank.com



The content on this site represents my own personal opinions and thoughts at the time of posting, and does not reflect those of my employer's in any way.

Disclaimer:- All postings in this blog is provided "AS IS" with no warranties, and confers no rights.

Archives

Post Categories

Image Galleries

Atlas

Error

OutLook

SharePointService

Usefull Site Links

        //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 Monday, September 04, 2006 10:00 AM

Feedback

# re: How to get the HTML name attribute of ASP.Net Control 10/22/2006 3:16 PM vinod
use the control.UniqueID to get the value for name attribute


Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: