Welcome to AspAdvice Sign in | Join | Help

How do I set the TransformArgumentList property of the Xml Control

The Xml server control has a nice property that can only be set from code the TransformArgumentList. Here is an example of how to create an XsltArguementList, add a parameter named "Category" from the query string, and finally assign the XsltArguementList to Xml1 (an Xml server control):

<%@ Page language="c#" %>
<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
if(Request["cat"] != null)
{
System.Xml.Xsl.XsltArgumentList XsltArgumentList1 = new System.Xml.Xsl.XsltArgumentList();
XsltArgumentList1.AddParam("Category", "", Request["cat"].ToString());
Xml1.TransformArgumentList = XsltArgumentList1;
}
}
</script>
<html>
<body>
<asp:Xml id="Xml1" runat="server" DocumentSource="Document.xml" TransformSource="Style.xsl" />
</body>
</html>

Published Monday, May 23, 2005 12:58 PM by andrewmooney
Filed under:

Comments

No Comments

Anonymous comments are disabled