|
-
Oct 1st, 2003, 06:11 AM
#1
Thread Starter
Hyperactive Member
AutoPostBack
If I have an asp dropdown list and I select a value from that list, do I have to use the autopostpack attribute before I can pass the value of the dropdown to a session variable (for instance)???
Cheers,
Matt
-
Oct 1st, 2003, 06:37 AM
#2
Still learning asp.net myself but as from what i know, that would depend on when you want the value passed to the session variable.
If you need the session variable changing as soon as the drop down box value is selected then yes you will need autopostback enabled and an onSelectedChanged event for your drop down box, such as:
Code:
Sub cbodropdown_SelectedIndexChanged(ByVal sender As system.Object, ByVal e As System.EventArgs)
Session("whatever") = cboDropdown.selecteditem.value
end sub
'You will need these attributes set for your dropdown
' AutoPostBack="True" OnSelectedIndexChanged="cbodropdown_selectedindexchanged"
if you only need the session variable updating after a page is finished with you won't need to use autopostback.
-
Oct 1st, 2003, 07:28 AM
#3
Thread Starter
Hyperactive Member
Cheers
I thought as much, I have 5 or 6 dropdowns on my page and need to retrieve the values from each after they have been selected so the page reloads each time I change them which doesn't really look that professional.
I have limited knowledge of ASP.NET, so maybe there is a way.
Thanks for your response.
Matt.
-
Oct 1st, 2003, 07:37 AM
#4
adding smartnavigation=true to your page directive can sometimes help with the look of your page as it does things like remember which control had focus, don't know if this would help you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|