473,385 Members | 1,400 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 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 2077
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....
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.