professional documents
home
Profile
Upload
docsters
Blogs
Upload
Powerpoint

Cool Tips and Tricks with ASP.NET 2.0 center doc

technology

 

 

Cool Tips and Tricks with ASP.NET 2.0 Scott Guthrie General Manager Microsoft Corporation Email: scottgu@microsoft.com Blog: http://weblogs.asp.net/scottgu Website: http://www.scottgu.com Agenda App_Offline.htm Cross Page Post-backs Validation Groups Maintaining Scroll Positions Control Focus, Default Buttons, Error Focus Client Scripting and Client Confirmations Data-binding Expressions Config-based Control Registration CSS Control Adapters RSS Feeds and Subscriptions Download Today http://weblogs.asp.net/scottgu App_Offline.htm Enables you to gracefully take a server application “offline” for maintenance Useful when making big changes/upgrades Enabled by adding a “app_offline.htm” file at the root of an application 1) Causes ASP.NET app to shutdown 2) Causes all dynamic requests to return app_offline.htm file contents Tip: Make sure the app_offline.htm file is large enough (512 bytes) to disable the IE “friendly http errors” feature App_Offline.htm Cross Page Post-backs ASP.NET 2.0 Supports Cross Page Postbacks Scenario: Search or lookup button at top of page Postback target via “PostBackUrl” property Can be declaratively or programmatically set Postback “target page” has full access to server controls for “originating page” Access controls via “Page.PreviousPage” property <%@ PreviousPage VirtualPath=“a.aspx” %> Cross-Page Postback Example: „ Page2.aspx Dim MyCalendar as Calendar = PreviousPage.FindControl(“MyCalendar”) Label1.Text = “You selected: “ & MyCalendar.SelectedDate Cross Page Postback Validation Groups Enable validation controls to only apply in response to a specific button/action Today validation controls apply “all or nothing” Indicated via “ValidationGroup” property Supported by all Validation and Postback controls Controls in ValidationGroup validate with postback Programmatic Support for Validating Groups If (Page.Validate(“group_name”)) Then Page.IsValid evaluates ValidationGroup Postback ValidationGroup Example:
Validation Groups MaintainScrollBackPosition Enable pages to automatically maintain the current scroll position across postbacks Useful for large pages with input controls To enable set a page directive attribute <%@ Page MaintainPostBackPosition=true %> Cross-browser solution Works with all modern browsers MaintainScrollBackPosition Default Button Enable developers to identify default button behavior when the “enter” key is hit Cross browser: works with all modern browsers Can be set on
control to identify default for the form Can also be set on control to override form behavior when an input control has focus in the browser Default Button Example: Default Focus Enable developers to identify default focus behavior when page is loaded Cross browser: works with all modern browsers Can be set on
control to identify default for the form Can also be programmatically set: Page.SetFocus(control) TextBox.Focus() Default Focus Example: SetFocusOnError Enable developers to force focus on a control when a validation error occurs Set as a property on the validation control $" & value & "" Else Return "$" & value End If End Function Custom Databinding Expressions Web.Config Registration of Controls Server controls can now be registered within web.config files instead of on every page Full Visual Studio support w/ intellisense Control Registration in Web.Config CSS Control Adapters ASP.NET 2.0 supports a “control adapter” architecture that allows developers to customize and override rendering semantics Eg: use CSS instead of tables/inline-styles Enabled by adding a .browser file within /app_browsers directory that maps a control to a control-adapter class CSS based sample coming later this month Menu, Treeview, DataList, DetailsView, FormView CSS Control Adapters RSS Flexible, open, format for sharing information Blogs, Newspapers, Events, Amazon Wishlists, etc. Also useful for sharing information w/ customers ASP.NET RSS Toolkit makes RSS super easy Enables developers to subscribe to RSS feeds Enables developers to publish RSS feeds Integrated caching engine Download from: http://blogs.msdn.com/dmitryr RSS Toolkit Example

Recent ScottGu Posts

<%# Eval("title") %> RSS Reader Summary Enormous number of new features in ASP.NET 2.0 Tons of additional cool features out there… Visit the http://www.asp.net/ quickstarts to try out hundreds of samples online Download these slides+demos from: http://weblogs.asp.net/scottgu © 2003-2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. Appendix Client-script Callbacks Take advantage of AJAX callbacks ASP.NET .2.0 has a built-in “client callback” mechanism that controls can use ICallbackEventHandler interface Supports hierarchical nesting/containership Treeview, GridView and DetailsView implement automatically “Atlas” provides even richer AJAX support Via both controls and script methods Client Script Callbacks Always deploy Debug=“false” Common mistake is to deploy ASP.NET apps with set Bad consequences: Debug compilation slows performance App uses much more memory Client-side scripts are not cached Consider using a VS 2005 Web Deployment Project to automate configuration changes
flag this doc
415
25
not rated
0
7/6/2008
English
search termpage on Googletimes searched
Preview

Advanced Performance Techniques in ASP.NET 2.0

itchak 11/6/2007 | 763 | 78 | 1 | technology
Preview

Teaching Tips and Tricks

RMA 6/18/2008 | 35 | 3 | 0 | legal
Preview

Macroeconomic Cheat Sheet, Macroeconomic Tips and Tricks

MissPowerPoint 6/27/2008 | 76 | 5 | 0 | technology
Preview

opera Tips And Tricks

honeytech 11/12/2007 | 212 | 9 | 0 | business
Preview

tips and tricks - adobe software

honeytech 11/12/2007 | 1310 | 26 | 0 | business
Preview

copywriting-tips-and-tricks

lifeadvice 12/16/2007 | 216 | 12 | 0 |
Preview

HpLoad Runner Tricks And Tips

usvoruganti 4/17/2008 | 206 | 22 | 0 | technology
Preview

Photoshop Tips and Tricks

houts 9/2/2008 | 27 | 2 | 0 | technology
Preview

GarageBand Cheats Tips and Tricks for GarageBand Users Guide

MissPowerPoint 6/27/2008 | 73 | 2 | 0 | technology
Preview

The CIA Book of Dirty Tricks

MattD 11/7/2007 | 4672 | 401 | 2 | creative
Preview

Tips and tricks for low cost websites

CommunityPlan 8/21/2008 | 15 | 0 | 0 | legal
Preview

How to write an incident report

Jason 9/4/2008 | 1 | 0 | 0 |
Preview

HOW TO START A SUPPORT GROUP

Jason 9/4/2008 | 3 | 1 | 0 |
Preview

How to Measure Institutions

Jason 9/4/2008 | 2 | 1 | 0 |
Preview

How to get Funding for a Startup

Jason 9/4/2008 | 4 | 2 | 0 |
Preview

How to Find a Lost Cat

Jason 9/4/2008 | 0 | 0 | 0 |
Preview

How to be Normal

Jason 9/4/2008 | 1 | 0 | 0 |
Preview

Writing a winning business plan

Jason 9/4/2008 | 3 | 0 | 0 |
Preview

Why Venture Capital Will Out Perform PE Over The Next 5 Years

Jason 9/4/2008 | 3 | 0 | 0 |
Preview

What is Hypnosis

Jason 9/4/2008 | 1 | 0 | 0 |
Preview

Venture Capital Trends

Jason 9/4/2008 | 3 | 0 | 0 |
asp113
page12
dirty flag disable button asp12
disable asp22
web52
cool asp11
tricks in asp21
disable all controls on the click of the button as11
cool tricks browser customization11
tricks for uploading asp11
"asp31
set validationgroup on the detailsview21
override treeview postback31
app_offline21
vs format phone number in formview with asp41
ajax programmatically force full postback asp11
validationgroup example11
force postback 2 asp21
asp,net detailsview set programmatically41
programmatically bind detailsview treeview vb asp31
 
review this doc