Click here to Skip to main content
15,888,461 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a page that is being redirected from two different places. here is the sitemap code :-
XML
<siteMapNode url="~/ProductsIndex.aspx" title="Product Management" description="Products Details">
    <siteMapNode url="~/AddNewProducts.aspx" title="Product Identification" description="Product Identification" />
</siteMapNode>

 <siteMapNode url="~/StoreAdminIndex.aspx" title="Store Administration" description="Store Administration">
 <siteMapNode url="~/AddNewProducts.aspx" title="Product Identification" description="Product Identification" />
</siteMapNode>

After searching on net I got following answer :- We need to add any query string.
XML
 <siteMapNode url="~/StoreAdminIndex.aspx" title="Store Administration" description="Store Administration">
 <siteMapNode url="~/AddNewProducts.aspx?S=1" title="Product Identification" description="Product Identification" />
</siteMapNode>

But When I am using this code and I am passing some other querystring value the correct sitemap is not showing. Eg. when I am redirecting to AddNewProducts.aspx page, It is like AddNewProducts.aspx?S=1&SId=7913 (Here we have one more query string SId).

And I don't want to use Session object to hold the SId.

Any Idea? how to solve this issue?

Here is the code : When I am using following code, breadcrumb is coming fine :-
C#
Response.Redirect("~/AddNewProducts.aspx?S=1", false);

It's working fine. but when I am using following code :
C#
Response.Redirect("~/AddNewProducts.aspx?S=1&SId=" + hdnStoreId.Value.ToString(), false);


It's showing first breadcrumb. It's not working.
Posted
Updated 28-Oct-13 0:37am
v5
Comments
_Amy 28-Oct-13 6:31am    
Please tag your question accordingly. Click on Improve question and add Asp.Net as tag.

Using QueryString in sitemap is bad idea either. Two recoganize the previous page, you can use this:
C#
if( !IsPostBack )
{
     //Check with the previous page url
     if(Request.UrlReferrer.LocalPath == "/YourSolutionName/PageName.aspx")
     {
         //Perform some operations(Get the query string here)
     }
     else
     {
         //Perform other operations
     }
}



--Amit
 
Share this answer
 
Comments
Rajani.R 28-Oct-13 6:44am    
Please elaborate your answer
_Amy 28-Oct-13 7:53am    
Get the url of previous page and check from which page you are being redirected. Then acording to the page url you can perform the operations in it. :)

--Amit
Rajani.R 31-Oct-13 2:43am    
@ _Amy thanks for your reply :) we got the soln to this by checking the page and assigning to node before our breadcrumb logic. I will add the soln :)
C#
string pagename = Master.GetIncomingVal("param", "param", "");
        if (pagename =="1")
            node = SiteMap.Provider.FindSiteMapNodeFromKey("~/CategoryManagement.aspx?param=1");



Added this begore bread crumb logic
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900