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 ?
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.
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 ?
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
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
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
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"]
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
is working on a reply...