J
Jan Eliasen
Hi
I have an ImageButton on my webpage. It is on a .ascx-page and I have
a .ascx.cs behind this file. I need to be able to call a
javascript-function in my codebehind. When the user presses the
ImageButton, I want something done, and then if this goes well, a
certain javascriptfunction should be called.
I tried adding this to my function in my codebehind;
string myScript = "<script
language=Javascript>aliert('Testing');</script>";
Page.RegisterClientScriptBlock("mailsent", myScript);
And this works great. But I simply cannot figure out how to have
linebreaks in the text the alert-box shows. If I add a "\n" to the
text, then I get an "Unterminated string" error.
Any ideas? Everything is appreciated!
I have an ImageButton on my webpage. It is on a .ascx-page and I have
a .ascx.cs behind this file. I need to be able to call a
javascript-function in my codebehind. When the user presses the
ImageButton, I want something done, and then if this goes well, a
certain javascriptfunction should be called.
I tried adding this to my function in my codebehind;
string myScript = "<script
language=Javascript>aliert('Testing');</script>";
Page.RegisterClientScriptBlock("mailsent", myScript);
And this works great. But I simply cannot figure out how to have
linebreaks in the text the alert-box shows. If I add a "\n" to the
text, then I get an "Unterminated string" error.
Any ideas? Everything is appreciated!