response.Write("<form" syntax

Posted on 2008-11-14
Last Modified: 2012-05-05
I have an html form within a webform that I am creating dynamically as part of a bank card authorisation stage.

Im not very familliar with escape characters in c#. I need to convert the from VB to c# the following.
Please would someone start me off for the first line?
Should it be
Response.Write("<FORM name=\"\"form\"\" action=\"\"\" & strACSURL & \"\"\" method=\"\"POST\"\"

Here is the code I want to convert.
Response.Write("<FORM name=""form"" action=""" & strACSURL & """ method=""POST"" target=""3DIFrame""/>")
    Response.Write("<input type=""hidden"" name=""PaReq"" value=""" & strPAReq & """/>")
    Response.Write("<input type=""hidden"" name=""TermUrl"" value=""" & strTermURL & """/>")
    Response.Write("<input type=""hidden"" name=""MD"" value=""" & strMD & """/>")
    Response.Write("<center><p>Please click button below to Authenticate your card</p><input type=""submit"" value=""Go""/></p></center>")
Question by:nigelstephens
    LVL 142

    Accepted Solution

    in VB, you use 2 double quotes inside a string.
    in C#, you escape the double quote with @
    Response.Write("<FORM name=\"form\" action=\"\" & strACSURL & \"\" method=\"POST\"
    target=\"3DIFrame\" />")

    Open in new window

    LVL 142

    Expert Comment

    by:Guy Hengel [angelIII / a3]
    Response.Write("<FORM name=\"form\" action=\"" + strACSURL + "\" method=\"POST\"
    target=\"3DIFrame\" />")

    Open in new window


    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
    This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now