0

I used ScriptManager in .aspx page to Maintain URL history in .Net i.e.

on aspx page i put this script after form tag

> <asp:ScriptManager runat="server" ID="ScriptManager1" EnablePartialRendering="true"
>         EnableHistory="true">       
>     </asp:ScriptManager>

and in my .js file i put this code

Sys.Application.add_navigate(function (sender, e) {
    navigate(sender, e);
});

 Sys.Application.addHistoryPoint(objOut, null);

Now same thing i want to use in MVC 4 with Razor

I used MicrosoftAjax.js for ScriptManager and .js code is same. but i am getting issue on callback.

let me explain you with example:

suppose Actual URL is
www.websitename.com/cat/30/

anchor tag link on page is 
www.websitename.com/cat/30/?q=10

once callback perform anchor tag link becomes
www.websitename.com/?q=10

I mean after callback "cat/30/" is missing from link.

can anyone tell me what I am doing wrong.

Thanks.

Ashu

1
  • 1
    You wouldn't, you'd declare the JavaScript file in the View. Commented May 16, 2013 at 13:48

1 Answer 1

3

ScriptManager is part of ASP.NET Webforms. It is not available in ASP.NET MVC. They are two completely different frameworks.

There is a port of ScriptManager to ASP.NET MVC which is available here. It might provide what you are looking for.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.