<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <div id="navbar-iframe-container"></div> <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script> <script type="text/javascript"> gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { if (gapi.iframes && gapi.iframes.getContext) { gapi.iframes.getContext().openChild({ url: 'https://www.blogger.com/navbar.g?targetBlogID\x3d8211560\x26blogName\x3dTech+Tips,+Tricks+%26+Trivia\x26publishMode\x3dPUBLISH_MODE_BLOGSPOT\x26navbarType\x3dBLUE\x26layoutType\x3dCLASSIC\x26searchRoot\x3dhttp://mvark.blogspot.com/search\x26blogLocale\x3den\x26v\x3d2\x26homepageUrl\x3dhttp://mvark.blogspot.com/\x26vt\x3d-5147029996388199615', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe" }); } }); </script>

Tech Tips, Tricks & Trivia

by 'Anil' Radhakrishna
An architect's notes, experiments, discoveries and annotated bookmarks.

Search from over a hundred HOW TO articles, Tips and Tricks


Leveraging Client-Side Enhancements in ASP.NET 2.0

ASP.NET 2.0 offers some interesting client-side enhancements that provide a higher-level abstraction to common web development chores so that developers don't have to dirty their hands with the intricacies of HTML & JavaScript. Scott Mitchell shares these 3 tips in a 4Guys.. article.

1) To maintain scroll position on postbacks, the MaintainScrollPositionOnPostback Page directive can be set to "true". To apply it to all pages in the website, it can be added to the pages element within the <system.web> element in web.config.

2) To programmatically set focus to a Web control on page load, the Focus() method (available for all Web controls in ASP.NET 2.0 including the TextBox Web control) can be used. Javascript for the ASP.Net 2.0 controls is typically generated by a request to webresource.axd. WebResource.axd is a new built-in HTTP handler in ASP.NET 2.0 that's used to retrieve script code into pages.

3) To perform a client-side action when a Button, LinkButton, or ImageButton is clicked, ASP.NET 2.0 introduces the OnClientClick Property. The required Javascript is automatically generated for the rendered page.

Labels: ,

Tweet this | Google+ it | Share on FB

« Home | Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »

»

Post a Comment