09 Jan 2009
07 Mar 2009
Link to this post
I am facing a challenge with certain controls when i change the name of my pages. This is easiest to explain in the context of the NewsView control.
I have a page that is called 'LastestNews'.aspx
It has a child page called 'NewsItem.aspx'.aspx
I added the news view to the LastestNews page and set the advanced property:
Explicit Links => Single Item Url => ~/Media/LastestNews/NewsItem.aspx
I then added a couple news items and voila the news items show up and when I click on them I get redirected to the appropriate page and I can read the uploaded article.
However, I realize that a spelling mistake in the page name and go into the page properties and change the page name from 'LastestNews' to 'LatestNews'. I then browse to my page and all my links in the NewsView control are broken. The only way that I can fix them is to go into the NewsView advanced property and correct the url.
Old Version "~/Media/LastestNews/NewsItem.aspx
New Version "~/Media/LatestNews/NewsItem.aspx
I'm wondering if I've done something wrong, or is this how the control is intended to work and if I change page names then I have to go through my site and manually update all the controls that reference that page?
It seems odd to me that the control keeps a static reference to the page instead of a dynamic reference. I gather that each page has its own GUID that is used internally to identify pages. Why is this GUID not stored by the control and then a URL rewriter service used to resolve the URL of the referenced page. That way you can change page properties (or even page locations) and not worry about what controls is referencing that page.
Anyone have comments?