I need to get the ClientID of a form field for some JavaScript. About
25+ web sites I visited recommend the following method for finding the
client ID of a web form:
Web Form -> <asp:TextBox ID="datefield" type="hidden" Runat="Server" />
Client ID -> <%= datefield.ClientID() %>
Unfortunately, this only provides the following error:
Compilation Error
Compiler Error Message: BC30451: Name 'datefield' is not declared.
Source Error:
Line 200:
Line 201:
Line 202:<%= datefield.ClientID() %>
Line 203:
Line 204:
Why does this throw an error on my page? IF this is wrong, why did the
other 25+ MVP's (who recommended this method) also get it wrong?
As a hint, here are a few URL's where it gives the exact method that
fails for me:
http://www.syncfusion.com/FAQ/aspnet/WEB_c5c.aspx (#28.10, link doesn't
work)
http://www.startvbdotnet.com/aspsite...s/default.aspx
http://www.thecodeproject.com/aspnet...in_asp_net.asp
http://youngpup.net/2004/distro (second scrollbox)
http://www.ondotnet.com/pub/a/dotnet...t&x-order=date
And perhaps the clearest example that an author claims works, but
doesn't work with me:
http://www.janetsystems.co.uk/Defaul...=72&itemid=137
Also, how does one make an <asp:TextBox /> invisible on the web page?
Using a Type="hidden" doesn't seem to do the trick (it is still visible).
TIA
....Geshel
--
************************************************** ********************
My reply-to is an automatically monitored spam honeypot. Do not use it
unless you want to be blacklisted by SpamCop. Please reply to my first
name at my last name dot org.
************************************************** ********************