Mega Code Archive

 
Categories / ASP.Net / Response
 

Redirect page to another URL (vb net)

<%@ Page Language="VB" %> <script language="vb" runat="server">    Sub Page_Load(Source As Object, E as EventArgs)      If Not IsPostBack Then        MyButton.Text = "OK"        MyDropDownList.Items.Add("http://www.rntsoft.com")        MyDropDownList.Items.Add("http://www.rntsoft.com")        MyDropDownList.Items.Add("http://www.rntsoft.com")      End If    End Sub    Public Sub Click (ByVal sender As Object, ByVal e As System.EventArgs)      Response.Redirect(MyDropDownList.SelectedItem.Text)    End Sub </script> <html>   <body>     <form id="WebForm1" method="post" runat="server">       <asp:DropDownList id=MyDropDownList runat="server"/>       <asp:button id=MyButton runat="server" OnClick="Click" Text=""/>     </form>   </body> </html>