Is this a stupid question?

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default 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??

    Steve Guest

  2. Similar Questions and Discussions

    1. Stupid question.
      I've worked with cfdirectory in the past but it mainly within the scope of deleting/creating a directory or get the name of files within a specific...
    2. Stupid Question??
      I have written a class to be used by asp.net applications that provides a useful function. Other than the constructor, it has just one method. ...
    3. OK. I'm asking a stupid question
      I created a multi-frame movie to use as my website. It has five buttons on it which I added the Get URL action to. When I publish it, and then open...
    4. Stupid C# question Please help!
      I'm used to writing my code in VBscript but I have to do this project in C#. I've written some functions on my ASP.Net page and I'm getting an...
    5. a stupid question
      how to check the filetype of remote file because is_dir(), is_file() can't work on remote file thx a lot
  3. #2

    Default Re: Is this a stupid question?

    Have you tired:

    Response.Redirect("URL_of_page.aspx");


    "Steve" <steven.chambers@threerivers.gov.uk> wrote in message
    news:0a0e01c34c62$e5dc1e60$a401280a@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??
    >

    Mark MacRae Guest

  4. #3

    Default Re: Is this a stupid question?

    use a client side form with an action thingie :)

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


    "Steve" <steven.chambers@threerivers.gov.uk> wrote in message
    news:0a0e01c34c62$e5dc1e60$a401280a@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??
    >

    Aemca Guest

  5. #4

    Default Re: Is this a stupid question?

    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" <steven.chambers@threerivers.gov.uk> wrote in message
    news:0a0e01c34c62$e5dc1e60$a401280a@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??
    >

    Mario Vargas Guest

  6. #5

    Default Re: Is this a stupid question?

    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 Guest

  7. #6

    Default Re: Is this a stupid question?

    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:
    [url]www.aboutfortunate.com[/url]

    "Out of chaos comes order."
    Nietzche


    "Kevin Spencer" <kevin@takempis.com> wrote in message
    news:%23QLzpMHTDHA.1916@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
    > [url]http://www.takempis.com[/url]
    > Big things are made up of
    > lots of little things.
    >
    > "Steve" <steven.chambers@threerivers.gov.uk> wrote in message
    > news:0a0e01c34c62$e5dc1e60$a401280a@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??
    > >
    >
    >

    S. Justin Gengo Guest

  8. #7

    Default Re: Is this a stupid question?

    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" <kevin@takempis.com> wrote in message
    news:%23QLzpMHTDHA.1916@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
    > [url]http://www.takempis.com[/url]
    > Big things are made up of
    > lots of little things.
    >
    > "Steve" <steven.chambers@threerivers.gov.uk> wrote in message
    > news:0a0e01c34c62$e5dc1e60$a401280a@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??
    > >
    >
    >

    Mario Vargas Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139