It can't works with VS2008 either. As it is a server control, the actual client id of the control won't be searchbox
but a concatenation of all parents ids of the control. Something like ctl00_somePanel_someContainer_SearchBox
.
Request.Form
will contain raw html form control's values, including the value generated by the client side version of the SearchBox
, with its actual generated id.
To solve your issue, you can:
- read the
SearchBox.Text
property instead of reading theForm
object (probably the best option) - replace the server control by a pure client one (
<input type='textbox' id='SearchBox'/>
- fix the control ID using
CliendIDMode
, but I believe this is a poor option