Solved

building asp.net tag string for output

Posted on 2002-05-16
4
233 Views
Last Modified: 2013-11-19
inside a codebehind file i build a string containing the <asp:xml> tag... with attributes inside etc.

then output that string in .aspx page as <%=strASPTag%>

the problem is that it is not resolving the tag... it just prints it out as plain text!

the string is being set like this in the codebehind:

strASPTag = "<ASP:XML ID='XMLContent' DOCUMENTSOURCE='../Foo.xml' TRANSFORMSOURCE='../Foo.xslt' RUNAT='server' />";

should i be using double-quotes instead of singles? if so, do i need to use some escape character?

thanks...
0
Comment
Question by:loyaliser
  • 2
  • 2
4 Comments
 
LVL 23

Accepted Solution

by:
naveenkohli earned 50 total points
ID: 7015323
Your string is alright, only problem is that ASP.Net is not prcessing your asp:xml server control. It emits the string as is.  All the server side control processing takes place at page load time. By the time you are trying to add asp:xml control using your technique, it is not processing the string as a server side control. It emits the string as any HTML tag.
If you want to add a asp:xml control at some location, use asp:PlaceHolder contro.. And then in your code behind, you can add asp:xml control to this place holder programtically.
0
 
LVL 1

Author Comment

by:loyaliser
ID: 7015426
that solves the problem... thank you!
0
 
LVL 23

Expert Comment

by:naveenkohli
ID: 7015543
I am glad that helped.
May be you wanna close this question and move it to PAQ.

Naveen
0
 
LVL 1

Author Comment

by:loyaliser
ID: 7016419
oops... forgot to close.

thanks again!
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

758 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

16 Experts available now in Live!

Get 1:1 Help Now