How to pass values from one page to another without using Querystring
Hi,
I have a requirement to pass few color code values from one page to another. How do i do it without passing the values in the URL?
In the parent page, I have a list of brand names, each brands has its own color codes. So when i click the link of any particular brand, I am redirecting to a common page where I have to update text heading, sub menu back ground color based on the brand name click.
Can I use macro to set values in parent page and read it in the sub page? or Is there any other way?
would be good, if i get some sample piece of code.
here subpage is following "childpageTemplate" template and clicking any brand will redirect to "childpageTemplate.cshtml". so in that template i should get few values(brand name, title color menubgcolor) related to Brand which is clicked.
How to pass values from one page to another without using Querystring
Hi,
I have a requirement to pass few color code values from one page to another. How do i do it without passing the values in the URL?
In the parent page, I have a list of brand names, each brands has its own color codes. So when i click the link of any particular brand, I am redirecting to a common page where I have to update text heading, sub menu back ground color based on the brand name click.
Can I use macro to set values in parent page and read it in the sub page? or Is there any other way?
would be good, if i get some sample piece of code.
Hi,
I am not sure of your exact needs but one idea would be to use javascript and store information using cookies. Sorry I have no sample code though.
Good luck,
/Martin
Instead of a GET, is it possible for to try using a POST?
There are several ways of passing data with a POST (with MVC, JavaScript, AngularJS, etc. ...)
Using a Form you could send parameters as hidden fields. If the submit action of that form calls your MVC controller, having something like:
Instead of a Form, you could also try using a JavaScript Ajax call to pass data:
Create a partial view and call like that
@Html.Partial("MyPartial", valueModel)
and in partial
................................ @model valueModel
Hi Manish,
Could you please expalin in details. I couldn't get your information. Both my parent page and sub page are Umbraco pages.
homepageTemplate.cshtml
childpageTemplate.cshtml
here subpage is following "childpageTemplate" template and clicking any brand will redirect to "childpageTemplate.cshtml". so in that template i should get few values(brand name, title color menubgcolor) related to Brand which is clicked.
is working on a reply...