Is this a stupid question?

Discussion in 'ASP .Net' started by Steve, Jul 17, 2003.

  1. Steve

    Steve Guest

    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??
    Steve, Jul 17, 2003
    #1
    1. Advertising

  2. Steve

    Mark MacRae Guest

    Have you tired:

    Response.Redirect("URL_of_page.aspx");


    "Steve" <> wrote in message
    news:0a0e01c34c62$e5dc1e60$...
    > 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??
    >
    Mark MacRae, Jul 17, 2003
    #2
    1. Advertising

  3. Steve

    Aemca Guest

    use a client side form with an action thingie :)

    its standard html so i don't see why that wouldn't work.


    "Steve" <> wrote in message
    news:0a0e01c34c62$e5dc1e60$...
    > 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??
    >
    Aemca, Jul 17, 2003
    #3
  4. Steve

    Mario Vargas Guest

    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" <> wrote in message
    news:0a0e01c34c62$e5dc1e60$...
    > 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??
    >
    Mario Vargas, Jul 17, 2003
    #4
  5. Steve

    steve Guest

    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
    steve, Jul 17, 2003
    #5
  6. 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" <> wrote in message
    news:%...
    > 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" <> wrote in message
    > news:0a0e01c34c62$e5dc1e60$...
    > > 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??
    > >

    >
    >
    S. Justin Gengo, Jul 17, 2003
    #6
  7. Steve

    Mario Vargas Guest

    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" <> wrote in message
    news:%...
    > 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" <> wrote in message
    > news:0a0e01c34c62$e5dc1e60$...
    > > 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??
    > >

    >
    >
    Mario Vargas, Jul 17, 2003
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Michael W Cocke

    Stupid RE question

    Michael W Cocke, Dec 27, 2004, in forum: Perl
    Replies:
    2
    Views:
    424
    Michael W Cocke
    Dec 28, 2004
  2. Will

    Stupid C# question Please help!

    Will, Aug 8, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    444
    carlos medina
    Aug 9, 2003
  3. Joerg Jooss

    Re: Stupid HTTP Request Question

    Joerg Jooss, May 15, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    403
    Joerg Jooss
    May 15, 2004
  4. Brandon McCombs
    Replies:
    4
    Views:
    513
    Richard Wheeldon
    Aug 28, 2006
  5. rincewind

    stupid, STUPID question!

    rincewind, Apr 19, 2009, in forum: HTML
    Replies:
    25
    Views:
    1,017
Loading...

Share This Page