Using " ' ' /' /' " in RegisterStartupScript

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

The function bellow is really ok as long I only write a text in the
document.write(). But I wish to place also a image on my frame side, but for
it I need to have in " " another " " and maybe in thats again the " " I
think it should be a way for my pic


Many thanks for help
Greetings
Patrick Marti

==================================
// I had to cut a bit my function to show here
==================================

private void Page_Load(object sender, System.EventArgs e)
{
scriptString += "function ShowPic(){";
scriptString += "document.write('Mein Bild')";
"... document.write(<img src=C:/Inetpub/wwwroot/A/Ima/Gr1.jpg>)}";
.......................
this.RegisterStartupScript("Startup", scriptString);
==============================================
 
When inserting " in C# strings you should prefix it the " with a \.

so:

string s = "Hello \"world\"";

as an example
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top