ASP.NET Connections Tips and Tricks Slides+Demos Posted

I'm about to head downstairs for my ASP.NET Tips and Tricks talk at ASP.NET Connections in Orlando.  I'm talking about and demoing a number of nice new things in ASP.NET 2.0 that make web development easier:

  • 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

You can download my slides + samples here.  Each sample above has a sub-directory containing a sample showing it off (note: the one exception is the CSS Control Adapters -- which I will be demoing, but which won't ship on the web until later this month).  

Hope this helps,

Scott 

Published Monday, April 3, 2006 12:36 PM by ScottGu
Filed under: , ,

Comments

# re: ASP.NET Connections Tips and Tricks Slides+Demos Posted

Monday, April 3, 2006 9:13 PM by Robz
Thanks Scott. Great presentation today. I presume that nearly all of the things you presented were available to use in the WAP as well.

I did subscribe to bloglines...seems like a great little service. A lot better than the rudimentary one that I built over a year ago... :)

# re: ASP.NET Connections Tips and Tricks Slides+Demos Posted

Monday, April 3, 2006 10:03 PM by Leo To
Thanks for your demo and I've one question on Cross Page Post-backs. As I can see from many of the examples shown about cross page postback, it only involves basic controls like button or textbox to be found in the 2nd page. How can I access the value in more complex controls like gridview using cross page postback? It'll be good if you can provide another tutorial about this. Thanks a lot!

# re: ASP.NET Connections Tips and Tricks Slides+Demos Posted

Monday, April 3, 2006 11:26 PM by Chris
Great session today! And thanks for posting the code.

You guys have me all riled up about 2.0.

# re: ASP.NET Connections Tips and Tricks Slides+Demos Posted

Tuesday, April 4, 2006 6:14 AM by Jon
I hope you may be able to make a video available on MSDN - the talk looks interesting but it's a few thousand miles away so I can't attend!

# re: ASP.NET Connections Tips and Tricks Slides+Demos Posted

Tuesday, April 4, 2006 9:38 AM by Tahir Azhar
Maybe its just me but trying to use the cross page post-back feature with master pages turned out to be a bit of a pain. It is doable but after using hacks mentioned on various forums like having get methods which expose controls from the previous page and so forth. Even then you run into problems down the line.

I ended up doing the old same back postback and then redirecting to other page with variables in querystring. sigh* I am sure there has to be a better way.

# re: ASP.NET Connections Tips and Tricks Slides+Demos Posted

Tuesday, April 4, 2006 10:29 AM by Sue's little edream
Scott,

thanks for the slides! It's a great summary for the new features asp.net 2.0 has to offer. I learned something new today such as the default focus. Is there a way to disable focus? I have a long page and the form is at the very bottom of the page. Evey time the page load it automatically scroll down to the form because the focus was set on the text box. Netscape and firefox don't have this problem. I didn't set the focus at all but is there a way force it disable? I am not sure if this is off topic I am certainly appreciate any help!

# re: ASP.NET Connections Tips and Tricks Slides+Demos Posted

Tuesday, April 4, 2006 2:50 PM by Gabe
Scott, thanks for the demos. There are several little things in here that I had now idea exisited and they help streamline several areas of my apps.

Quick question: I've been using maintainScrollPositionOnPostBack for a while and it generally works as advertised. However, it doesn't maintain the scroll position for elements such as DIVs. Also, while it generally keeps the scroll position for listboxes, I often find that on large pages with several boxes, there are always a couple that loose their position on postback. Any ideas?

# re: ASP.NET Connections Tips and Tricks Slides+Demos Posted

Wednesday, April 5, 2006 12:25 AM by JHouston
Thanks those are really good examples. Really good examples. Your blog is becoming required reading.

Thanks again!!!

# re: ASP.NET Connections Tips and Tricks Slides+Demos Posted

Thursday, April 6, 2006 1:58 PM by Steve
Is the link going to be made active again? I see it's spewing a 404 error

# re: ASP.NET Connections Tips and Tricks Slides+Demos Posted

Thursday, April 6, 2006 6:20 PM by scottgu
I've seen a few reports that the link wasn't working. I think it is working now, but if not please send me email (scottgu@microsoft.com) and I'll send it to you directly.

Thanks,

Scott

# re: ASP.NET Connections Tips and Tricks Slides+Demos Posted

Friday, April 7, 2006 1:00 PM by Luisnet

Scott, thanks for the demos

# re: ASP.NET Connections Tips and Tricks Slides+Demos Posted

Friday, April 7, 2006 8:36 PM by Steve deRochemont
RegisterStartupScript and RegisterClientInclude are nice, but they both seem to put their script code inside of the ASP.NET <form> tag. Is there an easy way get script code or an include added in the <head> block? Am I missing something easy?
-Steve

# re: ASP.NET Connections Tips and Tricks Slides+Demos Posted

Monday, April 10, 2006 3:23 PM by Raul Macias
About the new way to register controls in the web.config...
-can both user controls (ascx) and custom server controls be registered?
-what are the pros/cons of this way to register controls?

-Raul

# re: ASP.NET Connections Tips and Tricks Slides+Demos Posted

Tuesday, April 11, 2006 3:27 AM by scottgu
Hi Raul,

You can register both custom controls and user controls now within web.config files. There aren't a lot of cons I can think of -- it can be super handy.

Hope this helps,

Scott

# re: ASP.NET Connections Tips and Tricks Slides+Demos Posted

Sunday, April 16, 2006 6:20 PM by Tahir Azhar
Thanks Nik. Just looked at it. Maybe I was missing the <%@ PreviousPageType VirtualPath="~/Source.aspx" %> in the target page but its been a while so can't remember.

# re: ASP.NET Connections Tips and Tricks Slides+Demos Posted

Thursday, April 20, 2006 11:48 AM by DrJazz
The download link appears broken. Instead of downloading a binary .zip file, it streams the file as text. :-(

- DrJazz

# re: ASP.NET Connections Tips and Tricks Slides+Demos Posted

Thursday, April 20, 2006 1:50 PM by scottgu
Hi DrJazz,

Unfortunately my server's hard-drive just crashed and is being restored. If you want to send me email (scottgu@microsoft.com), I can send it to you in the meantime.

Thanks,

Scott

# re: ASP.NET Connections Tips and Tricks Slides+Demos Posted

Friday, April 21, 2006 2:28 PM by DrJazz
I was able to download it fine today. Thanks Scott!!

- DrJazz

# Maintaining the scroll position on a ASP.NET 2.0 WEB ListBox Control

Wednesday, August 2, 2006 5:25 PM by Ovidiu Berca
Hi there ! I am having trouble trying to make a Listbox ASP.NET web control maintain scroll position after postback - in 2.0. I tried SmartNavigation, MaintainScrollPositionOnPostBack which according to my understanding should preserve the scroll position only for the whole web page. I tried also some Jscript code with the RegisterClientScriptBlock function, but nothing seems to work. I think the reason is the JScript code does not recognize my control. I am not so good with JScript. Can anybody help me ? Thanks a lot. Ovidiu

# re: ASP.NET Connections Tips and Tricks Slides+Demos Posted

Friday, September 29, 2006 2:37 PM by Mike Ruse
Do you have any code sample for maintaing the scroll position for individual controls, I would like to have a web form with numerous listboxes that all maintain their individual scroll positions Many thanks

# re: ASP.NET Connections Tips and Tricks Slides+Demos Posted

Saturday, September 30, 2006 1:51 PM by ScottGu

Hi Mike,

Unfortunately I don't have a particular sample that shows how to-do this. :-(  

Sorry!

Scott

# re: ASP.NET Connections Tips and Tricks Slides+Demos Posted

Tuesday, November 14, 2006 3:45 AM by Sonali
Hello ! Slides are very helpful. I've one problem related to tab index. I've few controls on my webpage. I've set tab index for all control. Its working fine. But if click scroll bar of my web page and then press tab key then focus goes to first control. I want it to go on next control. Will you please tell me how to overcome this problem. Thank You.

# re: ASP.NET Connections Tips and Tricks Slides+Demos Posted

Tuesday, November 14, 2006 1:45 PM by ScottGu

Hi Sonali,

I believe this is controlled by the browser. So you might need to write some custom JavaScript in order to change the order.

Hope this helps,

Scott