I came across an interesting behavior. I had created a custom page with custom logic. I had to pass a parameter and a number so that I can use the value in the code.
So the URL looks something like this:
When I navigate to this page, MyCustomPage was not loading, instead SharePoint was giving "Page not found" error. If I navigate to the same page without passing a parameter, it renders the page without any problem. That means, when I pass a parameter in the URL, SharePoint was treating the entire URL as a page URL. Since it doesn't exist, it was throwing page not found error.
This was one of those weird behaviors which is hard to comprehend. After a bit of Googling, I came across this article by Stefan Goßner. In this article Stefan lists some of the parameters which we should not be using as they are reserved query string parameters. Though the article is specific to MOSS 2007 and SharePoint 2010, the information looks to be applicable for SharePoint 2013 as well.
So the URL was changed to
After changing the Parameter name, the page was loading without any error! Phew!
So the URL looks something like this:
http://[Domain]/[SiteCollection]/Page/MyCustomPage.aspx?Id=[number]
When I navigate to this page, MyCustomPage was not loading, instead SharePoint was giving "Page not found" error. If I navigate to the same page without passing a parameter, it renders the page without any problem. That means, when I pass a parameter in the URL, SharePoint was treating the entire URL as a page URL. Since it doesn't exist, it was throwing page not found error.
This was one of those weird behaviors which is hard to comprehend. After a bit of Googling, I came across this article by Stefan Goßner. In this article Stefan lists some of the parameters which we should not be using as they are reserved query string parameters. Though the article is specific to MOSS 2007 and SharePoint 2010, the information looks to be applicable for SharePoint 2013 as well.
So the URL was changed to
http://[Domain]/[SiteCollection]/Page/MyCustomPage.aspx?MyCustomId=[number]
After changing the Parameter name, the page was loading without any error! Phew!
Comments
Post a Comment