Some Asp.net Tips with javascript, masterpage , AJAX and jQuery
1- What is the difference between ID and ClientID For any server control ?
both of them is the same in page that don’t bind with master page
the difference will be in the ClientID will be changed and this one is used to deal with java script .
Ex:
drag and drop one textbox control in default aspx page without master page
and at load event write :
textbox1.text=”Some Text Here”;
textbox1.Attributes["onfocus"] = “alert(textbox1.value)”;
and run the page and set focus on the control , you will find the alert message is shown with Some Text Here as a text
it’s works !!
now take the same code to page binded with masterpage and run the page
you will find the code not work
and the cause is :
textbox1.value is changed
to
ctl00_ContentPlaceHolder1_Text1.value
now change it to the new value and run the code
it’s works
Mail Me @ bagalaty@hotmail.com
with Subject : Some Asp.net Tips with javascript, masterpage , AJAX and jQuery
to give you sample example, cause i can’t attach file from here !!