API
Version 7.x > API > Macro for getting Form POST variables View modes: 
User avatar
Certified Developer v7
Certified  Developer v7
John Bubriski - 1/16/2014 8:36:28 AM
   
Macro for getting Form POST variables
It looks like I can use {%QuerSytring["ParameterName"]%} to get values from the query string, but I wasn't able to get values from the form POST collection.

In C# it would just be:

Request.Form["ParameterName"]

or without direct access to the request context:

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

I made a custom macro for this, but would rather use native functionality if available.

Any ideas?

Thanks,
John

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 1/16/2014 9:48:31 PM
   
RE:Macro for getting Form POST variables
Where are you trying to get the values? You can use a context macro
{%ColumnNameInTheForm%}

User avatar
Certified Developer v7
Certified  Developer v7
John Bubriski - 1/21/2014 8:48:37 AM
   
RE:Macro for getting Form POST variables
I'm trying to get the value within a Global Event Handler. This isn't a normal form value defined in a BizForm or something, it's just a straight up <input> tag in the markup that happens to get posted. I'll try that out though and see if it works.

Thanks,
John

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 1/21/2014 9:20:35 AM
   
RE:Macro for getting Form POST variables
You can add an "invisible" column and dynamically set the value of it based on other user input in your global handler. Depending on the input, you might be able to simply grab it in the global handler as well without any input tag.