Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT 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 March 22nd, 2007, 02:57 AM
Authorized User
 
Join Date: Mar 2007
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default ASP.NET COntrols inside XSLT

how to use the asp:button control inside the XSLT and then call a function

I Love XML and family
__________________
I Love XML and family
 
Old March 22nd, 2007, 03:13 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

XSLT has no concept of ASP.NET, you will have to explain exactly what you are trying to achieve.

--

Joe (Microsoft MVP - XML)
 
Old March 22nd, 2007, 03:31 AM
Authorized User
 
Join Date: Mar 2007
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

actually i want to select some info from XML file and the display that into HTML table format to the users, and each row having a button for Booking, when user clicks that button then an automatically email should be sent to the client.

I Love XML and family
 
Old March 22nd, 2007, 04:08 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

XSLT transforms an XML document to another XML or HTML document, based on instructions in the stylesheet. The HTML output can contain anything you like (it doesn't have to be standard or valid HTML). If you want to generate dynamic HTML, then you can. If you need help with that, then please show an example of the HTML you want to generate. If you want help designing the HTML, then this isn't the right forum.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old March 22nd, 2007, 05:00 AM
Authorized User
 
Join Date: Mar 2007
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

actually i did all the things only part is how to send the email in XSLT, should i use the Extention Object or what else. obviously as i already told here is a button when user will click on that button then email script should be run.

I Love XML and family
 
Old March 22nd, 2007, 06:33 AM
Friend of Wrox
 
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default

see:

http://www.dotnetspace.com/articles/...ng-emails.html

for sending emails in asp.net



 
Old March 22nd, 2007, 06:41 AM
Authorized User
 
Join Date: Mar 2007
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:msxsl="urn:schemas-microsoft-com:xslt"
    xmlns:asp="remove"
    xmlns:SEmail="urn:SEmail" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://schemas.microsoft.com/intellisense/ie5">
<xsl:output method="html" indent="yes" />
<xsl:param name="chkIDate" />
<xsl:param name="chkODate" />

<xsl:template match="/">
<html>
<head>
</head>
<body>
    <xsl:apply-templates />
</body>
</html>
</xsl:template>

<xsl:template match="bookingMain">
  <table width="800" border="1" bordercolor="#0000cc" ID="Table2" cellpadding="0" cellspacing="0">
 <tr>
   <td colspan="9" height="6" bgcolor="#000099"></td>
 </tr>
 <tr bgcolor="#ccccff" class="tdfont">
   <td>Service #</td>
   <td>Client Name</td>
   <td>Booking Ref.</td>
   <td>Invoice</td>
   <td>Cost</td>
   <td>Persons</td>
   <td>Amount</td>
   <td>Balance</td>
   <td>Book</td>
   </tr>
  <xsl:apply-templates select="//bookingDetails[concat(substring-after(substring-after(bookDate,'-'),'-'),substring(substring-after(bookDate,'-'),1,2),substring-before(bookDate,'-')) &gt;= concat(substring-after(substring-after($chkIDate,'-'),'-'),substring(substring-after($chkIDate,'-'),1,2),substring-before($chkIDate,'-')) and concat(substring-after(substring-after(bookDate,'-'),'-'),substring(substring-after(bookDate,'-'),1,2),substring-before(bookDate,'-')) &lt;= concat(substring-after(substring-after($chkODate,'-'),'-'),substring(substring-after($chkODate,'-'),1,2),substring-before($chkODate,'-'))]" />
</table><p />
</xsl:template>

<xsl:template match="bookingDetails">
 <tr>
   <td><xsl:value-of select="service" /></td>
   <td><xsl:value-of select="clientName" /></td>
   <td><xsl:value-of select="bookingRef" /></td>
   <td><xsl:value-of select="invoice" /></td>
   <td><xsl:value-of select="cost" /></td>
   <td><xsl:value-of select="pax" /></td>
   <td><xsl:value-of select="amount" /></td>
   <td><xsl:value-of select="balance" /></td>

       <td><input type="submit" name="btnEmail" value="Book" onclick="SEmail:SendMail(balance)" runat="server" ID="Submit1"/></td>
   <td>

   </td>


   </tr>
  </xsl:template>
</xsl:stylesheet>


here i am calling the function through Extention Objects to edn the email which is giving error, but i know this is wrong way, if there is any other solution then plz let me know


I Love XML and family
 
Old March 22nd, 2007, 07:07 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

You are totally confused about the processing model, although it's possible to send an email whilst transforming a document it's a very strange thing to do. Surely you want an email sent when the user interacts with the HTML?

As Michael Kay pointed out this is not and XSLT question but an ASP.NET one.

--

Joe (Microsoft MVP - XML)
 
Old March 22nd, 2007, 07:15 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

If your XSLT is creating HTML that doesn't work, you have an HTML problem not an XSLT problem. The HTML would fail in exactly the same way if you created it directly using a text editor. Would you then ask your question in a forum for the text editor?

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get to controls inside DataList? rsearing ASP.NET 2.0 Basics 1 March 1st, 2007 09:14 AM
ASP.Net Web Server Controls inside XSLT russmack XSLT 2 December 14th, 2006 10:02 AM
find all the controls inside any table amartya_mandal ASP.NET 1.0 and 1.1 Professional 10 October 24th, 2006 08:35 AM
refresh other form inside frame. (ASP.NET C#) richie86 ASP.NET 1.0 and 1.1 Basics 1 December 1st, 2005 02:18 PM





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