Wednesday, March 21, 2012

Problem in redirection

I have a problem plz help me to sort out it

i am displaying an alert message by java script on page event.

now if user click on the "ok" button of alert then user should navigate to other page other wise not.

if i place Response.Redirect after

"ScriptManager.RegisterClientScriptBlock(this,this.GetType(),"myScript","alert(\"Your registration has been submitted and is waiting for approval from administrator. After approval/denial you will be notified at the provided email address.\");",true);"

it does not show the alert

what should i do to resolve it

help me

try this..

in html

<htmlxmlns="http://www.w3.org/1999/xhtml">

<headrunat="server">

<title>Untitled Page</title>

<scriptlanguage="javascript"type="text/javascript">

function showmsgbox()

{

alert("hi");

}

</script>

</head>

<body>

<formid="form1"runat="server">

<div>

<asp:ButtonID="Button4"runat="server"OnClick="Button4_Click"Text="Button"OnClientClick="showmsgbox()"/></div></form>

</body>

</html>

and in code behind..

protectedvoid Button4_Click(object sender,EventArgs e)

{

Response.Redirect("~/Default8.aspx");

}

No comments:

Post a Comment