Showing posts with label microsoft. Show all posts
Showing posts with label microsoft. Show all posts

Monday, March 26, 2012

Detecting browser closing in session

Hi

Sorry if this is obvious but I'm new to Microsoft Ajax. Is there anything in Microsoft Ajax/Asp.net to detect when the browser is closed via the 'X' button?

thanks

No, the browser does not notify that is closes, it just quits asking data from the webserver.


No. There's no reliable way to notify the server about the browser being closed. May be some java script hack is available but it is not recommended.

Wednesday, March 21, 2012

degradable Microsoft Ajax

Hello

I have a question about Microsoft Ajax, is Microsoft Ajax degradable ? Meaning will the website function even if I turn the Javascript off ? I know there is a small portion of users out there having their Javascript turned off, but I just wanted to know this out of curiosity!


Thank you

That depends on how you implement it. Can you build to degradeability? Yes. Does the framework force you to? No. For example, you could replace all your normal event handling with javascript calls to web services. Then your solution wouldn't degrade well.


I am confused now. Ok let me explain myself. lets say if I use a update panel and a triger, etc using standard Microsft Ajax controls, then what happen if I disable my Javascript on browser ? Does the solution still work.

I am not suing and customized javascript code myself, such as event handling, etc.



Yes Update Panel is inteligent enough to detect it and do the regular postback instead of partial..

Default Master Page

As I read the Labs, Microsoft is highly suggesting the use of Master Pages in Atlas applications to simplify the the creation of Atlas applications. What about adding a master page with the necessary stuff in it when an Atlas application is created in the IDE.
WallyThe ScriptManager control works better for generating script references than using shared references stored in a master page.
In my humble opinion, the labs are giving some bad advice. I see master pages being abused in the newsgroups as a container for common code and functionality, which I feel is going to be a maintenance problem later in the app's lifecycle.
http://odetocode.com/Blogs/scott/archive/2005/09/10/2179.aspx
I'd be more comfortable if the common Atlas goo was defined in (or injected from) a base class I derive from Page. If the common goo is really generic enough, perhaps the framework can automatically inject what it needs based on a property we can set before OnInit, e.g. <% @. Page AtlasEnabled="true" ... %>.