Proper way to write this...


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 7 of 7

Thread: Proper way to write this...

  1. #1
    Saiful Guest

    Proper way to write this...


    Hi All

    What is the proper way to write a Href statement using Response.write.

    I need to write this:-
    <%Response.Write("<a href="../MainContents.asp/">Back to Home</a>")%>


    But due to the double quotes existing within inside the reference location,
    I am not getting the right page. Please ,anyone, tell me the correct way
    to write a response.write for a href location as in above.


    rgds,
    Saiful

  2. #2
    Don Wolthuis Guest

    Re: Proper way to write this...


    Sauful,

    How's it going. Here is how you do it~

    VBScript
    =========
    Response.Write "<A Href=""test../MainContents.ASP"">"
    Use double quotes when you need to embed within quotes

    JavaScript
    ============
    Response.Write("A Href=\"test../MainContents.ASP\">")
    use the "Wack" to hide the inner " the wack is a cancel character.

    Hope this helps!
    _______________________________
    Don R. Wolthuis, MCSD
    Codejunkies.net
    don.wolthuis@codejunkies.net
    Comming Soon...
    http://www.theFutureOfASP.com
    http://www.aspNextGen.com
    2 Sites devoted to ASP+


    "Saiful" <md-saifulamri_omar@hp.com> wrote:
    >
    >Hi All
    >
    >What is the proper way to write a Href statement using Response.write.
    >
    >I need to write this:-
    ><%Response.Write("<a href="../MainContents.asp/">Back to Home</a>")%>
    >
    >
    >But due to the double quotes existing within inside the reference location,
    >I am not getting the right page. Please ,anyone, tell me the correct way
    >to write a response.write for a href location as in above.
    >
    >
    >rgds,
    >Saiful



  3. #3
    John Timney (MVP) Guest

    Re: Proper way to write this...

    you could use chr(34) when you need to wrap a string with a quote mark.

    Response.Write("<a href=" & chr(34) & "../MainContents.asp/" & chr(34) &
    ">Back to Home</a>")

    Regards

    John Timney (MVP)


    > What is the proper way to write a Href statement using Response.write.
    >
    > I need to write this:-
    > <%Response.Write("<a href="../MainContents.asp/">Back to Home</a>")%>






  4. #4
    Sreenivas Guest

    Re: Proper way to write this...


    Hi Saiful

    The best way to write the same code os as follows.


    <%Response.Write('<a href="../MainContents.asp/">Back to Home</a>')%>

    Try this and let me know. You can also use the AScii character for this qoute,
    but this method should also work..

    Sreenivas






    "Saiful" <md-saifulamri_omar@hp.com> wrote:
    >
    >Hi All
    >
    >What is the proper way to write a Href statement using Response.write.
    >
    >I need to write this:-
    ><%Response.Write("<a href="../MainContents.asp/">Back to Home</a>")%>
    >
    >
    >But due to the double quotes existing within inside the reference location,
    >I am not getting the right page. Please ,anyone, tell me the correct way
    >to write a response.write for a href location as in above.
    >
    >
    >rgds,
    >Saiful



  5. #5
    Dave Kraft Guest

    Re: Proper way to write this...

    That isn't going to work because ' is the VB/VBScript comment delimiter

    "Sreenivas" <sreenivas_r@hotmail.com> wrote in message
    news:3980521d$1@news.devx.com...
    >
    > Hi Saiful
    >
    > The best way to write the same code os as follows.
    >
    >
    > <%Response.Write('<a href="../MainContents.asp/">Back to Home</a>')%>
    >
    > Try this and let me know. You can also use the AScii character for this

    qoute,
    > but this method should also work..
    >
    > Sreenivas
    >
    >
    >
    >
    >
    >
    > "Saiful" <md-saifulamri_omar@hp.com> wrote:
    > >
    > >Hi All
    > >
    > >What is the proper way to write a Href statement using Response.write.
    > >
    > >I need to write this:-
    > ><%Response.Write("<a href="../MainContents.asp/">Back to Home</a>")%>
    > >
    > >
    > >But due to the double quotes existing within inside the reference

    location,
    > >I am not getting the right page. Please ,anyone, tell me the correct way
    > >to write a response.write for a href location as in above.
    > >
    > >
    > >rgds,
    > >Saiful

    >




  6. #6
    Russ Wickstrom Guest

    Re: Proper way to write this...

    True, but if you use ' to delimit the inner string it WOULD work...

    as in:

    <%Response.Write("<a href='../MainContents.asp/'>Back to Home</a>")%>

    (because HTML isn't as picky as VBScript)


    --Russ

    ---

    Dave Kraft <dkraft@tsrnet.com> wrote in message
    news:39806076@news.devx.com...
    > That isn't going to work because ' is the VB/VBScript comment delimiter
    >
    > "Sreenivas" <sreenivas_r@hotmail.com> wrote in message
    > news:3980521d$1@news.devx.com...
    > >
    > > Hi Saiful
    > >
    > > The best way to write the same code os as follows.
    > >
    > >
    > > <%Response.Write('<a href="../MainContents.asp/">Back to Home</a>')%>
    > >
    > > Try this and let me know. You can also use the AScii character for this

    > qoute,
    > > but this method should also work..
    > >
    > > Sreenivas
    > >
    > >
    > >
    > >
    > >
    > >
    > > "Saiful" <md-saifulamri_omar@hp.com> wrote:
    > > >
    > > >Hi All
    > > >
    > > >What is the proper way to write a Href statement using Response.write.
    > > >
    > > >I need to write this:-
    > > ><%Response.Write("<a href="../MainContents.asp/">Back to Home</a>")%>
    > > >
    > > >
    > > >But due to the double quotes existing within inside the reference

    > location,
    > > >I am not getting the right page. Please ,anyone, tell me the correct

    way
    > > >to write a response.write for a href location as in above.
    > > >
    > > >
    > > >rgds,
    > > >Saiful

    > >

    >
    >




  7. #7
    Russell Greenlaw Guest

    Re: Proper way to write this...

    Russ,

    No because the vbscript.dll will think everything after the first ' is a
    comment and give you a syntax error. The best way to write it is
    <%Response.Write("<a href=""../MainContents.asp/"">Back to Home</a>")%>

    The double double quote is the escape character for double quotes in
    strings.

    HTH

    --
    Russell
    ---------------------------------------
    Return address modified


    "Russ Wickstrom" <rwickstrom@bgea.org> wrote in message
    news:39821be5$1@news.devx.com...
    > True, but if you use ' to delimit the inner string it WOULD work...
    >
    > as in:
    >
    > <%Response.Write("<a href='../MainContents.asp/'>Back to Home</a>")%>
    >
    > (because HTML isn't as picky as VBScript)
    >
    >
    > --Russ
    >
    > ---
    >
    > Dave Kraft <dkraft@tsrnet.com> wrote in message
    > news:39806076@news.devx.com...
    > > That isn't going to work because ' is the VB/VBScript comment delimiter
    > >
    > > "Sreenivas" <sreenivas_r@hotmail.com> wrote in message
    > > news:3980521d$1@news.devx.com...
    > > >
    > > > Hi Saiful
    > > >
    > > > The best way to write the same code os as follows.
    > > >
    > > >
    > > > <%Response.Write('<a href="../MainContents.asp/">Back to Home</a>')%>
    > > >
    > > > Try this and let me know. You can also use the AScii character for

    this
    > > qoute,
    > > > but this method should also work..
    > > >
    > > > Sreenivas
    > > >
    > > >
    > > >
    > > >
    > > >
    > > >
    > > > "Saiful" <md-saifulamri_omar@hp.com> wrote:
    > > > >
    > > > >Hi All
    > > > >
    > > > >What is the proper way to write a Href statement using

    Response.write.
    > > > >
    > > > >I need to write this:-
    > > > ><%Response.Write("<a href="../MainContents.asp/">Back to Home</a>")%>
    > > > >
    > > > >
    > > > >But due to the double quotes existing within inside the reference

    > > location,
    > > > >I am not getting the right page. Please ,anyone, tell me the correct

    > way
    > > > >to write a response.write for a href location as in above.
    > > > >
    > > > >
    > > > >rgds,
    > > > >Saiful
    > > >

    > >
    > >

    >
    >




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center