Copied to clipboard

Flag this post as spam?

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


  • pat 124 posts 346 karma points
    Feb 13, 2013 @ 14:52
    pat
    0

    how to call ashx handler in xslt

    I have generic handler written in c# (ashx file), I need to know is there any way that I can call this in xslt. 

    I am generating captcha image in this ashx file,  how do I make this work in my xslt <img src="myhandler.ashx"/>

    so the image display in my web page. 

    I have test the handler localhost, I can add aspx page and call it it works fine. now I am strugle to apply this in umbraco xslt macro.

    any help?

  • Jan Skovgaard 11258 posts 23500 karma points MVP 7x admin c-trib
    Feb 13, 2013 @ 19:01
    Jan Skovgaard
    0

    Hi Pat

    Does your handler take any parameters? And where is it stored on your disk?

    /Jan

  • pat 124 posts 346 karma points
    Feb 14, 2013 @ 11:08
    pat
    0

    no parameters, it's c# handler to genarate captcha image. i have test it in local host work fine, How do make it work in umbraco xslt macro?

    I have upload dll to bin folder, ashx file in web site root folder. not sure next step is correct or not I have added line in web.config under handerls 

     <add name="icCpatchaGenerator" path="capHandler.ashx" verb="GET,HEAD,POST" type="icCpatchaGenerator"  requireAccess="Write" />

    then in xslt I have call <img src="/capHandler.ashx" alt="text to cap" />

    which is not working. 

     

     

  • Jan Skovgaard 11258 posts 23500 karma points MVP 7x admin c-trib
    Feb 14, 2013 @ 23:43
    Jan Skovgaard
    0

    Hi Pat

    Do you get any error messages? Or is the captcha simply not being generated when you call it using your xslt macro?

    /Jan

  • pat 124 posts 346 karma points
    Feb 26, 2013 @ 16:48
    pat
    100

    Sorry i had week off completely out of my code world.

    i have managed to do that in a different way. I have created a class file myhander.cs and done the coding . copied .cs file in umbraco App_code folder , and add .dll to bin folder. 

    then in web config just one line under <system.webserver> <handlers> i have to give the name of cs class as handler name and type as <name space of project>.cs file name

    if I corrected above post's line  <add name="capHandler" path="capHandler.ashx" verb="*" type="icCpatchaGenerator.capHandler"   />

    then this work like a charm

    any way thanks for your replys and efforts..

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies