scriptmanager

Parser error when using ScriptManager

I have an ASP.NET page which has a script manager on it. <form id="form1" runat="server"> <div> <asp:ScriptManager EnablePageMethods="true" ID="scriptManager2" runat="server"> </asp:ScriptManager> </div> </form> The page overrides an abstract property to return the ScriptManager in order to enable the base page...

ScriptManager.RegisterClientScript in a UserControl within a FormView inside an Async Panel.

I'm having an annoying problem registering a javascript event from inside a user control within a formview in an Async panel. I go to my formview, and press a button to switch into insert mode. This doesn't do a full page postback. Within insert mode, my user control's page_load event should then register a javascript event using Script...

Add ScriptManager to Page Programmatically?

I am developing a WebPart (it will be used in a SharePoint environment, although it does not use the Object Model) that I want to expose AJAX functionality in. Because of the nature of the environment, Adding the Script Manager directly to the page is not an option, and so must be added programmatically. I have attempted to add the Scr...

How can you tell if a method is being run in UpdatePanel postback?

How can I tell if a method is running in the context of an AJAX postback (i.e as the result of a UpdatePanel (asynchronous) postback)? According to egoldin Page.IsAsync is a very common confusion that has absolutely nothing to do with AJAX. The correct approach is to use ScriptManager.GetCurrent ( Page ).IsInAsyncPostBack. ...

Using ScriptCombining through a ScriptManager on a Master Page

ASP.NET 3.5 SP1 adds a great new ScriptCombining feature to the ScriptManager object as demonstrated on this video. However he only demonstrates how to use the feature with the ScriptManager on the same page. I'd like to use this feature on a site where the scriptmanager is on the master page but can't figure out how to add the scripts I...

Adding a script with ScriptManager on a CompositeControl?

I'm trying to call my good old 'RegisterClientScriptBlock' on the friendly 'ScriptManager' class. It just doesn't work for my CompositeControl? I use it on a normal usercontrol (ascx) where it works. Visual Studio simply won't accept me typing 'ScriptManager' or i get "The name 'ScriptManager' does not exist in the current context" if ...

ASP.Net: Is it possible to cache the js-proxies generated by scriptmanager?

We have the following code: <asp:ScriptManager runat="server"> ... <Services> <asp:ServiceReference Path="~/JSONServices/ProfileService.svc" /> </Services> ... This results in a javascript proxy found in /JSONServices/ProfileService.svc/js this javscript has content expiry set to the same t...

CompositeScript - Invalid Viewstate error

I'm using the new CompositeScript feature that's available in the ASP.NET 3.5 SP1 for the ScriptManager. When I test this with the ASP.NET Development Server it works fine but when I publish the site to my IIS webserver the combined files cannot be downloaded, I always get the following error: Invalid ViewState. The querystring that i...

CompositeScript without Microsoft Ajax JavaScript

I'm currently using the CompositeScript feature of System.Web.Extensions in order to combine my JavaScript files to reduce download time. However, by including any script manager, the MicrosoftAjax JavaScript code is included in my pages. I do not want this to happen as it adds a lot of unneeded code and it complicates event handling. ...

History management problem in ASP.net

I created a simple page with an UpdatePanel, inside that I have a couple of asp Panel controls, all with the Visible property set to false except for one. When the user clicks on some buttons on the side menu, the Visible property switches between the Panels being displayed, giving the user the cool & slick ajax feel. On the scriptManag...

Working with VS2008/3.5 ASP AJAX site on a 2.0sp1/AJAX Extesnion 1.0 server????

I am currently developing in 3.5 (building to 3.5 as I am using LINQ) and deploying my code to a 2.0 server. I have been successful in this so far, but now I am trying to utilize some of the ASP AJAX tools and I am running into an error I can't seem to get around. First I received "Unknown server tag 'asp:ScriptManager'." To whi...

What exactly is the point of the ScriptManager's EnablePartialRendering Attribute

Why would one want the EnablePartialRendering attribute to ever be "false" if building AJAX functionality into pages? Seems counter-productive. I've read here and there some things one may want to do with the attribute being false. But what I've read makes no sense. Thoughts? ...

Programatically prevent ASP .NET AJAX scripts from rendering

Does anyone know of a way that I can stop all the .NET AJAX scripts from rendering, even if a ScriptManager exists on the page? The ScriptManager's Visible property has been overridden and disabled so that you receive a NotImplementedException if you try to set the Visible property. The reason I would like to do this is that I don't wa...

What do I need to do when I include output from an ASP.NET .aspx page in a HTML page? Something like <base>

I have a ASP.NET file at http://localhost/nn/n.aspx Output from processing that file is included in http://localhost/index.asp. Is there some general or specific things I should do so that the ASP.NET code sitting on the client knows were it is? Setting <form action="http://localhost/nn/n.aspx makes it post to the right loca...

ASP.NET ScriptManager causing warning in Chrome

I get the following warning in chrome developer javascript console: Uncaught SyntaxError: Unexpected token < http://.../Question.asmx/js (line 1) Resource interpreted as script but transferred with MIME type text/html. http://.../Question.asmx/js The HTML source code looks fine: <script src="../../../Question.asmx/js" t...

AJAX ScriptManager in UserControl

I have a UserControl that contains an UpdatePanel which wraps some other controls. The UserControl will be used on some pages that already have a ScriptManager and other pages that do not have a ScriptManager. I'd like the UserControl to automatically bring its own ScriptManager if one does not exist. I have tried ScriptManager.GetCurre...

Can't get no javascript to execute on an ASP.NET user control

Hello, I'm trying to do the simplest thing, to show an alert popup through javascript from my code-behind of a user control (ascx.cs). I've tried protected void btnSave_Click(object sender, EventArgs e) { ScriptManager.RegisterStartupScript(btnSave, GetType(), "uniqueID", "alert('hello');", true); } as well as Page.ClientScrip...

ScriptManager.RegisterStartupScript - Script takes over whole page

I have a piece of javascript inside a User Control that I'm trying to load dynamically after an asynchronous postback. The script is actually loading a flash object. I'm trying to load this User Control inside of a placeholder. The problem is that once I register the script with ScriptManager.RegisterStartupScript, the flash object ...

Problem with ScriptManager.RegisterStartupScript in WebControl nested in UpdatePanel

Hello, I am having what I believe should be a fairly simple problem, but for the life of me I cannot see my problem. The problem is related to ScriptManager.RegisterStartupScript, something I have used many times before. The scenario I have is that I have a custom web control that has been inserted into a page. The control (and one or...

How to emulate ScriptManager.RegisterStartupScript() in ASP.NET MVC project

I am using ASP.NET MVC project and jQuery to handle async requests. Sometimes for an async request I need an initialization JavaScript snippet to be returned and executed together with an HTML snippet (I want this JavaScript to be rendered on server). For now I am using my own ScriptsHelper class with a RegisterStartupScript() method (a...