sgadson
Posts: 45
|
Posted: 10/26/2004, 4:03 PM |
|
Hello,
I would like the user to be sent to a different page depending on the value that is selected in a listbox.
Does anyone know the code for this using vb.net.
Thanks
_________________
Shawn |
|
|
sgadson
Posts: 45
|
Posted: 10/27/2004, 9:16 PM |
|
SOMEONE PLEASE HELP!
_________________
Shawn |
|
|
peterr
Posts: 5971
|
Posted: 10/27/2004, 9:31 PM |
|
Why not use Google? Here are sample results: http://www.posi.net/software/selectpage/ http://www.mail-archive.com/aspx@p2p.wrox.com/msg04679.html http://www.smartwebby.com/tipsntricks.asp
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
|
|
sgadson
Posts: 45
|
Posted: 10/27/2004, 10:14 PM |
|
Hi Peterr,
Thanks for the reply. I am aware of how to accomplish this task with javascript. However, I'm not sure how to incorporate it in my application. The problem is my record form needs to add the data in the list box to a sql table as well as direct the user to a specific page depending on what value is selected in the list box.
I am new to .Net.... am I making this harder then it really is? Can I use the javascript method to redirect and still have the data submitted to the sql table?
_________________
Shawn |
|
|
sgadson
Posts: 45
|
Posted: 10/27/2004, 10:22 PM |
|
I found this code on one of the pages that Peterr provided a link to. Can anybody translate this to VB?
*************************************
C#
on page load, or on control load, add this:
this.lb.Attributes.Add("onchange", "name_of_javascript_function_here");
now when the selection is changed by the user, the javascript function will get fired to redirect the user to the new page. you can probably reuse the existing javascript function you already have written.
_________________
Shawn |
|
|
peterr
Posts: 5971
|
Posted: 10/27/2004, 10:30 PM |
|
Sorry, that wasn't clear (that you need to submit something first).
Maybe look at the "Dynamically Redirect Users to Another Page" section of the User Manual/Help.
Also "Redirect unauthorized users to another page" section at: http://docs.codecharge.com/studio/html/QuickStart/Creat...rInitEvent.html
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
|
|
sgadson
Posts: 45
|
Posted: 11/02/2004, 3:21 PM |
|
FYI - Here is a method of directing a user to a different page depending on the value selected in a listbox. (VB.NET)
* Add your record form as normal that contain the listbox you would like to use. Set up you listbox with any values you want.
* Add a After Insert Event to the Record form that contains code simular to the following:
'Record L_FSE_Removal_Requests_tb Event AfterInsert. Action Custom Code @78-73254650
If L_FSE_Removal_Requests_tbWhat_Happened.Value = "Lost" Then
RedirectUrl = GetL_FSE_Removal_Requests_tbRedirectUrl("Thank_you_C.aspx", "")
Else If L_FSE_Removal_Requests_tbWhat_Happened.Value = "Never Received" Then
RedirectUrl = GetL_FSE_Removal_Requests_tbRedirectUrl("Thank_you_C.aspx", "")
Else If L_FSE_Removal_Requests_tbWhat_Happened.Value = "Still Working" Then
RedirectUrl = GetL_FSE_Removal_Requests_tbRedirectUrl("RR_C_5B.aspx", "")
Else If L_FSE_Removal_Requests_tbWhat_Happened.Value = "Sent Back" Then
RedirectUrl = GetL_FSE_Removal_Requests_tbRedirectUrl("RR_C_6.aspx", "")
End If
'End Record L_FSE_Removal_Requests_tb Event AfterInsert. Action Custom Code
Thanks Peterr for pointing me in the right direction.
_________________
Shawn |
|
|