473,396 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Help with HtmlTextWriter

I have been beating my head against a wall for two days now.

I have developed a treeview control that reads in an xml file which
holds the information for building the tree. The nodes are hyperlinks
to other pages. I want to be able to include the inline code
<%Request.QueryString("CID")%>

I use the htmltextwriter.write method to output the node.

The problem is: When I run the app, the link appears in the page fine
but when I roll over the link the url shows as:
http://mycomputer/xmlnodes/manageforums.aspx?CID=<%=Request.QueryString("CID" )%>

Upon further testing, it appears that there is something going on with
the htmltextwriter.write method. I did a simple experiment with the
following piece of code:
htmltextwriter.write(<a
href='manageforums.aspx?CID=<%=Request.QueryString ("CID")%>'>my
link</a>")

This produced the same result as above.

If I do " view source" from the browser, which opens 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.
Jan 7 '06 #1
2 1746
Hello Larry,

Instead of the string literals '<' use &lt; or <

instead of '>' use > or &gt;

Cyril Gupta
Jan 7 '06 #2
Cyril,

Thanks for replying. I tried that and got the same results. I used:

htmltextwriter.write(<a
href=&apos;'manageforums.aspx?CID=&lt;%=Request.Qu eryString(&quot;CID&quot;)%&gt;&apos;'>my
link</a>")

any other ideas?

On Sat, 7 Jan 2006 10:31:13 +0530, "Cyril Gupta" <no****@mail.com>
wrote:
Hello Larry,

Instead of the string literals '<' use &lt; or <

instead of '>' use > or &gt;

Cyril Gupta

Jan 8 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Blaz Ziherl | last post by:
Hi, I am developing an application in VisualBasic .NET and got the following error: "An unhandled exception of type 'System.InvalidCastException' occurred in microsoft.visualbasic.dll ...
4
by: DOTNET | last post by:
Hi, Anybody help me regarding this error: I am assigning the values to the session variables when the button is clicked and passing these session variables to the next page and when I am...
3
by: Lee Chapman | last post by:
Hi, I want my ASP.NET web application to use a custom HtmlTextWriter. i.e. I want the object that the Framework passes to System.Web.UI.Control.Render() to be my own object, MyHtmlTextWriter,...
2
by: larryvan | last post by:
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...
4
by: James Page | last post by:
I can't seem to get HtmlTextWriter / renderControl to work for sending a control (html) in an e-mail messsage (VB.NET). Keeps telling me that control needs to be in a form tag with runat server...
10
by: David Thielen | last post by:
Hi; I have help html pages for each page of my ASP.NET webapp. So for the page datasource.aspx, I have help\datasource.htm. Bu what I want when the hyperlink is clicked, for it to look for the...
2
by: rodchar | last post by:
hey all, can someone please show me how to write this to a stringbuilder using the htmltextwriter: <ul><li>test</li></ul> thanks, rodchar
1
by: =?Utf-8?B?RGFuaWVsIERpIFZpdGE=?= | last post by:
I posted this a week ago, but did not get a respone yet. I need to render a user control as a HTML string. I do not want the control to appear on the page, however. Here is what I am doing… I...
0
by: dihola | last post by:
Hi all, A component I have renders itself (essentially an HTML table) using an HtmlTextWriter object to create some HTML code. This component is part of an aspx page. I need the component to also...
1
by: Sh0eshineboy | last post by:
System.Data.SqlClient.SqlException: Divide by zero error encountered System.Data.SqlClient.SqlDataReader.Read() +176 System.Data.Common.DbDataAdapter.FillLoadDataRow(SchemaMapping mapping)...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.