Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LiteralControl - Escaping Double Quotes

Status
Not open for further replies.

anonim1

Programmer
Dec 10, 2004
108
0
0
US
I am using page inheritance to put the same header tags on all of my web forms. Currently, I am creating a LiteralControl and putting the HTML tags in there, and then using Controls.Add to add the control to my web form. However, I don't seem to be able to use double-quotes inside the LiteralControl. This works:

Code:
LiteralControl ltcTest1 = new LiteralControl(@"
<html>
    <head>
        <title>Page Title</title>
    </head>
    <body>
");

This does not:

Code:
LiteralControl ltcTest2 = new LiteralControl(@"
<html>
    <head>
        <title>Page Title</title>
        <link type="text/css" href="css/main.css" rel="stylesheet">
    </head>
    <body>
");

I've also tried

Code:
<link type=\"text/css\" href=\"css/main.css\" rel=\"stylesheet\">

but it doesn't work. Is it possible to use double-quotes inside a LiteralControl? If so, how is it done?
 
Please disregard the above message.. the errors disappeared after I rebuilt the solution.
 
You can get double quotes with either Chr(34) or """" (4 of them).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top