jmcdonald69124
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
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
Sorry, there were some misspellings in the code:
Response.Write(string.Form at(
"<script> alert(\"{0}\"); </script>",
message.Replace("\"", "\\\"")));
Response.Write(string.Form
"<script> alert(\"{0}\"); </script>",
message.Replace("\"", "\\\"")));
ASKER
Got that but how does my server side string get inbetween the script tags?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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.
Response.Write(string.Form
"<script> alert("{0}"); </script>",
message.Replace("\"", "\\\""));
You may want to clear the content before showing the popup message:
Response.Clear();