How to launch another aspx web page upon button click?

后端 未结 5 1834
醉梦人生
醉梦人生 2020-12-09 18:45

I have an asp.net application, where the user would click a button and launch another page (within the same application). The issue I am facing is that the original page an

5条回答
  •  無奈伤痛
    2020-12-09 19:24

    If you'd like to use Code Behind, may I suggest the following solution for an asp:button -

    ASPX Page

    
    

    Code Behind

        protected void btnRecover_Click(object sender, EventArgs e)
        {
            var recoveryId = Guid.Parse(lbRecovery.SelectedValue);
            var url = string.Format("{0}?RecoveryId={1}", @"../Recovery.aspx", vehicleId);
    
            // Response.Redirect(url); // Old way
    
            Response.Write("");
            Response.End();
        }
    

提交回复
热议问题