API Questions on Kentico API.
Version 6.x > API > How to Pass Parameter Value Using Query String View modes: 
User avatar
Member
Member
patel_divyesh8252-yahoo.co - 8/8/2013 4:22:53 AM
   
How to Pass Parameter Value Using Query String
Hi

I am using Kentico 6.0

i want to Pass one Parameter From one page to Another page using Query string then how can It possible in ????

Regards
Divyesh Patel

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 8/8/2013 7:06:39 AM
   
RE:How to Pass Parameter Value Using Query String
Create a page alias for the receiving page for instance /News/Month/{NewsItem} (just like that with the curly braces and all).

In your transformation or code behind construct the URL like so: href="/News/Month/<%# Eval("NodeAlias") %>.aspx"

Then when you reference it in a webpart you simply use the macro syntax {%NewsItem%} (no spaces between any of it) to retrieve the item. The resulting URL will look like /News/Month/The-First-News-Item.aspx

User avatar
Member
Member
patel_divyesh8252-yahoo.co - 8/12/2013 5:54:30 AM
   
RE:How to Pass Parameter Value Using Query String
Hello FroggEye

Can you please give me one demo of code for this functionality or Please explain me above code with exaple in brief.....

Thank you and Regards
Divyesh Patel

User avatar
Member
Member
kentico_sandroj - 8/10/2013 12:56:54 PM
   
RE:How to Pass Parameter Value Using Query String
Hello,

If you still need assistance with this please provide more details if possible. How are the users navigating between the pages and what is the parameter, how do you plan to use it? Here is available documentation on querystring macros.

Thanks,
Sandro

User avatar
Member
Member
patel_divyesh8252-yahoo.co - 8/12/2013 5:06:09 AM
   
RE:How to Pass Parameter Value Using Query String
Hello sandroj

I made one page on that all Products are display with image,price and some description and view Detail Button.
when i click on product image or "View Detail Button" at that time i want to pass product ID to Another page where i want to display particular product's detailed information on page

Regards
Divyesh patel

User avatar
Member
Member
kentico_sandroj - 8/13/2013 6:41:47 PM
   
RE:How to Pass Parameter Value Using Query String
Hello,

Thank you for clarifying that. The Detail Button is being generated as a part of the transformation, correct? If so, you can modify the link to include the querystring for product id by adding the appropriate eval statement to the transformation, e.g.
www.test.com?productid=<%# Eval("ProductID") %>

Once you would click on the link generated by the transformation, the productid querystring would be included.

User avatar
Kentico Legend
Kentico Legend
Accepted solutionAccepted solution
Brenden Kehren - 8/14/2013 2:16:48 PM
   
RE:How to Pass Parameter Value Using Query String
patel_divyesh8252-yahoo.co wrote: When i click on product image or "View Detail Button" at that time i want to pass product ID to Another page where i want to display particular product's detailed information on page
It is exactly how I explained in my initial post. You will create a page alias in the product list page (<root>/Products/{ProductID}). Then in your transformation you simply create the URL behind the "View Detail Button".

What I do is have 2 repeaters on a single page. 1 displays a list, the other displays the detail. The 1 that displays the list has the item and optional alternating item transformation set with NO where clause. The second one has the item transformation set for you details to be displayed and in the where clause you simply put ProductID = {%ProductID%}. The {% %} macro will get the ProductID url parameter automatically from the URL since you added the alias to the page.

The list repeater will need a visibility macro set. You can use this
{% if(QueryString.GetValue("ProductID") == null){true}else{false} %}
This will set visibility if it finds a productid parameter in the URL.

User avatar
Member
Member
andreavak23-hotmail - 8/20/2013 12:59:28 PM
   
RE:How to Pass Parameter Value Using Query String
Thanks for this information, is very helpfull for me