DFIM
asked on
Can't end url with response.write using C#
I am familiar with vbscript however converting to C# and trying to end a URL I have written with response.write. My code is below:
Response.Write("<a href= " + savePath + "</a>");
The URL works fine however everything on the page is linked to the URL. When I hover over the URL it has '/a' at the end ignoring the '>'.
Thanks for your help
Response.Write("<a href= " + savePath + "</a>");
The URL works fine however everything on the page is linked to the URL. When I hover over the URL it has '/a' at the end ignoring the '>'.
Thanks for your help
It is often better to try to refrain from Response.Write, but if you have to do it that way, do not forget that you ahve to provide the full and correct HTML for it, including quotes and text:
Response.Write("" + "this is my link" + "");
you can replace "this is my link" with savePath or any text you want to appear as the link.
If you use C# you probably also use ASP.NET where you should use a runat="server" link with an ID and you can then set that object's href and text from the code behind. That way, the syntax will automatically be correct.
Response.Write("" + "this is my link" + "");
you can replace "this is my link" with savePath or any text you want to appear as the link.
If you use C# you probably also use ASP.NET where you should use a runat="server" link with an ID and you can then set that object's href and text from the code behind. That way, the syntax will automatically be correct.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
(retry, the RTE #$%^&* it up...)
Response.Write("" + "this is my link" + "");
you can replace "this is my link" with savePath or any text you want to appear as the link.
Response.Write("" + "this is my link" + "");
you can replace "this is my link" with savePath or any text you want to appear as the link.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
""
outputs
that's just messed up html, try this:
Response.Write("" + savePath + "");