Copied to clipboard

Flag this post as spam?

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


  • Rasmus Fjord 675 posts 1566 karma points c-trib
    Dec 12, 2011 @ 16:01
    Rasmus Fjord
    0

    can Umbraco /Base use query parameters ?

    ive been searching a while for this one and hopefully someone can give me an answer.

    First of all i love the RestExtension function as a normal developer, but as a webdeveloper i see an issue, and I was hoping it just was a setting that could change it :)

    A normal rest extended function in umb, would look like this /base/myfunctions/whatismyname/rasmus.aspx

    where rasmus is the value being passed.

    But what i want is it looking like this :

    /base/myfunctions/whatismyname.aspx?name=rasmus

    A reason for this is so it would work with a <form> without running any kind of javascript, so i don't have to rebuild a special URL string for it.

    (I know its made to expose functions for ajax call etc. but would just be nice)

    Anyone know if this could be changed, or is there a reason for this design ?

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Dec 12, 2011 @ 16:07
    Jeroen Breuer
    0

    You can probably do this by using url rewriting. The url with querystring can be rewritten to a url without querystring. I know you'll still need to rebuild a special url, but I think that's the best solution.

    Jeroen

  • Bo Damgaard Mortensen 719 posts 1207 karma points
    Dec 12, 2011 @ 23:18
    Bo Damgaard Mortensen
    0

    Hi Rasmus,

    This is just a wild guess since I haven't tested it before. Are you sure that you can't simply do:

    <form action="/base/myfunctions/whatismyname.aspx" method="post">
        <input type="text" name="myName" />
        <input type="submit" text="submit" />
    </form>

    And then in your base method:

    string name = HttpContext.Current.Request.Form["myName"];

    ? :-)

    All the best,

    Bo

  • Rasmus Fjord 675 posts 1566 karma points c-trib
    Dec 13, 2011 @ 08:12
    Rasmus Fjord
    0

    Hehe Bo i think i can work with your solution, and of course why didn't i think of it :)

    So focused on the feature at hand.

     

    Thx for input jeroen aswell:)

     

    Thx for slappin' my mind Bo

  • Rasmus Fjord 675 posts 1566 karma points c-trib
    Dec 13, 2011 @ 11:12
    Rasmus Fjord
    0

    a quick update for ppl who wanna do the same you cannot use

    HttpContext.Current.Request.Form["myName"]

    but you have to use

    HttpContext.Current.Request.QueryString["myName"]

  • Bo Damgaard Mortensen 719 posts 1207 karma points
    Dec 13, 2011 @ 17:55
    Bo Damgaard Mortensen
    0

    Well thanks for slappin' my mind aswell Rasmus ;-) Was thinking Request.Form because of the html form. 

    Anyway, I'm glad it works for you! :-)

    - Bo

Please Sign in or register to post replies

Write your reply to:

Draft