Displaying Message Before Redirecting

Posted by Thandra.Mahesh under ASP.NET on 4/11/2012 | Points: 10 | Views : 1865 | Status : [Member] | Replies : 4
Hi
i have written the below lines of code in my project .I am not excuting it properly .
{
Page.ClientScript.RegisterStartupScript(typeof(string), "MyScript", "<script>alert('Data Submitted Successfully')</script>");
Responser.Redirect("inbox.aspx");
}
it i wrote like the above it is directly redirecting into inbox.aspx page with out showing message first .Please tell me know what exaclty happening there.

Thanks In Advance..

Mahesh Thandra


Responses

Posted by: Santosh.Choudhury on: 4/12/2012 [Member] Starter | Points: 25

Up
0
Down
StringBuilder sb = new StringBuilder();
sb.Append("<script>");
sb.Append("alert('Data Submitted Successfully')")

sb.Append("</scri");
sb.Append("pt>");
Page.RegisterStartupScript("typeof(string)", sb.ToString());
Responser.Redirect("inbox.aspx");

try this may be it solve your problem

Thandra.Mahesh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Santosh.Choudhury on: 4/12/2012 [Member] Starter | Points: 25

Up
0
Down
is this working??

Thandra.Mahesh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Thandra.Mahesh on: 4/13/2012 [Member] Starter | Points: 25

Up
0
Down
No .Its not working ..

Mahesh Thandra

Thandra.Mahesh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vforvijay on: 4/13/2012 [Member] Starter | Points: 25

Up
0
Down
hi..
For your problem refer the below link
http://www.dotnetcode.in/2012/02/show-alert-message-from-server-side.html

Thandra.Mahesh, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response