|
|
These blog entries are written by industry experts and leaders. We consider this content to be a good read for any software developer or web technologist.
November 2009 - Posts
-
Back in September I blogged about the new Microsoft AJAX CDN (Content Delivery Network) service that the ASP.NET team is now providing. The CDN provides edge caching support for AJAX libraries (including jQuery and ASP.NET AJAX). The service is available for free, does not require any registration, and can be used for both commercial and non-commercial purposes. It offers a great way to speed up your external facing web-sites. SSL Support Now Provided One of the features in September that we said was coming (but which was not available at the initial launch) was SSL support for scripts served off of the CDN. This is necessary for scenarios where you have SSL enabled pages on your site, and you want to reference a script library from the Microsoft CDN and avoid a “This page contains both secure and non-secure items” warning message being displayed to end-users visiting your site. SSL support is now enabled with the scripts hosted on the Microsoft AJAX CDN. Simply use an “https” moniker with any script references on your site that point to the CDN, and they will now be served over SSL. For example, below is how you can reference jQuery over SSL: <script src="https://ajax.microsoft.com/ajax/jquery/jquery-1.3.2.min.js" type="text/javascript"></script> The Microsoft AJAX CDN documentation has recently been updated with more details about it. You can visit it here to learn more. It lists all of the libraries currently offered via the CDN. We are steadily adding more libraries to it and will update the page as new ones become available. Hope this helps, Scott P.S. In addition to blogging, I’m also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu 
|
-
I’m off to Europe next week to do a bunch of technical presentations. I’m presenting for 5-6 hours in a bunch of different cities, and will be doing talks that cover: ASP.NET 4 and VS 2010, ASP.NET MVC 2, and Silverlight 4. Below are details on the different cities I’m visiting, and how to register to attend the talks: I’ll also be attending the BizSpark Camp in Paris on December 8th and will be doing a presentation there as well: Hope to see some of you at once of these events in person! Scott P.S. In addition to blogging, I’m also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu 
|
-
This past week was a busy one – with lots of announcements and cool releases happening at this year’s PDC conference. All of the PDC keynotes and breakout sessions are now posted online for anyone to watch for free. You can find sessions to watch here. My PDC keynote covered our new Silverlight 4 release and was on Day 2. You can watch it here (I start at the 1 hour, 2 minute, and 45 second mark). LIDNUG Online Chat Monday November 23rd I’ll be doing a free online web chat Monday November 23rd at 11:30am PST where you can ask any questions about anything (including PDC announcements). The chat is hosted by the LIDNUG user group. You can sign up and attend for free here. The chat will be recorded and I’ll update this post with a link to the recording when it is over. You can ask questions either through the chat tool – or by posting them to Twitter. To ask questions via twitter simply post a tweet using this format: @ScottGu #LidnugLiveQ question goes here Other PDC Resources I’ll be doing more blog posts about some of what was announced at PDC this past week. Below are a few good posts that summarize some of the announcements from my team in the meantime: Hope this helps, Scott P.S. In addition to blogging, I’m also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu (@scottgu is my twitter name) 
|
-
ASP.NET's PasswordRecovery provides a mechanism for users to recover their forgotten passwords. Depending on how user passwords are saved, the PasswordRecovery control will either email a user their password or it will reset the user's password to a new, auto-generated one and email them this new password. In either case, the PasswordRecovery control sends an email message. To accommodate this, your web application should have the SMTP settings defined in Web.config's section as described in this article: Sending Email in ASP.NET.
Certain SMTP servers (such as GMail's) only accept connections over SSL. Unfortunately, you cannot specify whether to send emails via SSL from the section; rather, you have to do it when you instantiate the SmtpClient object, via its EnableSsl property. This is problematic if you need to have the PasswordRecovery control send the user her password via an SMTP server that requires SSL. The workaround is to create an event handler for the PasswordRecovery control's SendingMail event, where you create your own SmtpClient object, set its EnableSsl property, and use it to send the MailMessage object the PasswordRecovery control is getting ready to send. Protected Sub prResetPwd_SendingMail(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.MailMessageEventArgs) Handles prResetPwd.SendingMail
Dim smtp As New SmtpClient
smtp.EnableSsl = True
Try
smtp.Send(e.Message)
Catch ex As Exception
'Decide how to handle SMTP errors
End Try
'Instruct the control to cancel sending the email itself, since we just sent it
e.Cancel = True
End Sub
Two things to note:
- The MailMessage object that the PasswordRecovery control is about to send is available via e.Message, and
- It is important to set e.Cancel to True. This tells the PasswordRecovery control to not send the email, which is what we want because we have already sent it with the SmtpClient object created in this event handler.
This concept can be extended to other ASP.NET Web controls that can automatically send emails (such as the CreateUserWizard control).
Happy Programming!
|
-
My Toolbox column in the November 2009 issue of MSDN Magazine is available online and includes the following reviews:
- BI Documenter - point BI Documenter to the schema of your database and select which database objects to include. Then, with the click of a button, BI Documenter will create a Compiled Html Help File (.chm) or HTML pages that documents the selected database objects. You can also add rich database diagrams created using BI Documenter's built-in diagramming tool, as well as include your own image and Microsoft Word files.
- Blogs of Note: Beth Massi - Microsoftie Beth Massi has a great blog with tips, tricks, and tutorials on Office development, WPF, ADO.NET Data Services, and more. What makes Beth's blog unique is her passion for Visual Basic - all of her code samples are in VB and she often posts about upcoming language features and enhancements.
- CuttingEdge.Conditions - CuttingEdge.Conditions is an open source library that enables developers to define pre- and post-conditions using a fluent interface, which is an API design style that aims at maximizing readability through the use of descriptive names and method chaining. For example, you can define a pre-condition on the input parameter id like so:
public void DoSomething(Nullable id)
{
// Check all preconditions:
Condition.Requires(id, "id")
.IsNotNull() // throws ArgumentNullException on failure
.IsInRange(1, 999) // ArgumentOutOfRangeException on failure
.IsNotEqualTo(128); // throws ArgumentException on failure
...
}
This issue reviewed ASP.NET MVC Framework Unleashed, by Stephen Walther. An exerpt from my review follows:
Getting started with ASP.NET MVC involves a bit of a learning curve, even for experienced ASP.NET developers, because of the numerous differences between the two frameworks. For example, when creating an ASP.NET MVC application in Visual Studio, you are prompted to create a unit test project. With ASP.NET MVC, you design your Web pages using HTML along with a few helper classes—there are no Web controls to drag and drop onto the page. And unlike Web Forms, there are no baked-in postback or Web control event models. In short, there are a lot of new techniques to learn when moving from Web Forms to ASP.NET MVC. If you are an intermediate to experienced ASP.NET developer who wants to learn ASP.NET MVC, check out Stephen Walther’s latest book, “ASP.NET MVC Framework Unleashed” (Sams, 2009). Walther does an excellent job introducing new concepts and showing how they’re used—without overwhelming the reader with an avalanche of information.
Enjoy! - http://msdn.microsoft.com/en-us/magazine/ee335714.aspx
|
-
I’m doing keynotes at two big conferences later this month: ASP.NET Connections in Las Vegas: November 9th to 12th I’ll be doing a keynote talking about ASP.NET 4 and VS 2010 at the ASP.NET Connections conference next week. I’ll also be doing an evening Q&A session together with the ASP.NET team. ASP.NET Connections is a great conference that is jointly hosted with the VS, SharePoint, SQL and Windows Connections conferences (enabling you to choose from tons of great sessions). The speakers at the event are also really top-notch. You can learn more about the conference and register online here. PDC in Los Angeles: November 17th to 19th I’m also doing a keynote at the Microsoft PDC conference in two weeks. The PDC is Microsoft’s big platform conference, where we talk about future platform and technology roadmaps. There is almost always some cool new stuff... You can learn more about the conference and register online here. Hope I might be able to see some of you in person at one of these events! Scott P.S. In addition to blogging, I’m also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu (@scottgu is my twitter name) 
|
|
|
|