finally i directly to use Master3 that is the solution
Glad to hear that you have solved this issue by yourself, and it is very appreciated to share your solution to us. It will be helpful for others, and welcome to post your question on this forum in your future programming.
Kind regards
Please mark the replies as answers if they help or unmark if not.
Feedback to us
Fitmation
Member
593 Points
430 Posts
how to hidden sitemap when access specified page
Jan 17, 2013 01:23 AM|LINK
SiteMapDataSource1.SiteMapProvider defined in Masterfile
but specified page can not access SiteMapDataSource1
i use Label to include SiteMapDataSource1 then do the following, it can not hide sitemap, even if remove sitemapprovider to empty,
it just haven't run this part of code in Page Load in Masterfile
if (HttpContext.Current.Request.Url.AbsoluteUri.Contains("specifiedpagekeywordsinlink")) { //HiddenLabel.Visible = false; SiteMapDataSource1.SiteMapProvider = ""; } else { HiddenLabel.Visible = true; }then i try to do in specified page but it said must be do in preinit, then after done, it still have sitemap though Master3 removed sitemap
then i test at local machine it worked, after upload by ftp to production, it failed,
protected void Page_PreInit(object sender, EventArgs e) { if (HttpContext.Current.Request.Url.AbsoluteUri.Contains("keywords")) { this.MasterPageFile = "~/Master3.master"; } else { this.MasterPageFile = "~/Master3.master"; } }Fitmation
Member
593 Points
430 Posts
Re: how to hidden sitemap when access specified page
Jan 17, 2013 01:52 AM|LINK
finally i directly to use Master3 that is the solution
Angie xu - M...
All-Star
18045 Points
1550 Posts
Microsoft
Re: how to hidden sitemap when access specified page
Jan 18, 2013 08:25 AM|LINK
Hi Fitmation
Glad to hear that you have solved this issue by yourself, and it is very appreciated to share your solution to us. It will be helpful for others, and welcome to post your question on this forum in your future programming.
Kind regards
Feedback to us
Develop and promote your apps in Windows Store