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:
Code |
Code |
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Jaish MathewsRank #225 · 11K reputationPosted Jan 15, 2011, 1:01 AM EST
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");
}
Becky Bloomwood110 reputationPosted Jan 15, 2011, 3:56 AM EST
Jaish MathewsRank #225 · 11K reputationPosted Jan 15, 2011, 6:34 AM EST
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 Bloomwood110 reputationPosted Jan 15, 2011, 4:57 PM EST
Rey Lopez5 reputationPosted Sep 5, 2012, 10:59 AM EDT
Sukesh MarlaRank #461 · 5.4K reputationPosted Sep 5, 2012, 11:38 AM EDT
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 Lopez5 reputationPosted Sep 5, 2012, 12:54 PM EDT
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");
}