CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1

    ASP.NET escape quotes?

    Hi,

    In ASP.NET, when you have quotes within a variable, how do you escape them?

    For instance, it might look like this:
    myvar = "<input type="text" name="mytext">"

    I know in PHP this is so easy because you can just use a \".

    Does anybody have any idea how this would be done in ASP.NET?

    Thanks for your help

  2. #2
    Join Date
    Feb 2005
    Location
    Denmark
    Posts
    742

    Re: ASP.NET escape quotes?

    It's different whether you use C# or VB.NET.
    If using C# it is \ if I remember right (can also use @before a string)
    If using VB.NET an additional " will escape the following ".

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured