Как вызвать разные страницы на стороне сервера подтвердите ОК и отмените
I want to redirect the page on other form when click on ok of confirm and when click on cancel then cancel how i do this.. i use below code but this is not redirect to another page. i want to use the server side confirm not client side
protected void Page_Load(object sender, EventArgs e) { string message1 = "Do you want to Submit?"; System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append("return confirm('"); sb.Append(message1); sb.Append("');"); ClientScript.RegisterOnSubmitStatement(this.GetType(), "alert", sb.ToString()); } On button click i call protected void btnMsg_Click(object sender, EventArgs e) { System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append("<script type = 'text/javascript'>"); sb.Append("window.onload=function(){"); sb.Append("Response.Redirect('WebForm2.aspx'){"); sb.Append("</script>"); ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", sb.ToString()); } } }
Что я уже пробовал:
I want to redirect on webform 2 on confirm ok button click and on cancel i move to another..but this is not done plz recmond how i redirect this