SharePoint Blog - René Hézser

Anmelden  RSS Feed RSS Feed
Startet die Suche

Archive

Kategorien

Links

Andere Blogs




ITaCS GmbH


Control.ClientID has wrong value  

Aug 112009

An ASP.NET Controls has a ClientID property. SharePoint Controls inherit from the ASP.NET Controls. The property will give you the ID, the rendered control will have in the HTML source. There is one thing to remember:

The ClientID is valid only, if the control has been added to the Controls of the Page!

ID before adding the control ID after adding the control
FilterButton ctl00_m_Webpart1_FilterButton

So if you need the ClientID e.g. to pass it to a JavaScript to be able to find the control, make sure you grab the ClientID after the control has been added to the Page.

 
Posted by René Hézser | 0  Comments | Trackback Url  | 0  Links to this post | Bookmark this post with:        
Tags: Development, Web Controls
Technorati Tags: ,

Links to this post

Comments

Name *:
URL:
Email:
Kommentar:


CAPTCHA Image Validation