Quote:
quote:Originally posted by planoie
You need to use the server controls on your page and not use the Request.Form collection. The page framework handles all the parsing of the form post values, you can use the typed controls that you create.
|
Thanks again for your help Peter.
After all that, I discovered that the reason the If statement wasn't working was because it was within the Button_Click block of code, and not the Page_Load block. D'oh!
In the end, I actually used "If Not Page.IsPostBack Then" to achieve the result I was after (don't know why I didn't think of that to begin with given what I as trying to do).
I also had a good think about your suggestion re cleaning up my code to use valid ASP.net controls and not classic ASP objects.
I replaced all of my classic HTML code ...
Code:
<select name="date">
<option>10 July</option>
<option>11 July</option>
</select>
... with valid ASP.net server controls, data bound to SQL ...
Code:
<asp:DropDownList runat="server" id="date"></asp:DropDownList>
Not only does this make my code more valid, it's much cleaner now too because I don't have asp:Repeater controls wrapped around classic HTML. You're suggestion actually helped me solve another problem I was having on another page too so all round a great result.
Thanks again for your help!
