Link to home
Start Free TrialLog in
Avatar of jmcdonald69124
jmcdonald69124Flag for United States of America

asked on

C# Web App Msg Box Question

C# Web application,

I have a C# web app where I build an adhoc query based on user input, I have discovered an error in the query and would like to implement a msgbox that displays the sql behind the query at the various stages of execution, I know that I could debug, however, for reasons I can't get into on this thread that is not an option. I have the follwing:

return strSQL;

getting passed to another function, right before returning this value I would like to have a msgbox pop up and display the value, problem is I do not know how to accomplish this.

Any help, ideas would be great.
J
Avatar of pallosp
pallosp

The following line will show a popup message in the browser:

Response.Write(string.Format(
    "<script> alert("{0}"); </script>",
    message.Replace("\"", "\\\""));

You may want to clear the content before showing the popup message:

Response.Clear();
Sorry, there were some misspellings in the code:

Response.Write(string.Format(
    "<script> alert(\"{0}\"); </script>",
    message.Replace("\"", "\\\"")));
Avatar of jmcdonald69124

ASKER

Got that but how does my server side string get inbetween the script tags?
ASKER CERTIFIED SOLUTION
Avatar of pallosp
pallosp

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Got it, I went with a textbox that you can click on in a div tag with a (+) symbol that has a label that shows/hides the sql statement for the user.