tags:

views:

169

answers:

6

for writing images on a html page i want to write only " after closing are anyone tell me about this then how i can write this

means to say that

<img src = " <% code is here %> " />
A: 

To put double quotes into a string you have to escape them with a backslash. E.g.:

String myString = "hello \" double quotes";
ck
+6  A: 

It can be done like this, by escaping the quote with \"

String myStr = "Hello World";
myStr += "\"";
Silas Hansen
+1  A: 
string s = "\"";
CD
+3  A: 

You can also use this syntax:

var s = @"a string with ""double quotes";
s += @"""";
klausbyskov
+2  A: 

If using variable or expression use this:

<% string imagePath = @"c:\Images\wallpaper.jpg"; %>
<img src = "<%=imagePath%> "/>

If using statement use this:

<img src = "<% 

    string imagePath = @"c:\Images\wallpaper.jpg";

    Response.Write(imagePath);

%>">
Michael Buen
+1  A: 

" is a special char. You need to prefix it with a \ otherwise it will interprete the " as the end of the string.

Details here: http://blogs.msdn.com/csharpfaq/archive/2004/03/12/88415.aspx

Flo