Developer forum

Forum » Feature requests » A tag to read querystring or form values

A tag to read querystring or form values


Reply

Hi !

 

Can we get a tag or some tags to display querystring parameters or posted form values?

 

Something like:

 

<!--@Page:Request.Querystring.Param1-->

 

or

 

<!--@Page:Request.Form.Field1-->

 

-Emil


Replies

 
Reply

I can thing of about one million cases where I could have used that in the past. Great suggestion, I vote for that:)

 
Nicolai Høeg Pedersen
Reply

Thats an excellent idea.

 

Implemented it right away - like this:

 

Server:Request(param) which would be both querystring and form values...

 

param is allways lower case.

 

Release with the update in 10 days.

 
Reply
np wrote:

Thats an excellent idea.

 

Implemented it right away - like this:

 

Server:Request(param) which would be both querystring and form values...

 

param is allways lower case.

 

Release with the update in 10 days.

 

Sweet! You guys rock! ;-)

 
Reply

Is it based on Base.Request, so it also includes cookies and server variables, like we discussed a couple of weeks ago in this thread http://developer.dynamicweb.dk/Forum-17061.aspx?action=ShowThread&ThreadID=677?

 
Nicolai Høeg Pedersen
Reply
Sorensen wrote:

Is it based on Base.Request, so it also includes cookies and server variables, like we discussed a couple of weeks ago in this thread http://developer.dynamicweb.dk/Forum-17061.aspx?action=ShowThread&ThreadID=677?


 

Well - not exactly...

 

The feature, as it is now, iterates through the keys in Request.Form and Request.Querystring and gets the values using Base.Request.

 

So writing Server.Request.var is not a lookup for the var using Base.Request. There is a difference.

 

So would the latter be a better way?

 

 
Reply

It would be cool, but I don't remember that many cases where I needed to present these values in a template.

 
Reply

One thing that would be really cool, though, which is also somewhat related to this, is if we could have a similar tag method for session and application variables:)

 
Reply

"The feature, as it is now, iterates through the keys in Request.Form and Request.Querystring and gets the values using Base.Request."

 

This method might give unexpected results. If i expect a value from form or querystring collection and the same var is also in server or cookies i can get a different value?

 

Regards,

Remi

 
Reply

 

Thought it was @Server:Request(varname), but just found out it works with  @Server:Request.varname.

 

Thanks a million guys!

 
Nicolai Høeg Pedersen
Reply
Emil Muller wrote:

 

Thought it was @Server:Request(varname), but just found out it works with  @Server:Request.varname.

 

Thanks a million guys!

Hi Emil

 

And thank you for sharing your idea.

 

My first implementation was Server:Request(varname), but I changed it to look more like other template tags.

 

The tag is described here:


http://template.dynamicweb.dk/TemplateTags/Dynamicweb-template-tags/General-tags/Server.Request.aspx