Showing posts with label scriptmanager. Show all posts
Showing posts with label scriptmanager. Show all posts

Saturday, March 24, 2012

Purpose of "AllowPartialRendering=true"

WHen I used "Autocomplete" contorl of Atlas, I did not need the scriptmanager to have the above attribute to be set specificcally to true and everything worked great.

However, when I started using web parts where I had two calendars in two web part zones, as soon as I clicked on a date in one calendar, i could see the entire page refresh. When i set the above mentioned parameter to true, that thing went away.

So when to set this parameter to true or is it required always?

When you use the UpdatePanel control, setting the EnablePartialRendering property to True allows you to get a partial page rendering...
When you use the UpdatePanel control, setting the EnablePartialRendering property to True allows you to get a partial page rendering...

question about the callback feature and scriptmanager

Hi,my application will have a textfield and a button (html control) and when the button is clicked, it will pass the textfield.value by calling a javascript function to the server side function and do something such as find the data in a database, after that it will return the result back to html page.

my question is, as far as I know I can use callback feature to do this, becuase what i need to do is register a page in the behind code. so the js function can call the registed function. However, as I know if use the scriptmanager and create a web serivce page with setting the class or specific methods as [scriptservice] attribute, then the js function can also call the code-behind function. therefore I wonder what is the different between those two feature. Hope someone can explain to me.

Ok, so you are using Callbacks instead of postbacks by using ICallBackHandler? Then you are also using MS AJAX? with ScriptManager?

You should only use one kind of AJAX. If you use only MS AJAX you won't have to use javascript to update your controls.

Question about the ScriptManagerProxy

I have a question about the ScriptManagerProxy control.

I have a .master page that uses an UpdatePanel with a ScriptManager and I want the child pages of this MasterPage to be able to use an UpdatePanel control also. I can't have another ScriptManager control on the child pages so how do I use the ScriptManagerProxy control to point to the ScriptManager on the MasterPage? Is this possible?

Thanks

Hi,

the ScriptManagerProxy is used to add references to script files and web services, but nothing prevents you to use an UpdatePanel in a child page, if you have the ScriptManager on the master page.


Oh okay. So I don't even need a ScriptManagerProxy control. I can just use the ScriptManager that I have in the .master page. I'll try it out and then let you know how it goes...Thanks!

I did what you said (pretty simple and easy, I was making it too complex) and it worked great! But, I didn't/don't have enough knowledge about the UpdatePanel that this was not exactly what I wanted it to do. I'll try to explain it as best as I can.

On my .master page I have a menu with several hyperlinks. All of these hyperlinks point to the same page (links.aspx which is a child page of the .master page) However, these hyperlinks carry with them a QueryString of data that will very depending upon which hyperlink the user clicked on. What I want to happen is this: When a user clicks on a hyperlink on the menu it will just update that part of the site with the new data that is brought in in accord with the QueryString and does not refresh the entire page. I think it might have something to do with the triggers in the UpdatePanel. Does this make any sense?

Thanks,

Wednesday, March 21, 2012

Question in regards to deploying AJAX enabled application to Windows 2003 server

I have developed an AJAX enabled web site on a Vista machine. The page I will be refering to contains ScriptManager, UpdatePanels and CollapsiblePanel. This page works fine on the local machine. However when I deployed this application to a Windows 2003 server (Framework 2.0 and ASP.NET 2.0 AJAX Extensions 1.0 installed) and try to invoke it, I get the following error. Any help will be appreciated.

--------
Windows Internet Explorer
--------
Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.

Details: Error parsing near '<!DOCTYPE HTML PUBLI'.
--------
OK
--------

Are you using a Firewall on the server, I've seen issues with some firewalls and a setting "Remove Unknown Headers"

Check outhttp://alpascual.com/blog/al/archive/2007/04/26/How-to-fix-Sys.WebForms.PageRequestManagerParserErrorException-in-AJAX.aspx for a potential fix.

Also see this:http://weblogs.asp.net/leftslipper/archive/2007/02/26/sys-webforms-pagerequestmanagerparsererrorexception-what-it-is-and-how-to-avoid-it.aspx for help on debugging the issue.

-Damien

Question regarding error code

I added a script to the scriptmanager that cancels a request (a button click) if there current outstanding async request. Below the questions is the javascript that is being used

Questions:
1. I got a random 12004 error as a message box. Its only happened once, and I am not sure how to track it as it was "an unknown error".

2. Is there a way to tell if the way to tell if the the button caused the postback currently being processed, and the control requesting one?

3. In the javascript (taken fromhttp://www.asp.net/AJAX/Documentation/Live/tutorials/CancelAsyncPostback.aspx) there is this symbol: !== what does this do?

Sys.Application.add_load(ApplicationLoadHandler)
function ApplicationLoadHandler(sender, args)
{
Sys.WebForms.PageRequestManager.getInstance().add_initializeRequest(CheckStatus);
}


function CheckStatus(sender, args)
{
var prm = Sys.WebForms.PageRequestManager.getInstance();
if (prm.get_isInAsyncPostBack() & args.get_postBackElement().id == 'Button1')
{
args.set_cancel(true);
}

}

if(typeof(Sys) !== "undefined") Sys.Application.notifyScriptLoaded();

!== and === are strictly typed comparisons, instead of the dynamic typing that JavaScript normally uses. For example, 3 == "3" is true, but 3 === "3" is false.

For checking the sender against current request, I'd suggest making sure the button is disabled when a request is made instead. That way you don't even have to worry about getting the same control that you're processing for as a new request (which I assume is what you're trying to handle with the check).


The issue is that javascript such as: document.getElementById('Button1').click() can still fire even if the button is disabled.

Question Script Manager

Hi all... I have a question, I'm putting my ScriptManager in my Masterpage so i don't have to put it in every container place holder, but when i drag and drop for example, a AjaxControlToolKit i get an error Rendering 'cause it doesn't find the ScriptManager, so I really don't know if i should put the ScriptManager in every container place holder (if i'm wrong doing it that way) or is a problem in the Ajax Control Tool Kit... so let me know how should be done...

thanks...

Hey,

Don't let the designer tell you the truth, because in design mode, it can't find the script manager; however, when you run the page, the master page becomes part of the page and it may be available then. Try seeing if it works in run time (I don't know offhand if you can do that), and if you can do it at runtime, then it's OK to do. Though, I often put it in each page, because not every page uses the AJAX features, and at times its handy to be able to use the designer, and not have it complain that it can't find the script manager.


Thanks... well another thought... shouldn't be a fix for that... I mean is really annoying to have that problem... i think if should ever be a Service Pack 2 for VS2005 they should fix that

i mean... just a thought... Stick out tongue


It's supposed to become part of the ASP.NET framework eventually... maybe then...


Wish i could say that i had the same resuts but unfortunately now that i've installed the ajax too kit after having the atlas toolkit on my machine i can't get the script manager to work...even if i try compiling the app it won't run.

try to do this..

go to the Microsoft.Net framework version 2.0 temporary asp.net files and clean that, some times for me gives me an error in compiling so i clean that and i'm ready to go...

Delete all files in that directory

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files

(C: is your drive where the OS is install)

then compile your application and tested