Aneesh_Argent is right, you need to replace the Textbox, or remove the "Visible='False'" property. The one thing you will need to learn about the visibility property of these web controls is that if it is "False", it will not be rendered on the page. You were receiving an error because your textbox didn't exist on the client's computer (browser), since it was never rendered from the server. By removing the Visible="False", and adding in your Style attribute the "display: none;", you will have the desired output, and would not require a postback to the server which will save time for a simple task.
Also, by coding this way, you will be seeing a lot of "warning" messages. If you wish to avoid the warning messages, use Aneesh's suggestion and manually attach the event from the code-behind, or inline if that is what you are using. (Code-behind has the code file associtated with it: default.aspx --> default.aspx.cs || Inline coding has the code on your same page: default.aspx). Attach the event just how he suggested. You will avoid these warnings, but it's a lot of extra code and can be more difficult to change in the future as it brings the design and business layers together.
Last edited by SheSaidImaPregy; Jan 1st, 2009 at 10:29 am.
Reputation Points: 43
Solved Threads: 68
Veteran Poster
Offline 1,080 posts
since Sep 2007