Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

building asp.net tag string for output

Posted on 2002-05-16
4
Medium Priority
?
240 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 23

Accepted Solution

by:
naveenkohli earned 200 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

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
The viewer will learn how to count occurrences of each item in an array.

719 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