2

I am facing one issue regarding to my SharePoint site URL. When I am trying to redirect my page on the button click the page is being redirected but it's URL is like

http://MySharePointsite/_layouts/15/start.aspx#/_layouts/15/MyList/MyPage.aspx

The issue I am facing because of the above URL is my Menu Template is not working. enter image description here

And I want URL like

http://MySharePointsite/_layouts/15/MyList/MyPage.aspx

When I manually type the above URL menu worked. I don't know why. What is the issue.

The code I am using to redirect the URL is:

string url = SPContext.Current.Web.Url;
SPUtility.Redirect(url + "/_layouts/15/MyList/MyPage.aspx?List=" + Request.QueryString[ListField], SPRedirectFlags.UseSource | SPRedirectFlags.Trusted, HttpContext.Current);

Can anyone help me to solve this issue?
Any help will be appreciated..!

3

Thank you for checking my question. I have found the answer in MSDN forum.

I have get it to work. I have put one statement which disables Minimal Download Strategy.

SPContext.Current.Web.EnableMinimalDownload = false

I kept this in page load. So the time my page gets loaded it disables the effect of the SharePoint Minimal Download Strategy. The Feature will be activated. But it will not affect the page.

  • 2
    But suppose we are redirecting from a master page, then what code do we use? because we donot have the code behind here. – variable Apr 8 '14 at 5:18
  • That I have to search. Because I have searched for the solution of my project. And for this I think you have to deactivate the Minimal Download feature from your site. Other option I don't know. If there might any javascript also available for this. You could search on Google for this. – Rahul Gokani Apr 8 '14 at 5:37
  • I google and found we have to use RegisterModuleInit, however that function accepts 2 arguments. 1=js filename and 2=function name. However, my js code is present in script tag in masterpage head and not in any file. – variable Apr 8 '14 at 5:53
  • Ohk, That's fine that you have found it. And you can create a .js file and register to you master page as well as RegisterModuleInit. – Rahul Gokani Apr 8 '14 at 6:07
1

It is SharePoint Minimal Download Strategy (MDS) that generates that URL structure, and that is quite a nice feature for saving resources in SP 2013.

You can disable this feature but I would try to MDS-proof the menu buttons instead (make it handle both URL structures)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.