Solved

building asp.net tag string for output

Posted on 2002-05-16
4
234 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
I starting with php 12 115
Specific format 21 182
Forcing form refresh - classic ASP 7 59
HTML in email body has extra  tick marks 3 64
Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

895 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

19 Experts available now in Live!

Get 1:1 Help Now