472,958 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 software developers and data experts.

how to pass parameters to xsl from my aspx file

I have an customerdetail.xsl sheet
----------------------------------------------------------
<?xml version="1.0" encoding="iso-8859-1"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:param name="customer_number"></xsl:param>

<xsl:template match="customerlist">
<html>
<body>
<table border="1" frame="box">
<xsl:for-each
select="mag_customer[@customer_number=$customer_number]">
<tr>
<TH>Customer</TH>
<td><xsl:value-of select="@customer"/></td>
</tr>
<tr>
<TH>Address</TH>
<td><xsl:value-of select="@address"/></td>
</tr>
<tr>
<TH>Telephone</TH>
<td><xsl:value-of select="@telephone"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>

</xsl:stylesheet>

my customerdetail.aspx code is like this
---------------------------------------

<%@ Page Language="VB" AutoEventWireup="false"
CodeFile="CustomerDetails.aspx.vb" Inherits="CustomerDetails" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
&nbsp;</div>
<asp:Xml ID="Xml1" runat="server"
DocumentSource="~/App_Data/customerlist.xml"
TransformSource="~/App_Data/customerdetail.xsl"></asp:Xml>
</form>
</body>
</html>
i also have customer.aspx file(witch will redirect to
customerdetails.aspx as long as user selected a customer number) and
inside i have the "customer_number" paramaters,my question is from
customer.aspx how do i pass the customer_number value to
cusomerdetails.aspx and further to the customerdetail.xsl?

thanks

May 15 '06 #1
3 2046
Wang Xiaoning wrote:
i also have customer.aspx file(witch will redirect to
customerdetails.aspx as long as user selected a customer number) and
inside i have the "customer_number" paramaters,my question is from
customer.aspx how do i pass the customer_number value to
cusomerdetails.aspx and further to the customerdetail.xsl?


You can pass parameters from aspx to aspx using various methods - from
Session to HTTP Request parameters. And you can pass parameters to XSLT
using TransformArgumentList property of the XML control.

--
Oleg Tkachenko [XML MVP, MCAD]
http://www.XmlLab.Net | http://www.XLinq.Net | http://blog.tkachenko.com
May 16 '06 #2
my customerdetails.aspx has this code

<%@ Page Language="VB" AutoEventWireup="false"
CodeFile="CustomerDetails.aspx.vb" Inherits="CustomerDetails" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div></div>
<asp:Xml ID="Xml1" runat="server"
DocumentSource="~/App_Data/customerlist.xml"
TransformSource="~/App_Data/customerdetail.xsl"></asp:Xml>
&nbsp; &nbsp;
</form>

</body>
</html>
if i want to pass customer_number A00010 xsl, where do i put this code,
in page_load() ?

Dim xslArg As New System.Xml.Xsl.XsltArgumentList()
xslArg.AddParam("customer_number", "", "A00010")

May 16 '06 #3
i fond i forgot

Xml1.TransformArgumentList

after i have this, it works, thanks for the support.

May 16 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Zlatko Matić | last post by:
Let's assume that we have a database on some SQL server (let it be MS SQL Server) and that we want to execute some parameterized query as a pass.through query. How can we pass parameters to the...
4
by: ruca | last post by:
Hi, How can I pass the values of some variables from page1.aspx to page2.aspx? I try to define some variables in page2 and then when I click a button in page1 it will fill that variables (in...
5
by: Ben | last post by:
Hi I am using a User Control which is referenced by an ASPX page. How can I pass a string parameter to the user control, from the base ASPX page. Thanks Ben
2
by: Alex Nitulescu | last post by:
Hi. I have tried to pass two parameters, like this: Response.Redirect(String.Format("NewPage.aspx?Username={0}, Pass={1}", txtUserName.Text, txtPass.Text)) But if I pass Username="Alex" and...
5
by: Apollo0130 | last post by:
hi, i want to pass a parameter (a string) between two forms. i have a Webform A (default.aspx) with a button and a Webform B (detail.aspx). i want to click the button and open the webform B with...
2
by: phil | last post by:
Hi, I want to put a recordset in a gridview but i don't know how to pass the value of the variable in the 'where' statement. The value of the variable is set in the code-behind. i added a tag...
5
by: slowmotiongenius | last post by:
All- I have established an adodb recordset in my code-behind, and I need to pass it to the aspx file. I can't seem to figure out if there is a way to do this. I see you can pass a string over...
2
by: rn5a | last post by:
How do I pass a NULL value to a field while inserting records in a SQL Server 2005 DB table using a stored procedure? I tried the following but it inserts an empty string & not a NULL value: ...
3
by: Aussie Rules | last post by:
Hi, I have a few aspx (.net2) form. The first form allows the user to enter into text box, and select values from drop downs The second form needs to use these values to process some data....
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.