Hi ,I am doing a message box that when user clicks on the Ok button, it will redirects to another aspx page. However, I do not know what is wrong with the code.
This is the code that I have input in:
|
|
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Rey LopezPosted Sep 5, 2012, 4:54 PM
if (MessageBox.Show("The Category Description has been repeated, please make the necessary changes! ", "Template", MessageBoxButtons.OK, MessageBoxIcon.None).Equals(DialogResult.OK))
{
//If IE browser using
System.Diagnostics.Process.Start("iexplore", "ViewCategory.aspx");
//If firefox using
System.Diagnostics.Process.Start("firefox", "ViewCategory.aspx");
}
Sukesh MarlaPosted Sep 5, 2012, 3:38 PM
Take look at you application, when message box shows a new process starts, it wont work properly..
use this
Page.ClientScript.RegisterStartupScript(typeof(string),"Showmessage",
"javascript:alert("hi");document.location.hred="NewURI",true);
Check this is correct answer if it helped,.
Rey LopezPosted Sep 5, 2012, 2:59 PM
Becky BloomwoodPosted Jan 15, 2011, 9:57 PM
Jaish MathewsPosted Jan 15, 2011, 11:34 AM
That won't work. 1st run the aspx in a browser. Then what's displaying in addressbar, use that full path in your window application
Becky BloomwoodPosted Jan 15, 2011, 8:56 AM
Jaish MathewsPosted Jan 15, 2011, 6:01 AM
You should mention what error you are getting. Then also by reading your code I assumed you done below mistake
So your code need to be corrected like below
if (MessageBox.Show("The Category Description has been repeated, please make the necessary changes! ", "Template", MessageBoxButtons.OK, MessageBoxIcon.None).Equals(DialogResult.OK))
{
//If IE browser using
System.Diagnostics.Process.Start("iexplore", "ViewCategory.aspx");
//If firefox using
System.Diagnostics.Process.Start("firefox", "ViewCategory.aspx");
}