2014-02-07 44 views

回答

0

onclick事件按鈕

<asp:Button ID="btnNext" runat="server" Font-Bold="true" ForeColor="DodgerBlue" 
       Text="Next" OnClick="btnNext_Click"/> 

添加在後面的代碼

protected void btnNext_Click(object sender,Event args e) 
    { 
    Response.Redirect("newPageUrl.aspx"); 
    } 

你也可以做到這一點使用JA vaScript,在代碼中不需要的代碼背後

<asp:Button ID="btnNext" runat="server" Font-Bold="true" ForeColor="DodgerBlue" 
        Text="Next OnClick="document.location.href='newPageUrl.aspx';"/> 
0
<asp:Button ID="btnNext" runat="server" Font-Bold="true" ForeColor="DodgerBlue" 
       Text="Next" OnClick="btnNext_click"/> 
代碼

背後

protected void btnNext_click(objecter sender,Event args e) 
{ 
Response.Redirect("yourUrl", True); 
} 
0

試試這個!

<asp:Button ID="btnNext" runat="server" Font-Bold="true" ForeColor="DodgerBlue" 
        Text="Next OnClientClick="window.location.href='newPageUrl.aspx';"/> 
相關問題