I made a web form with a drop down list. The user can make a choice from the
dropdownlist. The result of this must be placed in a session-variable. This
is my code.
private sub cmdOK_click(...)
Session("ID")=dropdownlist1.selectedvalue
Response redirect("main.aspx").
end sub
But the session-variable is ALWAYS 1. Why ?
BartHi Bart,
In you Page_Load, are you using :
if not Page.IsPostBack()...
<code to fill your controls goes here>
end if
to avoid refreshing your dropdownlist1 ?
If not, each time your page loads, it will refresh your dropdown list,
resetting it to the first item in the list (which probably has a value of 1,
in your case)
Hope this helps,
Andrei.
"Bart" <Bart@.discussions.microsoft.com> wrote in message
news:7BDB93CA-1FE0-4571-9E8E-6E0638442693@.microsoft.com...
> I made a web form with a drop down list. The user can make a choice from
the
> dropdownlist. The result of this must be placed in a session-variable.
This
> is my code.
> private sub cmdOK_click(...)
> Session("ID")=dropdownlist1.selectedvalue
> Response redirect("main.aspx").
> end sub
> But the session-variable is ALWAYS 1. Why ?
> Bart
>
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment