Solved

building asp.net tag string for output

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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Suggested Solutions

Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

752 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