Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > using xsl for dropdown

Reply
Thread Tools

using xsl for dropdown

 
 
bic
Guest
Posts: n/a
 
      01-16-2010
Hi,

I am trying to use xsl output for my asp.net and have gotten as far as
displaying xml control OK. How do I change it to a dropdown using the
lastname, and when selected I want to have all elements displayed on the
page. Thanks in advance.

--this is my asp.net file----------------------

<%@ Page Language="C#" AutoEventWireup="True" %>
<%@ Import Namespace="System.Xml" %>
<%@ Import Namespace="System.Xml.Xsl" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
<script runat="server">
void Page_Load(Object sender, EventArgs e)
{
XmlDocument doc = new XmlDocument();
doc.Load(Server.MapPath("people.xml"));

XslTransform trans = new XslTransform();
trans.Load(Server.MapPath("peopletable.xsl"));

xml1.Document = doc;
xml1.Transform = trans;
}
</script>
<head runat="server">
<title>Xml Class Example</title>
</head>
<body>
<h3>Xml Example</h3>
<form id="form1" runat="server">
<asp:Xml id="xml1" runat="server" />
</form>
</body>
</html>


--this is my xsl file----------------------

<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet version="1.0"
xmlnssl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/People">
<xsl:apply-templates select="Person" />
</xsl:template>

<xsl:template match="Person">
<table width="100%" border="1">
<tr>
<td>
<b>
<xsl:value-of select="Name/FirstName" />

<xsl:value-of select="Name/LastName" />
</b>
</td>
</tr>
<tr>
<td>
<xsl:value-of select="Address/Street" /><br />
<xsl:value-of select="Address/City" />
,
<xsl:value-of select="Address/State" />
<xsl:value-of select="Address/Zip" />
</td>
</tr>
<tr>
<td>
Job Title: <xsl:value-of select="Job/Title" /><br />
Description: <xsl:value-of select="Job/Description" />
</td>
</tr>
</table>
</xsl:template>

</xsl:stylesheet>


--this is my xml file------------------
<?xml version="1.0" encoding="utf-8" ?>
<People>
<Person>
<Name>
<FirstName>Joe</FirstName>
<LastName>Suits</LastName>
</Name>
<Address>
<Street>1800 Success Way</Street>
<City>Redmond</City>
<State>WA</State>
<ZipCode>98052</ZipCode>
</Address>
<Job>
<Title>CEO</Title>
<Description>Wears the nice suit</Description>
</Job>
</Person>
</People>


--
bic
 
Reply With Quote
 
 
 
 
Bob Barrows
Guest
Posts: n/a
 
      01-16-2010
bic wrote:
> Hi,
>
> I am trying to use xsl output for my asp.net


***canned wrong-newsgroup reply************************
There was no way for you to know it (except maybe by browsing through some
of the previous questions in this newsgroup before posting yours - always a
recommended practice) , but this is a classic (COM-based) asp newsgroup.
ASP.Net bears very little resemblance to classic ASP so, while you may be
lucky enough to find a dotnet-knowledgeable person here who can answer your
question, you can eliminate the luck factor by posting your question to a
group where those dotnet-knowledgeable people hang out. I suggest
microsoft.public.dotnet.framework.aspnet or the forums at www.asp.net.
************************************************** ****************


--
Microsoft MVP - ASP/ASP.NET - 2004-2007
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
asp.net dropdown using xsl output bic ASP .Net 8 01-20-2010 08:11 PM
xsl:sort using an xsl:variable as the sort key jobooker@gmail.com XML 2 09-05-2006 03:51 PM
bind a dropdown in a column in a datagrid based on the dropdown value selected in another column of the datagrid. vishnu ASP .Net 1 03-25-2006 01:24 PM
XSL Question tp xsl:for-each and xsl:variable schaf@2wire.ch XML 1 05-27-2005 09:25 PM
Select dropdown box bleeds into Javascript dropdown menu Mike HTML 1 12-18-2003 09:49 PM



Advertisments