"imbirek8" <im******@op.plwrote in message
news:gd**********@news.onet.pl...
"Alberto Poblacion" <ea******************************@poblacion.orgwro te
in message news:en****************@TK2MSFTNGP05.phx.gbl...
[...]
>>How can I find ClientId of the HiddenField ?
You can use hiddenMy.ClientID.Replace("_", "$")
[...]
I don't understant what exacly it would do..
The ClientID property returns an ID that separates its various parts
with "_", such as "ctl00_ctrlA1_rptB1_ctl00_ibB1", but the Name that is
actually rendered into the html uses "$" to separate the same parts, such as
"ctl00$ctrlA1$rptB1$ctl01$ibB1". At first I thought that you were doing a
finding the element by Name, so you would have needed the previous
replacement to find the control on the client side.
Upon rereading your message, I see that this is not the case. You mention
that you are doing document.GetElementById('<%= this.gvClient.ClientID
%>'); and that you get an error, but you don't mention what the error is.
You also don't mention wether you are writing this code in the markup of the
Page or the UserControl. If you are writing it on the Page, the "this" is
interpreted on the page class, so "this.gvClient" needs to refer to a public
field or property on the page, it won't work if gvClient is inside a
usercontrol that is inside the page, since this is not automatically visible
to the page class. You may wish to add a public property to expose the
information that you then render in the <%= ... %>.