473,320 Members | 1,982 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Jump Menu (DropDown Menu) in ASP.net. Can someone help me out?

Hello,

i have a drop down menu in ASP.net with 5 options. I want to redirect to a
certain page when a certain option is selected.
I want to be redirected without having to click a button. Does anyone knows
how to make this?

Thank You,
Miguel
Nov 18 '05 #1
5 2938
<asp:DropDownList /> have AutoPostBack property. If this property is set to
true it automatically when change the List value fire a SelectedIndexChanged
event on Page.

In this method you can switch the DropDownList.SelectedValue and make a
Redirect where you want.

Brun
"Miguel Dias Moura" <in************@27lamps.com> wrote in message
news:OP**************@TK2MSFTNGP11.phx.gbl...
Hello,

i have a drop down menu in ASP.net with 5 options. I want to redirect to a
certain page when a certain option is selected.
I want to be redirected without having to click a button. Does anyone knows how to make this?

Thank You,
Miguel

Nov 18 '05 #2
<asp:DropDownList /> have AutoPostBack property. If this property is set to
true it automatically when change the List value fire a SelectedIndexChanged
event on Page.

In this method you can switch the DropDownList.SelectedValue and make a
Redirect where you want.

Brun
"Miguel Dias Moura" <in************@27lamps.com> wrote in message
news:OP**************@TK2MSFTNGP11.phx.gbl...
Hello,

i have a drop down menu in ASP.net with 5 options. I want to redirect to a
certain page when a certain option is selected.
I want to be redirected without having to click a button. Does anyone knows how to make this?

Thank You,
Miguel

Nov 18 '05 #3
Hi,

i wrote this script but it's not working as i expected. Can you tell me what
am i doing wrong?

<script runat="server">

Sub Page_Load(Sender As Object, E As EventArgs)
if myselect.AutoPostBack then
Response.Redirect ("http://" &
myselect.items(myselect.SelectedIndex).Value)
end if
End Sub

</script>

Drop Down Menu:

<asp:DropDownList AutoPostBack="true" ID="myselect" runat="server">
<asp:ListItem value="www.bonsalunos.com">item1</asp:ListItem>
<asp:ListItem value="www.sapo.pt">item2</asp:ListItem>
<asp:ListItem value="www.google.com">item3</asp:ListItem>
</asp:DropDownList>

Thanks,
Miguel

"Bruno Sirianni" <br***********@virgilio.it> wrote in message
news:Z_*******************@news3.tin.it...
<asp:DropDownList /> have AutoPostBack property. If this property is set to true it automatically when change the List value fire a SelectedIndexChanged event on Page.

In this method you can switch the DropDownList.SelectedValue and make a
Redirect where you want.

Brun
"Miguel Dias Moura" <in************@27lamps.com> wrote in message
news:OP**************@TK2MSFTNGP11.phx.gbl...
Hello,

i have a drop down menu in ASP.net with 5 options. I want to redirect to a certain page when a certain option is selected.
I want to be redirected without having to click a button. Does anyone

knows
how to make this?

Thank You,
Miguel


Nov 18 '05 #4
Hi,

i wrote this script but it's not working as i expected. Can you tell me what
am i doing wrong?

<script runat="server">

Sub Page_Load(Sender As Object, E As EventArgs)
if myselect.AutoPostBack then
Response.Redirect ("http://" &
myselect.items(myselect.SelectedIndex).Value)
end if
End Sub

</script>

Drop Down Menu:

<asp:DropDownList AutoPostBack="true" ID="myselect" runat="server">
<asp:ListItem value="www.bonsalunos.com">item1</asp:ListItem>
<asp:ListItem value="www.sapo.pt">item2</asp:ListItem>
<asp:ListItem value="www.google.com">item3</asp:ListItem>
</asp:DropDownList>

Thanks,
Miguel

"Bruno Sirianni" <br***********@virgilio.it> wrote in message
news:Z_*******************@news3.tin.it...
<asp:DropDownList /> have AutoPostBack property. If this property is set to true it automatically when change the List value fire a SelectedIndexChanged event on Page.

In this method you can switch the DropDownList.SelectedValue and make a
Redirect where you want.

Brun
"Miguel Dias Moura" <in************@27lamps.com> wrote in message
news:OP**************@TK2MSFTNGP11.phx.gbl...
Hello,

i have a drop down menu in ASP.net with 5 options. I want to redirect to a certain page when a certain option is selected.
I want to be redirected without having to click a button. Does anyone

knows
how to make this?

Thank You,
Miguel


Nov 18 '05 #5
Try with this :

<script runat=server language=C#>
private void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{

}
}
private void DropDownList1_SelectedIndexChanged(object sender,
System.EventArgs e)
{
if (((DropDownList)sender).SelectedValue != "")
Response.Redirect(((DropDownList)sender).SelectedV alue);
}

</script>

<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server" OnLoad="Page_Load">
<asp:DropDownList id="DropDownList1" style="Z-INDEX: 101; LEFT: 184px;
POSITION: absolute; TOP: 184px"
runat="server" AutoPostBack="True"
OnSelectedIndexChanged="DropDownList1_SelectedInde xChanged">
<asp:ListItem value="">item0</asp:ListItem>
<asp:ListItem
value="http://www.bonsalunos.com">item1</asp:ListItem>
<asp:ListItem value="http://www.sapo.pt">item2</asp:ListItem>
<asp:ListItem value="http://www.google.com">item3</asp:ListItem>

</asp:DropDownList>
</form>
</body>

"Miguel Dias Moura" <in************@27lamps.com> wrote in message
news:ej**************@TK2MSFTNGP11.phx.gbl...
Hi,

i wrote this script but it's not working as i expected. Can you tell me what am i doing wrong?

<script runat="server">

Sub Page_Load(Sender As Object, E As EventArgs)
if myselect.AutoPostBack then
Response.Redirect ("http://" &
myselect.items(myselect.SelectedIndex).Value)
end if
End Sub

</script>

Drop Down Menu:

<asp:DropDownList AutoPostBack="true" ID="myselect" runat="server">
<asp:ListItem value="www.bonsalunos.com">item1</asp:ListItem>
<asp:ListItem value="www.sapo.pt">item2</asp:ListItem>
<asp:ListItem value="www.google.com">item3</asp:ListItem>
</asp:DropDownList>

Thanks,
Miguel

"Bruno Sirianni" <br***********@virgilio.it> wrote in message
news:Z_*******************@news3.tin.it...
<asp:DropDownList /> have AutoPostBack property. If this property is set to
true it automatically when change the List value fire a

SelectedIndexChanged
event on Page.

In this method you can switch the DropDownList.SelectedValue and make a
Redirect where you want.

Brun
"Miguel Dias Moura" <in************@27lamps.com> wrote in message
news:OP**************@TK2MSFTNGP11.phx.gbl...
Hello,

i have a drop down menu in ASP.net with 5 options. I want to redirect
to a certain page when a certain option is selected.
I want to be redirected without having to click a button. Does anyone

knows
how to make this?

Thank You,
Miguel



Nov 18 '05 #6

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

Similar topics

4
by: Simon Birch | last post by:
Hi, I hope someone can help with this, it is driving me bonkers. After reading the Suckerfish Dropdown article on A List Apart, I decided to try and create a side menu based on the code I'd seen....
3
by: Miguel Dias Moura | last post by:
Hello, i have a drop down menu in ASP.net with 5 options. I want to redirect to a certain page when a certain option is selected. I want to be redirected without having to click a button. Does...
2
by: Calvin KD | last post by:
Hi everyone, Can someone show me or point me in the right direction as how to create a "dropdown menu" which displays the menu items as a separete layer over the top of the contents of the page...
3
by: ACaunter | last post by:
Hi there, can someone please tell me what the easiest way to have a dropdown menu bar positioned on the screen (eg. Home, company, ... , contact us) then when the mouse goes over then, the sub...
8
by: gs | last post by:
I was able to set tooltips on objects other than main menu. I would like to get the effect of tooltip or microhelp in the bottom status bar when the mouse is hovering over a submenu item. How do...
3
by: mckbill | last post by:
Is there a way I can direct the cursor to a specific field (variable) in a form by typing the field name while in form view? I have a form with many fields, and it would be nice if there were...
19
by: Jim | last post by:
Hi, I have two questions/problems pertaining to CSS horizontal dropdown menus and am hoping that someone here can help me out. (1) I'm having a problem centering the menu. I picked up the...
13
by: PetterL | last post by:
I writing a program where I read menu items from a file. But I have problem when I click an menu item i want it to mark that one as checked but I cant access the menu object of that item to see...
2
by: dorayme | last post by:
After posting similar in another forum a few hours ago, it strikes me I should have subscribed to this group and included it here. There may be a simple js tweak that someone knows or can think of:...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.