Click to See Complete Forum and Search --> : refresh the same page


dummyagain
July 31st, 2006, 12:57 PM
I made a drop down list which contains 3-4 items, depending on the no of records in the database.

When one of the items is selected, the page will refresh to show a table with corresponding records.

However, I don't know how to send the selected drop down list item to the same page?

CAn anyone show me similar examples?

Thank you

hedge_fund
July 31st, 2006, 10:18 PM
If you are able to select records for the specified item, then don't you already have the item?

I am a little confused by your question. If you are posting back to the same page (and viewstate is enabled), asp.net should take care of all the processing and you should be able to get the item.

SelectedText or the SelectedIndex property should contain what you are looking for.

dummyagain
August 1st, 2006, 12:23 PM
In my code of the drop down list listener,


Protected Sub DropDownList5_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList5.SelectedIndexChanged

'i dont sure if i can set variable dropdownlistvalue here
Response.Redirect("Admin/Scheduling.aspx?dropdownlistvalue=" & DropDownList5.SelectedValue().ToString)

End Sub


and somewhere in the Scheduling.aspx
DropDownList5.SelectedValue = dropdownlistvalue
for getting the selected value of the drop down list

i think there are some problems,... but i don't know what they are. Can you give me some advices, please?

Thank you

saibaba111
August 1st, 2006, 04:58 PM
Try DropDownList5.text.tostring() and let me know if it works.


In my code of the drop down list listener,


Protected Sub DropDownList5_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList5.SelectedIndexChanged

'i dont sure if i can set variable dropdownlistvalue here
Response.Redirect("Admin/Scheduling.aspx?dropdownlistvalue=" & DropDownList5.SelectedValue().ToString)

End Sub


and somewhere in the Scheduling.aspx
DropDownList5.SelectedValue = dropdownlistvalue
for getting the selected value of the drop down list

i think there are some problems,... but i don't know what they are. Can you give me some advices, please?

Thank you