Click here to Skip to main content
15,881,380 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Guys!

I need to redirect from the selected value from the DropDownList to another webSite.
How do I redirect to the selected value?


Regards

rpkaran :rose:
Posted
Updated 9-Apr-11 3:03am
v2
Comments
Dalek Dave 9-Apr-11 9:03am    
Edited for Grammar, Syntax and Readability.

try this Link

Click[^]
 
Share this answer
 
Comments
Dalek Dave 9-Apr-11 9:04am    
Good Link
You need to handle the SelectedIndexChanged event and then do the Response.Redirect in the handler.
 
Share this answer
 
Comments
Dalek Dave 9-Apr-11 9:04am    
Nice answer D@nish.
something like below may helps you.

XML
<asp:DropDownList ID="ddlValues" OnSelectedIndexChanged="ddlValues_OnSelectedIndexChanged"
        runat="server">
        <asp:ListItem Text="Apple" Value="1"></asp:ListItem>
        <asp:ListItem Text="Microsoft" Value="2"></asp:ListItem>
    </asp:DropDownList>


C#
protected void ddlValues_OnSelectedIndexChanged(object sender, EventArgs e)
    {
        Response.Redirect("YouURL.aspx?Value=" + ddlValues.SelectedValue);
    }
 
Share this answer
 
If DropDownList1.SelectedValue = "1" Then
Response.Redirect(("Form1.aspx?Value=" + DropDownList1.SelectedValue))
ElseIf DropDownList1.SelectedValue = "2" Then
Response.Redirect(("Form2.aspx?Value=" + DropDownList1.SelectedValue))
ElseIf DropDownList1.SelectedValue = "3" Then
Response.Redirect(("Form1.aspx?Value=" + DropDownList1.SelectedValue))
End If
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900