扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
<html> <script language="VB" runat="server"> Sub Page_Load(Sender As Object, E As EventArgs) Dim RandomGenerator As Random RandomGenerator = New Random(DateTime.Now.Millisecond) Dim RandomNum As Integer RandomNum = RandomGenerator.Next(0, 3) Select RandomNum Case 0: Name.Text = "Scott" Case 1: Name.Text = "Fred" Case 2: Name.Text = "Adam" End Select AnchorLink.NavigateUrl = "controls_navigationtarget_vb.aspx?name=" & System.Web.HttpUtility.UrlEncode(Name.Text) End Sub </script> <body> <h3><font face="Verdana">Performing Page Navigation (Scenario 1)</font></h3> <p> This sample demonstrates how to generate a HTML Anchor tag that will cause the client to navigate to a new page when he/she clicks it within the browser. <p> <hr> <p> <asp:hyperlink id="AnchorLink" font-size=24 runat=server> Hi <asp:label id="Name" runat=server/> please click this link! </asp:hyperlink> </body> </html> |
<html> <script language="VB" runat="server"> Sub EnterBtn_Click(Sender As Object, E As EventArgs) If Not (Name.Text = "") Response.Redirect("Controls_NavigationTarget_vb.aspx?name=" & System.Web.HttpUtility.UrlEncode(Name.Text)) Else Message.Text = "Hey! Please enter your name in the textbox!" End If End Sub </script> <body> <h3><font face="Verdana">Performing Page Navigation (Scenario 2)</font></h3> <p> This sample demonstrates how to navigate to a new page from within a <asp:button> click event, passing a <asp:textbox> value as a querystring argument (validating first that the a legal textbox value has been specified). <p> <hr> <form action="controls6.aspx" runat=server> <font face="Verdana">Please enter your name: <asp:textbox id="Name" runat=server/> <asp:button text="Enter" Onclick="EnterBtn_Click" runat=server/> <p> <asp:label id="Message" forecolor="red" font-bold="true" runat=server/> </font> </form> </body> </html> |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者