Rick Bonnett
1/23/2003 2:59:00 AM
I'm trying to do this as well, and having no luck
parameterizing my Treeview control. Here's a snippet from
my .aspx page:
<%
String mgrID;
String[] sArray;
sArray = Request.QueryString.GetValues("mgrID");
if ((sArray == null) || (sArray.Length <= 0))
mgrID = Session["ManagerID"].ToString();
else
mgrID = sArray[0];
if ((mgrID == null) || (mgrID.Length <= 0))
mgrID = "1197";
Session["ManagerID"] = mgrID;
Response.Write("<!-- mgrID:" + mgrID + "-->");
%>
<form id="WebForm3" method="post" runat="server">
<iewc:TreeView id="TreeView1" style="Z-INDEX: 101; LEFT:
3px; POSITION: absolute; TOP: 30px"
TreeNodeSrc="http://ptll3g98021/treeproject/makeOrgTree.as
px?mgrID=3512"
TreeNodeXsltSrc="tree2.xsl" runat="server">
</iewc:TreeView>
</form>
The above works fine. But if I declare the TreeNodeSrc as:
TreeNodeSrc="http://ptll3g98021/treeproject/makeOrgTree.as
px?mgrID=<%mgrID%>"
I end up with no nodes in the resulting tree. I've tried
various combos of putting the in-line tag inside and
outside the quotes, as well as building the entire
TreeNodeSrc value as a string and including that using <%
%>. All the variations I;ve tried result in various
comile or run-time errors.
It appears that the in-line <% %> tag is not being
replaced with a value, but instead is being sent through
as the literal <%mgrID%>.
Any insights?
>-----Original Message-----
>Don't think it is possible directly.
>
>However, you could create a custom aspx page to run the
>transform for you and return the xml...something like:
>
>DoTransform.aspx?File=/myxml.xml&Param1=myParam
>
>Then, set this as the source.
>
>--Jesse
>
>>-----Original Message-----
>>Hello,
>>
>>I've just started using this control and am creating
the
>control by
>>doing the following:
>>
>>tree1.TreeNodeSrc = Server.MapPath("")
>& "/tree/tree.xml"
>>tree1.TreeNodeXsltSrc = Server.MapPath("")
>& "/tree/tree.xsl"
>>tree1.DataBind()
>>
>>now I have created the tree.xml file previously by
>running a previous
>>transformation on another xml file using a parameter
>passed to the xsl
>>document.
>>
>>Problem is: If I want to do all of the above in one go
>I can create a
>>new xsl file for the orginal document to format it
>appropriately, but
>>how can I pass a parameter into the xsl file
>(TreeNodeXsltSrc) ?
>>
>>Thanks in advance.
>>.
>>
>.
>