Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 1.0
This is the forum to discuss the Wrox book Beginning ASP.NET 1.0 with C# by Chris Goode, John Kauffman, Christopher L. Miller, Neil Raybould, S. Srinivasa Sivakumar, Dave Sussman, Ollie Cornes, Rob Birdwell, Matt Butler, Gary Johnson, Ajoy Krishnamoorthy, Juan T. Llibre, Chris Ullman; ISBN: 9780764543708
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 1.0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 1st, 2004, 04:50 AM
shs shs is offline
Authorized User
 
Join Date: Mar 2004
Location: , , New Zealand.
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default Using response.redirect wi

Hi,
I have a link wich passes the values selected from 3 dropdownlist boxes to another page by response.redirect.
(I am using asp.net, vb in dreamwaver)
There is anoter button in the page that is gonne be triggered by pressing Enter key so I don't want to use a buttton for these boxes, can anyone help me with this Please?

Here is a sample of what I have done:

<asp:DropDownList ID="oSkill" DataTextField="SkillType" runat="server" />
<asp:DropDownList ID="oLocation" DataTextField="City" runat="server" />
<asp:DropDownList ID="oJobType" DataTextField="JobType" runat="server" />
<A HREF???????????I don't know how to pass response.redirect to <a> tag or any other option?

here is the response.redirect:

Response.Redirect("result.aspx?oLocation=" & oLocation.SelectedItem.Text & _
"&oSkill=" & oSkill.SelectedItem.Text & _
"&oJobType=" & oJobType.SelectedItem.Text)

Many Thanks



 
Old April 1st, 2004, 01:09 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Harrisburg, PA, USA.
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

You don't have to pass the response.redirect to a tag, use a link button and in the onclick event, then response.redirect. If you want a link to contain the values of the drop-down list, then you have to alter the hyperlink (use hyperlink web control) navigate url property. Each drop-down list, when the selected index is changed, then would alter this property with the corresponding value.

Hope I'm on the right track?

Brian
 
Old April 1st, 2004, 04:40 PM
shs shs is offline
Authorized User
 
Join Date: Mar 2004
Location: , , New Zealand.
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Brian,
You might be on the right track but I am not sure if I am getting it...

I did use a button and onclick event which called a function and that function passed the values of 3 dropdown boxes to the correct page.... the problem is there are other controls in the page(many text boxes, listitems,...)and there is a submit button for them but there is this problem with browsers that when you click enter key then the first button in the page will be processed so I decided to use a heyperlink to pass the values of only these three dropdown boxes to another page (result.aspx page).
I have tried heyperlink and navigate url but again didn't know how to 'place' response.redirect there...I get error message...
..mmmm...not happy.....

 
Old April 2nd, 2004, 09:54 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Harrisburg, PA, USA.
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hmm, for a hyperlink, you can't use response.redirect. I don't even think you can use a click event for hyperlink. I don't know now you can make the second button trigger first; maybe try specifying a tabindex for all the parameters and give that button the lowest tab order value... I don't know if that will work. To use a hyperlink requires string manipulation. Whenever a drop-down list is changed, the selectedindexchanged property would parse the NavigateURL property (using Regex most likely) and replace the old text with the new text. Then when clicked on, it redirects not using response.redirect.




Similar Threads
Thread Thread Starter Forum Replies Last Post
Response.redirect in new window acdsky Classic ASP Basics 10 February 8th, 2012 12:21 PM
response.redirect sarah lee ASP.NET 1.0 and 1.1 Basics 1 October 27th, 2006 08:57 AM
response.redirect ava_h .NET Framework 2.0 0 October 18th, 2006 10:21 PM
response.redirect crmpicco Classic ASP Basics 3 February 9th, 2005 01:50 AM
Response.Redirect dhborchardt Classic ASP Basics 4 June 16th, 2003 05:56 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.