in

ASP.NET Weblogs

This Blog

Syndication

ASP.NET AJAX Team Blogs

Browse by Tags

All Tags » Tips and Tricks (RSS)
  • July 4th Links: ASP.NET, ASP.NET AJAX, Visual Studio, Silverlight and IIS7

    I've fallen behind on my weekly link-listing series - apologies for the delay. ASP.NET ASP.NET RSSToolkit 2.0 Released : One of the cool projects for ASP.NET 2.0 that was released last year was this free RSS Toolkit - which makes consuming and exposing RSS feeds in ASP.NET super easy (you can even databind any ASP.NET control against them). The team working on the CodePlex project has recently released V2 of the RSSToolkit. You can learn all about it and download it here . Building a Custom Database Driven Site Map Provider: Scott Mitchell has written a great article on how to implement your own site map provider for ASP.NET that is populated from a database (instead of statically from an XML file). You can learn more about the ASP.NET 2.0 SiteMap...
  • Tip/Trick: Url Rewriting with ASP.NET

    People often ask me for guidance on how they can dynamically "re-write" URLs and/or have the ability to publish cleaner URL end-points within their ASP.NET web applications. This blog post summarizes a few approaches you can take to cleanly map or rewrite URLs with ASP.NET, and have the option to structure the URLs of your application however you want. Why does URL mapping and rewriting matter? The most common scenarios where developers want greater flexibility with URLs are: 1) Handling cases where you want to restructure the pages within your web application, and you want to ensure that people who have bookmarked old URLs don't break when you move pages around. Url-rewriting enables you to transparently forward requests to the new page location...
  • Gotcha: Don't use <xhtmlConformance mode="Legacy"/> with ASP.NET AJAX

    Recently I've helped a few developers who have been having some weird JavaScript issues (both when using ASP.NET AJAX and with some other custom JavaScript routines they were using). The culprit was that they had automatically migrated a VS 2003 Web Project to VS 2005, and still had the <xhtmlConformance mode="Legacy"/> switch configured within their web.config file. If you are writing custom client-side JavaScript in your web application and/or are going to be using AJAX, please read-on to learn how to avoid a common gotcha (note: for a list of other tips, tricks, recipes and gotchas I've previously posted, please check out this page here ). Symptom: You see strange behavior when adding new client-side JavaScript to...
  • Gotcha: Lost HTML Intellisense within ASP.NET AJAX Controls

    Symptom: You are using ASP.NET AJAX Beta1 or Beta2, and create a .aspx page that is based on a .master file. You add the <asp:scriptmanger>, <asp:updatepanel>, <asp:updateprogress> or <asp:timer> control into the content page, and find that markup intellisense no longer works for these controls, or for any controls nested within them: In the screen-shot above notice how the ScriptManager, UpdatePanel and ContentTemplate tags have the little red-squiggly lines underneath them. You also won't get tag completion when you type these elements in the document. You can still compile and run just fine, and the WYSIWYG designer works just fine. But you do lose source editor intellisense. Some Background on the Issue: ASP.NET...
  • Nikhil's WebDevHelper Utility and ASP.NET AJAX Support

    If you aren't subscribed yet to Nikhil's blog, you really should visit it and subscribe immediately . Nikhil is an architect on the ASP.NET Team and is constantly cooking up and posting cool new utilities and samples on his blog (all of which are of course free). Among his many projects is the Script# project , which is a C# compiler that generates JavaScript as its output instead of IL (allowing you to get type-safety, refactoring, and compile-time checking of your code). He also wrote the cool forward/back button support control for ASP.NET AJAX that I blogged about in September. Earlier today he released an update to his popular WebDevHelper utility. Included within this release is support for easily monitoring the HTML updates that are returned...
  • ASP.NET Connections Slides + Demos

    Earlier this week I presented at the ASP.NET Connections conference in Las Vegas. This is a great conference that is held twice a year (the fall show is in Las Vegas, the spring show is in Orlando). This past week we had over 1,500 attendees for the ASP.NET conference alone, and more than 4,700 total for all of the DevConnections conferences held in parallel (VS, SQL, SharePoint, Mobile and Office Connections are all held in the same place - with attendees allowed to attend any session). I presented an overview keynote to everyone at the conference on the opening night, and then three ASP.NET specific talks: ASP.NET AJAX Keynote This talk kicked off the first full day of the conference, and provided an overview of our ASP.NET AJAX 1.0 plans...
  • Tip/Trick: Handling Errors with the UpdatePanel control using ASP.NET AJAX

    Luis Abreu is an ASP.NET MVP who has a great blog on the http://msmvps.com blog site. Earlier today he posted a great tutorial post that describes how to use some of the new features in the ASP.NET AJAX Beta1 release to add more robust error handling into your application. I highly recommend reading and bookmarking it for future use. Error handling in an AJAX world can often be tricky -- especially when AJAX call-backs are taking place and a mixture of client and server code is running within an application. In its most recent release, the <asp:updatepanel> control that comes with ASP.NET AJAX now has much more robust error handling and reporting features for you to use. Specifically: 1) You can now handle the "OnAsyncPostBackError" event...
  • Tip/Trick: Cool UI Templating Technique to use with ASP.NET AJAX for non-UpdatePanel scenarios

    I've been having some fun playing around with the ASP.NET AJAX Beta release this weekend. Usually when I integrate AJAX functionality into my code I just end up using the built-in server controls that ASP.NET AJAX provides (UpdatePanel, UpdateProgress, etc) and the cool controls in the ASP.NET AJAX Control Toolkit . Scott Hanselman had jokingly called using these AJAX controls "cheating" when he interviewed me two weeks ago for his latest podcast - since they don't require that you write any client-JavaScript for most common scenarios. This weekend I decided to focus my coding on some of the client JavaScript pieces in the ASP.NET AJAX framework that don't use UpdatePanels at all, and to experiment with alternative ways to use the server to...
  • Tip/Trick: UpdateProgress Control and AJAX Activity Image Animations

    One of the cool new controls provided with the ASP.NET AJAX Extensions (aka "Atlas") is the UpdateProgress control. This control allows you to automatically cause UI to display on a page while an AJAX callback is in progress, and also allows you to provide UI to enable a user to optionally cancel the AJAX callback if it is taking too long. To use this control on a page, simply declare it like so: < atlas:UpdateProgress ID ="progress1" runat ="server"> < ProgressTemplate > < div class ="progress"> < img src ="indicator.gif" /> Please Wait... </ div > </ ProgressTemplate > </ atlas:UpdateProgress > The content within the <ProgressTemplate> will then display while an AJAX callback is occuring. You...
  • Tip/Trick: Enabling Back/Forward-Button Support for ASP.NET AJAX UpdatePanel

    Nikhil recently posted a nice blog post that includes a new ASP.NET AJAX-enabled control called "HistoryControl". When added to a page it allows developers to programmatically add logical views into a browser's history list. This enables you to make AJAX enabled sites much more useful, and to follow the standard back/forward navigation paradigm that traditional web apps follow. For example, the below code could be written by a developer in response to a selection change within a list to to add the previous list selection to the browser's history via Nikhil's "HistoryControl": private void ContentList_SelectedIndexChanged( object sender, EventArgs e) { history.AddEntry(contentList.SelectedIndex.ToString() ; } Once you add entries into the history...
More Posts Next page »