473,503 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is this a stupid question?

I'm looking for the command to direct a user to a new URL.
For example, in ASP, when you created a dropdown box, the
item selected could open a file - using the form
action="MyFile.asp"
How do you do a similar thing in ASP.NET??

Nov 17 '05 #1
6 1684
Have you tired:

Response.Redirect("URL_of_page.aspx");
"Steve" <st*************@threerivers.gov.uk> wrote in message
news:0a****************************@phx.gbl...
I'm looking for the command to direct a user to a new URL.
For example, in ASP, when you created a dropdown box, the
item selected could open a file - using the form
action="MyFile.asp"
How do you do a similar thing in ASP.NET??

Nov 17 '05 #2
use a client side form with an action thingie :)

its standard html so i don't see why that wouldn't work.
"Steve" <st*************@threerivers.gov.uk> wrote in message
news:0a****************************@phx.gbl...
I'm looking for the command to direct a user to a new URL.
For example, in ASP, when you created a dropdown box, the
item selected could open a file - using the form
action="MyFile.asp"
How do you do a similar thing in ASP.NET??

Nov 17 '05 #3
Set the AutoPostBack property of the DropDownList to True, then wire an
event handler for the SelectedIndexChanged event and in the event handler,
write Response.Redirect( yourDropDownList.SelectedItem.Value, true );
assuming that the Value of the SelectedItem is the URL to redirect the user
to.

Mario

"Steve" <st*************@threerivers.gov.uk> wrote in message
news:0a****************************@phx.gbl...
I'm looking for the command to direct a user to a new URL.
For example, in ASP, when you created a dropdown box, the
item selected could open a file - using the form
action="MyFile.asp"
How do you do a similar thing in ASP.NET??

Nov 17 '05 #4
Sorry, continued;
Class below - how can I call this array so that when the
strName "SomeMeeting" is selected in the dropdown box
The user is taken to the strPage "SomeMeetingPage.aspx"
?????
Structure MeetingInfo
Dim strName as string
Dim strPage as string
End Structure

Public Function GetMeetingList() as MeetingInfo
Dim arMeetings(11) as MeetingInfo
arMeetings(1).strName = "SomeMeeting"
arMeetings(1).strPage = "SomeMeetingPage.aspx"
etc etc

Return arMeetings
Nov 17 '05 #5
I agree with Steve, client side seems better for this. If you decide to go
that route I have a sample javascript for doing just this on my web site:
www. aboutfortunate.com

It's listed as: Open web page from drop down list

(Sorry, I haven't built in a search capability yet, but the library is still
small so it won't be difficult to find. I'll be adding a search soon
though.)

--
S. Justin Gengo, MCP
Web Developer / Programmer

Free Code Library At:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"Kevin Spencer" <ke***@takempis.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Man, I see a whole lot of rather complex server-side solutions for this, but I don't see a necessity for a server-side solution based upon your
requirements at all. What you need is to create a drop-down list box that is populated on the server side, but on the client side, each option simply has a value of what page you want to redirect to, and a text of whatever you
want. Add a JavaScript "onchange" client-side event handler that reads
something like the following:

<select name="whatever" size="1"
onchange="document.href=this.options[this.selectedIndex].value">
...

Remember that anything you can do on the client side is going to save you a heck of a lot of load on the server side.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
http://www.takempis.com
Big things are made up of
lots of little things.

"Steve" <st*************@threerivers.gov.uk> wrote in message
news:0a****************************@phx.gbl...
I'm looking for the command to direct a user to a new URL.
For example, in ASP, when you created a dropdown box, the
item selected could open a file - using the form
action="MyFile.asp"
How do you do a similar thing in ASP.NET??


Nov 17 '05 #6
I also agree with you, even though I'm one of those who posted one of the
server-side solutions. I was thinking of also providing a client-side
solution, but oh, well, what's done is done...

Mario

"Kevin Spencer" <ke***@takempis.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Man, I see a whole lot of rather complex server-side solutions for this, but I don't see a necessity for a server-side solution based upon your
requirements at all. What you need is to create a drop-down list box that is populated on the server side, but on the client side, each option simply has a value of what page you want to redirect to, and a text of whatever you
want. Add a JavaScript "onchange" client-side event handler that reads
something like the following:

<select name="whatever" size="1"
onchange="document.href=this.options[this.selectedIndex].value">
...

Remember that anything you can do on the client side is going to save you a heck of a lot of load on the server side.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
http://www.takempis.com
Big things are made up of
lots of little things.

"Steve" <st*************@threerivers.gov.uk> wrote in message
news:0a****************************@phx.gbl...
I'm looking for the command to direct a user to a new URL.
For example, in ASP, when you created a dropdown box, the
item selected could open a file - using the form
action="MyFile.asp"
How do you do a similar thing in ASP.NET??


Nov 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

119
4508
by: rhat | last post by:
I heard that beta 2 now makes ASP.NET xhtml compliant. Can anyone shed some light on what this will change and it will break stuff as converting HTML to XHTML pages DO break things. see,...
5
3124
by: raz | last post by:
Greetings all. I apologize for what is almost certainly a stupid question, but I can't figure this out, and have no more time for head bashing... The short version: what is the appropriate...
4
1436
by: IS | last post by:
At the recommendation of several people in this newsgroup I have downloaded two or three Compilers. One is the Beta version of Microsoft's Visual C++ 2005. I have entered a complete beginner code...
2
1281
by: Ron Weldy | last post by:
I read that you don't need .cs files to deploy but I suppose if you are trying to reconstruct someone's work, you will need these files. Is that correct?
3
1146
by: rroman | last post by:
I have a very simple form, takes information from the user, updates a SQL database, now I just want to redirect to a "Thank You For Your Time" web page within the same bowser. ASP. NET VB
6
1597
by: Adam Smith | last post by:
I have posted this and similar questions repeatedly and can't even raise a single response. I am being led to believe that this then 'Must be a stupid question' although people say that there is no...
5
1863
by: Alberto Salvati | last post by:
Hi, List. My company has a VERY BIG product base on db2 udb v7.x. We want to di an upgrade to v9, but.... current db has a lot of procedure (cobol..!). Therefore, we've planned to rewrite this...
2
1510
by: Lynx101 | last post by:
Hi, Is this a stupid question? Senario: Two tables linked together with an ID number. Question: When using a combo box, which refences another table by indexed autonumber, is there a way to...
9
6488
by: AWW | last post by:
Running XP - Visual Studio 2005 - VB Want to have duplicate projects - one safe and stable - other for experimenting Can't fine easy way to make duplicate project. Stupid question? or stupid ME?...
9
1597
by: Alec | last post by:
Sorry guys, stupid question.... Am no programming expert and have only just started using php for creating dynamic news pages. Then I see a dynamic website without the php extension. ...
0
7202
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7084
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7328
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6991
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5013
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
380
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.