Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. Import a C# textbox value into a XSLT to generate a .aspx page

Import a C# textbox value into a XSLT to generate a .aspx page

Scheduled Pinned Locked Moved XML / XSL
xmlcsharphelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Arokiamary
    wrote on last edited by
    #1

    Hi All, We have a C# windows application which will transform the xml and xslt we give into a .aspx page. The user has to specify the XML and the .aspx file name , we have a standard XSLT which will use the xml and create the file with the name specified by the user. The problem we face is in the .aspx page we want to write the Page attribute E.g. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" >; where we include the .aspx.cs file name , but this value comes from the C# code , how can we import the textbox value from C# code into our standard XSLT to write the page attribute in our to be generated .aspx page. Please Advice.TIA Regards, Nancy

    S 1 Reply Last reply
    0
    • A Arokiamary

      Hi All, We have a C# windows application which will transform the xml and xslt we give into a .aspx page. The user has to specify the XML and the .aspx file name , we have a standard XSLT which will use the xml and create the file with the name specified by the user. The problem we face is in the .aspx page we want to write the Page attribute E.g. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" >; where we include the .aspx.cs file name , but this value comes from the C# code , how can we import the textbox value from C# code into our standard XSLT to write the page attribute in our to be generated .aspx page. Please Advice.TIA Regards, Nancy

      S Offline
      S Offline
      Stuart Dootson
      wrote on last edited by
      #2

      Add a parameter at the top level of the XSLT file:

      <xsl:stylesheet version="2.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      exclude-result-prefixes="xsl">

      <!-- Allow the user to specify the .cs filename -->
      <xsl:param name="CSFilename"/>

      <!-- The rest of your XSLT - use $CSFilename to access the .cs filename -->
      </xsl:stylesheet>

      You then use the XsltArgumentList[^] class to add the parameter values when you perform the transform.

      Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups