Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old October 20th, 2006, 11:35 AM
Join Date: Jul 2005
Posts: 317
Thanks: 0
Thanked 0 Times in 0 Posts
Default Pull and Assign XSLT Parameter from ASPX Doc

I've been able to pull and assign a XSLT parameter in ASP, but I'm now converting my site over to ASP.NET. I'm using XML, XSLT, ASP.NET, and VB.NET for this new site using the xslTransform method, and I want to pull an XSLT parameter into the ASP.NET page, and then assign a new value to that XSLT paramater using a form that's created from the XSLT stylesheet. This is what I have so far:

XSLT parameter
<xsl:param name="fname_value" select="''" />
ASP.NET code
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" AspCompat="true" Debug="true" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Web" %>
<%@ import Namespace="System.Web.UI" %>
<%@ import Namespace="System.Web.UI.WebControls" %>
<%@ import Namespace="System.Web.UI.HtmlControls" %>
<%@ import Namespace="System.Xml" %>
<%@ import Namespace="System.Xml.Xsl" %>
<%@ import Namespace="System.Xml.XPath" %>
<%@ import Namespace="System.IO" %>
<%@ Import Namespace="System.Text" %>
<script language="vb" runat="server">
    Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)

        Dim xmlURL As String = "form.xml"
        Dim xslURL As String = "form.xsl"

        'Assign dynamic url for this page
        xslTransform.DocumentSource = xmlURL
        xslTransform.TransformSource = xslURL

    End Sub
    <asp:Xml id="xslTransform" runat="server"></asp:Xml>
I haven't found much on how to do this in ASP.NET, but I did find a great article from a book titled "XSLT and ASP.NET" at http://www.topxml.com/dotnet/article...ansforming_XML under the ".NET Classes Involved in Transforming XML" section. The book/article is written in C#, and I use VB.NET. But I'm using a C# to VB.NET converter at http://www.developerfusion.co.uk/uti...sharptovb.aspx to help out.

As far as I can see, this article doesn't have any examples involving pulling and assigning a value for an XSLT parameter using the method that I'm using, so I'm not sure where to go with this. So I'm looking for some direction on this subject. I'd appreciate any help. Thanks.


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing attribute name into XSLT to pull content Naughtytrini XSLT 2 March 26th, 2008 03:06 PM
Pull data values & assign them to a text control cesemj ASP.NET 2.0 Basics 0 March 12th, 2008 06:54 AM
Read and update/increment XML doc from aspx Hughesie78 XML 7 December 13th, 2007 06:18 AM
trying to assign a parameter value to 'match=' hottub XSLT 3 April 3rd, 2006 10:18 AM
Assign events to webcontrols through XML and XSLT Navas Classic ASP XML 0 November 12th, 2003 05:41 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.