why id of control changed automatically when we use it in masterpage , while in simple page it does not change??
this is source code after run the MasterPage
as :: <input name="ctl00$cp1$txtUName" type="text" id="ctl00_cp1_txtUName" style="width:128px;" />
this is source code after run Simple Page
AS:<input name="txtUName" type="text" id="txtUName" />
these are same controls
I’m guessing this problem has arisen from some javascript you’re using which no longer references the correct ID (because its changed). If so when you send your javascript from the server use the clientID method. So for example
alert('<%= txtUName.ClientID %>')will generate an alertbox with the correct ID contained at runtime