Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Carrying a parameter to a web form View modes: 
User avatar
Member
Member
paul.truman-sunmed.co - 11/8/2012 4:18:51 AM
   
Carrying a parameter to a web form
Hey folks - hopefully someone knows a simple solution to this question :) On a page on my website, I would like to to have a button that when clicked, will take me to my page containing a form, and will also carry over the document name value so I can use it as a hidden value in the form. I just don't know the code to use to a) carry over the parameter and b) use it in the form. Can anyone point me in the right direction?

User avatar
Kentico Support
Kentico Support
kentico_janh - 11/8/2012 5:49:51 AM
   
RE:Carrying a parameter to a web form
Hello,

There are many ways how to do that by using query strings, cookies, session variables etc., but let me show you the easiest one:

a) You can create a link (a button) which would contain a document name as a query string parameter in a URL. This link can be rendered dynamically by using macros:

<a href="~/form_page.aspx?docname={%CurrentDocument.DocumentName%}">Link to a form</a>


b) Now you render or reuse this query string parameter by using query string macro instead, so to render that document name, you can just type this:

{%docname%}


Best regards,
Jan Hermann