Help with HtmlTextWriter

Discussion in 'ASP .Net' started by larryvan, Jan 5, 2006.

  1. larryvan

    larryvan Guest

    I have been beating my head against a wall for two days now. I need to
    output a hyperlink using htmltextwriter.write that looks like this:

    <a href='manageforums.aspx?CID=<%=Request.QueryString("CID")%>'>

    When I run the app and click on the link it looks like this:

    http://mycomputer/xmlnodes/manageforums.aspx?CID=<%=Request.QueryString("CID")%>

    If I view the source in notepad the syntax for the link is correct.
    Furthermore, I can save that page with a .aspx extension and load it
    into the browser and the link works correctly.

    Any ideas? This seems like something developers would want to do quite
    often.
    larryvan, Jan 5, 2006
    #1
    1. Advertising

  2. I can't seem to see your page.

    Try UrlEncode the link.

    Response.Redirect("http://mycomputer/xmlnodes/manageforums.aspx?CID=" +
    Server.UrlEncode("<%=Request.QueryString("CID")%>"));


    "larryvan" <> wrote in message
    news:...
    >I have been beating my head against a wall for two days now. I need to
    > output a hyperlink using htmltextwriter.write that looks like this:
    >
    > <a href='manageforums.aspx?CID=<%=Request.QueryString("CID")%>'>
    >
    > When I run the app and click on the link it looks like this:
    >
    > http://mycomputer/xmlnodes/manageforums.aspx?CID=<%=Request.QueryString("CID")%>
    >
    > If I view the source in notepad the syntax for the link is correct.
    > Furthermore, I can save that page with a .aspx extension and load it
    > into the browser and the link works correctly.
    >
    > Any ideas? This seems like something developers would want to do quite
    > often.
    >
    Grant Merwitz, Jan 5, 2006
    #2
    1. Advertising

  3. larryvan

    Larry Van Guest

    Grant,

    Thanks for replying. What I am trying to do is use the htmltextwriter
    to output the line. I am reading in an xml file and parsing it for
    output to an aspx page.

    Here is the line of code:

    htmltextwriter.writer(("'<a
    href=my.aspx?CID=<%=request.querystring(&quot;CID&quot;)%>'>my
    link</a>")

    As I mentioned above, when I run the web app the link shows
    http://mycomputer/xmlnodes/manageforums.aspx?CID=<%=Request.QueryString("CID")%>
    (mycomputer is a fictious url)

    If I view source with notepad and save it as an aspx page the link
    works properly.

    Larry

    On Thu, 5 Jan 2006 09:53:36 -0000, "Grant Merwitz"
    <> wrote:

    >I can't seem to see your page.
    >
    >Try UrlEncode the link.
    >
    >Response.Redirect("http://mycomputer/xmlnodes/manageforums.aspx?CID=" +
    >Server.UrlEncode("<%=Request.QueryString("CID")%>"));
    >
    >
    >"larryvan" <> wrote in message
    >news:...
    >>I have been beating my head against a wall for two days now. I need to
    >> output a hyperlink using htmltextwriter.write that looks like this:
    >>
    >> <a href='manageforums.aspx?CID=<%=Request.QueryString("CID")%>'>
    >>
    >> When I run the app and click on the link it looks like this:
    >>
    >> http://mycomputer/xmlnodes/manageforums.aspx?CID=<%=Request.QueryString("CID")%>
    >>
    >> If I view the source in notepad the syntax for the link is correct.
    >> Furthermore, I can save that page with a .aspx extension and load it
    >> into the browser and the link works correctly.
    >>
    >> Any ideas? This seems like something developers would want to do quite
    >> often.
    >>

    >
    Larry Van, Jan 7, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rukmal Fernando
    Replies:
    0
    Views:
    955
    Rukmal Fernando
    Oct 3, 2003
  2. =?Utf-8?B?VGFtbXk=?=

    htmltextwriter - error

    =?Utf-8?B?VGFtbXk=?=, Apr 26, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    422
    =?Utf-8?B?VGFtbXk=?=
    Apr 26, 2004
  3. Leon

    HtmlTextWriter Email Usage?

    Leon, Oct 24, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    385
  4. Jeff Evans
    Replies:
    2
    Views:
    1,107
    Jeff Evans
    Dec 5, 2004
  5. =?Utf-8?B?cm9kY2hhcg==?=

    htmltextwriter help

    =?Utf-8?B?cm9kY2hhcg==?=, Nov 19, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    604
    =?Utf-8?B?cm9kY2hhcg==?=
    Nov 21, 2006
Loading...

Share This Page