Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Vlad 1 post 21 karma points
    May 18, 2012 @ 15:30
    Vlad
    0

    Unable to display $variable

    Hi,

    I am new to XSLT. Here is my test code in an aspx page:

    <xsl:variable name="newcomplaint" select="'999'"></xsl:variable>
    <asp:Button runat="server" Text="New" id="Button1" onclick="CreateComplaint"/>
    <asp:TextBox runat="server" id="lastnumber" Text="{$newcomplaint}"></asp:TextBox>

    The text box displays $newcomplaint instead of 999. Why?

    Thanks...Vlad

  • Dan Okkels Brendstrup 101 posts 197 karma points
    Jun 18, 2012 @ 10:25
    Dan Okkels Brendstrup
    0

    You can't mix XSLT and ASP tags like that in Umbraco. To use XSLT, you write a separate .xslt file and include it as a macro in your master page. e.g.:

    <umbraco:Macro Alias="MyMacro" runat="server"/>
  • pat 124 posts 346 karma points
    Jun 18, 2012 @ 15:53
    pat
    0

    ou can use xslt macro or user control macro, it's look like you  need a form with asp net controls.

    create new project in visual studio and add web user control then do the cosding as you need on page load you can set values to text box, you can use umbraco functions / methods using umbraco.dll  add reference to your project

    then build the project. 

    copy web user control ".ascx" file to your web site usercontrols folder

    copy your project .dll file (find it in project bin folder) to web site bin folder

    then open cms and go to developer section, go to macros , create new  macro from the drop down select your .net user control

    then save (tick the box says use in editor)

    now is you go to content area  - page  in cms , you can see the add macro icon on rich text editor, add the above macro,and publish.

     you can see the form in page.

    you can find simple examples in umbraco tutorials (tv)

     

     

     

     

     

     

     

Please Sign in or register to post replies

Write your reply to:

Draft