After lots new coding and refactoring, dotNetTips.Utility 3.5 R2 is finally released! This assembly is much of the common code I have been writing for the past 9+ years all wrapped up in a nice package and easy to use. Here is just some of what is in the new version:

New Classes

  • EmailTraceListener - Send emails when trace events happen (I suggest using filters here)!
  • WebServiceTraceListener - Send trace events to a web service. I use this for logging events to a central back-end database!
  • Lots of new Extension methods and classes:
    • Color
    • DateTime
    • Decimal
    • Entity Framework
    • Image
    • Nullable
    • Xlement
    • And more!
  • GeoInfoHelper - Get geo location info based on IP address.
  • And lots more!
The documentation, binary and source code can be downloaded from CodePlex.

Coming soon... .NET 4.0 version!


 
December 13, 2009
@ 11:41 AM

If you are interested in added Bing.com maps into your web sites, check out the SDK's below:

Bing Maps AJAX Control SDK 6.2

This software development kit (SDK) provides programming reference and how-to topics for getting started with the Bing Maps AJAX Control.

Bing Maps Web Services SDK 1.0

This software development kit (SDK) provides programming reference and how-to topics for getting started with the Bing Maps Web Services

Bing Maps Silverlight Control SDK

This software development kit (SDK) provides the binaries and programming reference for the Bing Maps Silverlight Control.


 
Categories: AJAX | ASP.NET | Link | Web Services

November 13, 2009
@ 11:49 AM
I hope everyone in southern California is planning to attend this years SoCal Code Camp in San Diego on 11/21 - 11/22. It's always a great time and lots of free training!

I will be presenting the following sessions and I hope you will attend. Also, check out my new .NET discussion site called DotNet Army!

Building nTier Applications with Entity Framework Services

Learn how to build real world nTier applications with the new Entity Framework and related services introduced in .NET 3.5 SP1. With this new technology built into .NET, you can easily wrap an object model around your database and have all the data access automatically generated or use your own stored procedures and views. Then learn how to easily and securely expose your object model using WCF with just a few line of code using ADO.NET Data Services. The session will demonstrate how to create and consume these new technologies from the ground up. Lots of code!

Slides: Building nTier Applications with Entity Framework Services.pdf (2.88 MB)
Demo Code: EntityFramework.zip (859.84 KB)


dotNetDave's Favorite Programming Tools

This session will focus on my favorite Visual Studio add-ins and other tools that makes programming faster and easier. I will focus on tools that are either free or very affordable. Tool categories include Writing Better Code (easier, faster and correct the first time!), Code Helpers, Documentation (helper and creation), General Utilities and more. These tools are designed to impress your boss and get you home at a reasonable time. Packed full of demonstrations and very few PowerPoint slides! Licenses for some of the 3rd party products I will be demonstrating will be given away (over $1,100 worth), so be sure to attend and bring a business card!

Slides: dotNetDave's Favorite Programming Tools.pdf (1.82 MB)

Building Rich & Interactive Web Applications with ASP.NET AJAX

Learn how to build rich web application interfaces using ASP.NET AJAX and the ASP.NET AJAX Control Toolkit. This new technology makes programming JavaScript into your ASP.NET pages easy, increasing the power and functionality of your applications, reducing round trips to the server, and making it easy to consume web services for dynamic content. In this session you will be introduced to the new client and server controls for ASP.NET and Java Script to learn how to build a rich Web 2.0 experience for your users.

Slides: Building Rich & Interactive Web Applications with ASP.NET AJAX - 2009.pdf (2.36 MB)
Demo Code: AdventureWorksAjax.zip (803.65 KB)

Why You Need .NET Coding Standards (2009)

This session will guide any level of programmer to greater productivity by providing the information needed to write consistent, maintainable code. Learn about project setup, assembly layout, code style, defensive programming and much, much more. We will even go over some real in production code and see what the programmer did wrong in "What's Wrong With this Code?". Code tips are included to help you write better, error free applications. Lots of code examples in C# and VB.NET.

Slides: Why You Need .NET Coding Standards-2009.pdf (3.8 MB)
Demo Code: CodingStandards.zip (245.54 KB)


Pictures and Video

SoCal CodeCamp Fullerton - 2009

Pictures & Video from This Years Code Camp:

Pictures from past SoCal Code Camps:

Video from past Code Camps:


 
Categories: ADO.NET | AJAX | ASP.NET | Code Camp | Csharp | Defensive Programming | Development | dotNetDave | Entity Framework | Generics | LINQ | VB.NET | VS.NET | WCF

September 24, 2009
@ 09:24 AM

Microsoft launched WebsiteSpark today. WebsiteSpark is designed for independent web developers and web development companies that build web applications and web sites on behalf of others.  It enables you to get software, support and business resources from Microsoft at no cost for three years, and enables you to expand your business and build great web solutions using ASP.NET, Silverlight, SharePoint and PHP, and the open source applications built on top of them.

For more info, click here.



 
Categories: ASP.NET | Link | News | Silverlight

I hope everyone in Arizona and southern California is planning to attend this years Desert Code Camp on 6/13 and SoCal Code Camp in San Diego on 6/27 - 6/28. It's always a great time and lots of free training! I will also be selling a limited number of my latest book "David McCarter's .NET Coding Standards" at my sessions for $12, cheaper than the web site (no tax and shipping), please bring exact change or check.

I will be presenting the following sessions and I hope you will attend. Also, check out my new .NET discussion site called DotNet Army!

Building nTier Applications with Entity Framework Services

Learn how to build real world nTier applications with the new Entity Framework and related services introduced in .NET 3.5 SP1. With this new technology built into .NET, you can easily wrap an object model around your database and have all the data access automatically generated or use your own stored procedures and views. Then learn how to easily and securely expose your object model using WCF with just a few line of code using ADO.NET Data Services. The session will demonstrate how to create and consume these new technologies from the ground up. Lots of code!

Slides: Building nTier Applications with Entity Framework Services.pdf (2.88 MB)
Demo Code: EntityFramework.zip (859.84 KB)


dotNetDave's Favorite Programming Tools

This session will focus on my favorite Visual Studio add-ins and other tools that makes programming faster and easier. I will focus on tools that are either free or very affordable. Tool categories include Writing Better Code (easier, faster and correct the first time!), Code Helpers, Documentation (helper and creation), General Utilities and more. These tools are designed to impress your boss and get you home at a reasonable time. Packed full of demonstrations and very few PowerPoint slides! Licenses for some of the 3rd party products I will be demonstrating will be given away, so be sure to attend and bring a business card!

Slides: dotNetDave's Favorite Programming Tools.pdf (1.82 MB)

Building Rich & Interactive Web Applications with ASP.NET AJAX

Learn how to build rich web application interfaces using ASP.NET AJAX and the ASP.NET AJAX Control Toolkit. This new technology makes programming JavaScript into your ASP.NET pages easy, increasing the power and functionality of your applications, reducing round trips to the server, and making it easy to consume web services for dynamic content. In this session you will be introduced to the new client and server controls for ASP.NET and Java Script to learn how to build a rich Web 2.0 experience for your users.

Slides: Building Rich & Interactive Web Applications with ASP.NET AJAX - 2009.pdf (2.36 MB)
Demo Code: AdventureWorksAjax.zip (803.65 KB)

Why You Need .NET Coding Standards (2009)

This session will guide any level of programmer to greater productivity by providing the information needed to write consistent, maintainable code. Learn about project setup, assembly layout, code style, defensive programming and much, much more. We will even go over some real in production code and see what the programmer did wrong in "What's Wrong With this Code?". Code tips are included to help you write better, error free applications. Lots of code examples in C# and VB.NET.

Slides: Why You Need .NET Coding Standards-2009.pdf (3.8 MB)
Demo Code: CodingStandards.zip (245.54 KB)


Pictures and Video

SoCal CodeCamp Fullerton - 2009

Pictures from This Years Code Camp:

Pictures from past SoCal Code Camps:

Video from past Code Camps:


 
Categories: .NET | ADO.NET | AJAX | ASP.NET | C# | Code Camp | Defensive Programming | dotNetDave | Entity Framework | Generics | LINQ | VB.NET | VS.NET | WCF | Web Services

May 22, 2009
@ 02:36 PM
If you are a web developer, then Firebug for Firefox puts a wealth of web development tools at your fingertips while you browse. You can edit, debug, and monitor CSS, HTML, and JavaScript live in any web page. Check it out by going to:

http://getfirebug.com/


 
Categories: AJAX | ASP.NET | Link

If you are displaying text in a GridView control that contains line feeds, it won't display correctly. You would think that setting the HtmlEncode property in a BoundField would do the trick, but no! Nothing I did would work. Below is the only work around that I could find:

protected void EventLogMessagesGridView_RowDataBound(object sender, GridViewRowEventArgs e)

{

  e.Row.Cells[0].Text = e.Row.Cells[0].Text.Replace(System.Environment.NewLine, "<br/>");

 

}

If you have a better way, please let me know.

Tip Submitted By: David McCarter


 
Categories: ASP.NET | C#

March 18, 2009
@ 02:41 PM
Check out this site where you can download and install lots of cool extensions to IIS 7 that adds features like FTP Publishing Service, WebDAV, URL Rewriting and more!

http://www.iis.net/extensions


 
Categories: ASP.NET | Link

January 9, 2009
@ 03:19 PM
I hope everyone in southern California is planning to attend this years SoCal Code Camp at Cal State Fullerton on 1/24 - 1/25. It's always a great time and lots of free training! I will also be selling a limited number of my latest book "David McCarter's .NET Coding Standards" at my sessions for $11, cheaper than the web site (no tax and shipping), please bring exact change.

I will be presenting the following sessions and I hope you will attend. Also, check out my new .NET discussion site called DotNet Army!

Building nTier Applications with Entity Framework Services

1:30PM Saturday - Room: UH 246

Learn how to build real world nTier applications with the new Entity Framework and related services introduced in .NET 3.5 SP1. With this new technology built into .NET, you can easily wrap an object model around your database and have all the data access automatically generated or use your own stored procedures and views. Then learn how to easily and securely expose your object model using WCF with just a few line of code using ADO.NET Data Services. The session will demonstrate how to create and consume these new technologies from the ground up. Lots of code!

Slides: Building nTier Applications with Entity Framework Services.pdf (2.79 MB)
Demo Code: Building nTier Applications with Entity Framework Services.zip (849.73 KB)


dotNetDave's Favorite Programming Tools

1:15PM Saturday - Room: UH 250

This session will focus on my favorite Visual Studio add-ins and other tools that makes programming faster and easier. I will focus on tools that are either free or very affordable. Tool categories include Writing Code (easier, faster and correct the first time!), Code Helpers, Documentation (helper and creation), General Utilities and more. These tools are designed to impress your boss and get you home at a reasonable time. Packed full of demonstrations and very few PowerPoint slides! Licenses for some of the 3rd party products I will be demonstrating will be given away, so be sure to attend and bring a business card!

Slides: dotNetDave's Favorite Programming Tools.pdf (1.8 MB)

Building Rich & Interactive Web Applications with ASP.NET AJAX

11:30AM Saturday - Room: MH 121

Learn how to build rich web application interfaces using ASP.NET AJAX and the ASP.NET AJAX Control Toolkit. This new technology makes programming JavaScript into your ASP.NET pages easy, increasing the power and functionality of your applications, reducing round trips to the server, and making it easy to consume web services for dynamic content. In this session you will be introduced to the new client and server controls for ASP.NET and Java Script to learn how to build a rich Web 2.0 experience for your users.

Slides: Building Rich & Interactive Web Applications with ASP.NET AJAX - 2009.pdf (2.36 MB)
Demo Code: Building Rich & Interactive Web Applications with ASP.NET AJAX - 20091.zip (702.2 KB) UPDATED!

Why You Need .NET Coding Standards (2009)

2:30PM Saturday - Room: UH 250

This session will guide any level of programmer to greater productivity by providing the information needed to write consistent, maintainable code. Learn about project setup, assembly layout, code style, defensive programming and much, much more. We will even go over some real in production code and see what the programmer did wrong in "What's Wrong With this Code?". Code tips are included to help you write better, error free applications. Lots of code examples in C# and VB.NET.

Slides: Why You Need .NET Coding Standards-2009.pdf (3.46 MB)
Demo Code: Why You Need .NET Coding Standards-2009.zip (94.46 KB)


Pictures and Video

SoCal CodeCamp Fullerton - 2009

Pictures from This Years Code Camp:

Pictures from past SoCal Code Camps:

Video from past Code Camps:


 
December 1, 2008
@ 11:42 AM

If you live in the San Diego area, dotNetDave (a.k.a. David McCarter) will be teaching a 6 week Building Rich & Interactive Web Applications with ASP.NET AJAX course at the University of California, San Diego Extension beginning on Thursday 1/7/2009 from 5:30pm to 10pm. For more information and to enroll, please click here.


 
Categories: AJAX | ASP.NET | dotNetDave

November 19, 2008
@ 12:05 PM
The Visual Round Trip Analyzer tool helps web developers and testers visualize the download of their page, identify best practices and changes that improve web performance. The network Round-Trip between the client and server(s) is the single biggest impact to web page performance – much greater than server response time. VRTA examines the communications protocol, identifying the causes of excessive round-trips, and recommending solutions. Performance engineers, testers, developers, operations personnel should use VRTA to conduct their web performance analysis.
 

 
Categories: ASP.NET | News

If you are going to attend tonights meeting of the ASP.NET user Group SIG, below is the presentation download. I hope to see everyone at the meeting!

Building Rich & Interactive Web Applications with ASP.NET AJAX Part 2 - 2008.pdf (877.42 KB)
 
Categories: AJAX | ASP.NET | dotNetDave | JavaScript

September 8, 2008
@ 09:29 AM
Finally... Microsoft has released chart controls for .NET (only 8 years late). They include controls for Win and Web forms. To download go here:

http://www.microsoft.com/downloads/details.aspx?FamilyID=130f7986-bf49-4fe5-9ca8-910ae6ea442c&DisplayLang=en


 
Categories: ASP.NET | Link | WinForms

If you are coming to the San Diego .NET Developers Group meeting tonight I hope you will be their early for my talk titled "What’s New In VS 2008 SP1". Lots of new additions to this SP, not just bug fixes. Below is a link to the presentation.

VS2008Sp1.pdf (715.88 KB)
 
Categories: .NET | ADO.NET | AJAX | ASP.NET | Csharp | dotNetDave | Entity Framework | LINQ | MVC | Silverlight | VB.NET | VS.NET | WCF | WinForms | WPF

September 1, 2008
@ 11:47 AM

I hope everyone in California is planning to attend this years Central Coast Code Camp up in San Luis Obispo on 9/27 - 6/28. It's always a great time and lots of free training! I will also be selling a limited number of my latest book "David McCarter's .NET Coding Standards" at my sessions for $11, cheaper than the web site (no tax and shipping), please bring exact change.

I will be presenting the following sessions and I hope you will attend.

dotNetDave's .NET Utility Assembly (My First CodePlex Project)

 dotNetDaves .NET Utility Assembly.pdf (704.86 KB)

CodePlex site: http://www.codeplex.com/dotNetTips

Building Rich & Interactive Web Applications with ASP.NET AJAX Part 1

zip_icon.gif Building Rich & Interactive Web Applications with ASP.NET AJAX Part 1 - 20081.zip (1.05 MB)

Building Rich & Interactive Web Applications with ASP.NET AJAX Part 2 

zip_icon.gif Building Rich & Interactive Web Applications with ASP.NET AJAX Part 2 - 200812.zip (1.49 MB)

Why You Need .NET Coding Standards (2008)

Why You Need .NET Coding Standards-2008.pdf (941.06 KB)

Photos

Pictures: http://www.flickr.com/photos/davidmccarter/tags/centralcoastcodecamp/

Blog Post about 2007 Code Camp: http://blog.davidmccarter.net/2007/09/23/ThingsIveLearnedThisWeek.aspx


 
Categories: .NET | AJAX | ASP.NET | C# | Code Camp | Defensive Programming | Development | dotNetDave | VB.NET

Here is some easy, generic code to serialize your objects to and from JSON:

Public Shared Function JsonEncode(ByVal input As Object) As String
  Dim serilizer = New DataContractJsonSerializer(input.GetType)
  Using ms = New MemoryStream()
    serilizer.WriteObject(ms, input)
    Return Encoding.Default.GetString(ms.ToArray())
  End Using
End Function
Public Shared Function JsonDecode(Of T)(ByVal input As String) As T
  Using ms = New MemoryStream(Encoding.Unicode.GetBytes(input))
    Dim serilizer = New DataContractJsonSerializer(GetType(T))
    Return DirectCast(serilizer.ReadObject(ms), T)
  End Using
End Function
public static string JsonEncode(object input)
{
var serilizer = new DataContractJsonSerializer(input.GetType());
  using (var ms = new MemoryStream())
{
serilizer.WriteObject(ms, input);
    return Encoding.Default.GetString(ms.ToArray());
}
}
public static T JsonDecode<T>(string input)
{
using (var ms = new MemoryStream(Encoding.Unicode.GetBytes(input)))
{
var serilizer = new DataContractJsonSerializer(typeof(T));
    return (T)serilizer.ReadObject(ms);
}
}

Tip Submitted By: David McCarter


 
Categories: ASP.NET | C# | JavaScript | VB.NET | Web Services | Generics

June 30, 2008
@ 02:33 PM

I recently started a new job that uses C#. I have been trying for two frickin hours to get Trace Listeners working in an application here with no luck at all. So to test that I have the web.config setup correctly, I added the following:

var log = new Microsoft.VisualBasic.Logging.Log();
log.WriteEntry("VB Log");

Bam, it works! Dang I LOVE VB.NET! Now I'm going to go ask my boss if I can use the VisualBasic.Logging class in our C# application ;-)

David McCarter


 
Categories: ASP.NET | VB.NET

If you live in the San Diego area, dotNetDave (a.k.a. David McCarter) will be teaching a 6 week Building Rich & Interactive Web Applications with ASP.NET AJAX course at the University of California, San Diego Extension beginning on Thursday 7/17/2008 from 5:30pm to 10:00pm. For more information and to enroll, please click here.


 
Categories: AJAX | ASP.NET | dotNetDave

June 1, 2008
@ 08:55 AM
Code

I hope everyone in southern California is planning to attend this years SoCal Code Camp up at University California San Diego on 6/28 - 6/29. It's always a great time and lots of free training! I will also be selling a limited number of my latest book "David McCarter's .NET Coding Standards" at my sessions for $11, cheaper than the web site (no tax and shipping), please bring exact change.

I will be presenting the following sessions and I hope you will attend.

dotNetDave's .NET Utility Assembly (My First CodePlex Project)

10:15 AM - Sunday, June 29, 2008 - Location: 141

zip_icon.gif dotNetDaves .NET Utility Assembly1.zip (1.11 MB)

CodePlex site: http://www.codeplex.com/dotNetTipsUtility

Building Rich & Interactive Web Applications with ASP.NET AJAX Part 1

8:45 AM - Saturday, June 28, 2008 - Location: 129

zip_icon.gif Building Rich & Interactive Web Applications with ASP.NET AJAX.zip (1.83 MB)

Building Rich & Interactive Web Applications with ASP.NET AJAX Part 2 

12:15 PM - Saturday, June 28, 2008 - Location: 129

zip_icon.gif Building Rich & Interactive Web Applications with ASP.NET AJAX Part 2 - 20081.zip (1.82 MB)

Why You Need .NET Coding Standards (2008)

1:45 PM - Sunday, June 29, 2008 - Location: 127

zip_icon.gif Why You Need .NET Coding Standards-20081.zip (2.86 MB)

Pictures and Video

Fullerton Code Camp - JAN 2008

Pictures from This Years Code Camp:

Pictures from past SoCal Code Camps:

Video from past Code Camps:

 


 
Categories: .NET | AJAX | ASP.NET | Code Camp | Csharp | Defensive Programming | Development | dotNetDave | News | VB.NET

As you might find out the hard way, the .NET redistributable does not include the files required for the Reporting Services ReportViewer control. This is an issue for web servers when deploying ASP.NET applications that use this control. You can download the redistributable files below:


 
Categories: ASP.NET | Link

I built a page that uses the ASP.NET AJAX UpdatePanel and within it I placed a GridView control that connects to a DataSet (that uses TableAdapers to a SQL Server 2005 database back end) using a DataSource control. I do not use paging in the GridView so that the user can print all of the items in the grid. I noticed that when there are a lot of items in the grid, about 25 or more, the load of the UpdatePanel became very slow. I figured it was my virtual machine, but this even happened on our production server and users even commented on it.

I did the normal things like checked the queries and even looked at the page tracing to determine what controls might be causing the issue. I could not find where the slowdown was coming from. Then, just to try it, I moved the DataSource control for the GridView out of the UpdatePanel. Low and behold the update sped up around 300% - 400%!

My only guess is when the DataSource control was being recreated every time the UpdatePanel was loaded and this just takes time. So now as part of my common practice, I put all DataSource controls at the bottom of the page. It would be nice if the designer did this automatically.

Tip Submitted By: David McCarter


 
Categories: AJAX | ASP.NET

May 12, 2008
@ 12:59 PM

This project gives you access to the code for upcoming releases that the Microsoft ASP.NET team is working on. The project gives you a look at the design and lets you have a voice in it.

http://codeplex.com/aspnet


 
Categories: ASP.NET | Link

March 10, 2008
@ 08:38 AM

The ASP.NET 3.5 Extensions Preview is a preview of new features being added to ASP.NET 3.5 and ADO.NET.

http://www.microsoft.com/downloads/details.aspx?FamilyID=A9C6BC06-B894-4B11-8300-35BD2F8FC908&displaylang=en


 
Categories: ADO.NET | AJAX | ASP.NET | Link

I found out the hard way in the last two days that an SQL Server CE database does not work properly when creating a typed Dataset with a ASP.NET 3.5 application. Sure, you can create one in the IDE, but the code-on-the-fly will not be generated therefor you can't use it in your code. Actually causes an error if you try to build.

Rec'd an confirmation from Microsoft today that they did not implement this for ASP.NET. Just wanted to warn you so you don't waste an hour plus like I did. If you still want to use SQL Server CE and typed DataSets in ASP.NET you will need to create a separate assembly (which should be done anyway). Oh, won't work with LINQ either.


 
Categories: ADO.NET | ASP.NET | Compact Framework | SQL Server | LINQ

I needed to update a program and when I brought it up in VS 2008, it changed the version of Crystal Reports to 10.5.3700. This presented a challenge to get the required Crystal files onto the production server. Of course using the VS web publish feature does not do this even though I wish it did. So I went to the Business Objects site (makers of Crystal Reports) to search for an install. I first download the version for 2008... made sense to me, but it actually turned out to be version 12.

Then I tried the download for CrystalReports 2008 ClickOnce Package for Visual Studio 2005 since it said it was version 10. Unfortuneatly it did not say what minor version it was. This turned into a headache because it kept asking me for a product ID before the install would continue. I followed the instructions and got the number from VS 2008 and that did not work. Even spend time registering Crystal with Business Objects and that did not work either. I tried to create a support case on their web site and that was not even working!

After many hours of frustration, I did a search of my hard drive of ANY file that started with "Crystal" and I finally found it! The installs are located in this directory:

C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\CrystalReports10_5

The files are either CRRedist2008_x86.msi or CRRedist2008_x64.msi. I installed them on the server and everything worked fine.

I hope this might save you from all the the wasted time I went through. Another reason why I love Microsoft Reporting Services!!!

Tip Submitted By: David McCarter


 
Categories: ASP.NET | Reporting

January 18, 2008
@ 08:25 PM

I hope everyone in southern California is planning to attend this years SoCal Code Camp up at Cal State Fullerton on 1/26 -1/27. It's always a great time and lots of free training! My fav southern California band Killola will be playing again at the Geek dinner so make sure you arrive early on Saturday to grab one of the limited number of tickets available.

167020688v3_240x240_Front_Color-Black.jpg

I will be doing the following sessions and I hope you will attend.

dotNetDave's .NET Utility Assembly (My First CodePlex Project)

zip_icon.gif dotNetDaves .NET Utility Assembly.zip (614.15 KB)

Building Rich & Interactive Web Applications with ASP.NET AJAX Part 1

zip_icon.gif Building Rich & Interactive Web Applications with ASP.NET AJAX Part 1 - 2008.zip (1.39 MB)

Building Rich & Interactive Web Applications with ASP.NET AJAX Part 2 

zip_icon.gif Building Rich & Interactive Web Applications with ASP.NET AJAX Part 2 - 2008.zip (1.11 MB)

Why You Need .NET Coding Standards (2008)

zip_icon.gif Why You Need .NET Coding Standards-2008.zip (1.71 MB)

Pictures and Video

Fullerton Code Camp - JAN 2008

Pictures from This Years Code Camp:

Pictures from past SoCal Code Camps:

Video from past Code Camps:

 

 


 
Categories: .NET | AJAX | ASP.NET | Code Camp | Csharp | Development | dotNetDave | JavaScript | News | VB.NET

dotdetdave-head-50.jpgIf you live in the San Diego area, dotNetDave (a.k.a. David McCarter) will be teaching a 6 week Building Rich & Interactive Web Applications with ASP.NET AJAX course at the University of California, San Diego Extension beginning on Thursday 2/21/2008 from 5:30pm to 10:00pm. For more information and to enroll, please click here.


 
Categories: .NET | AJAX | ASP.NET | Csharp | dotNetDave | JavaScript | VB.NET

When data binding to a DropDownList control in ASP.NET, there are in many cases when you want the first selection of the control to be blank or say something like "<please select value>". In part one of this tip (back in 2003), I wrote that you could just add an empty row to the DataSet. In VS 2005 and the new way of data binding that I usually do to web services, this is more difficult. So here is another solution just using code in your ASP.NET code.

 Protected Sub DropDownList_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyControl1.DataBound, MyControl2.DataBound
      DirectCast(sender, DropDownList).Items.Insert(0, String.Empty)
 End Sub

The Insert method must be called after the DropDownList has been data bound.

Tip Submitted By: David McCarter


 
Categories: ASP.NET | VB.NET

September 18, 2007
@ 02:35 PM

Below is some code to create a Gmail like UpdateProgress control. Displays a red box with white text in the upper right side of the browser.

<div style="font-weight: bold; left: 90%; color: white; font-family: Arial; position: absolute;
   top: 2px; background-color: red; border-top-width: thin; border-left-width: thin;
   border-left-color: black; border-bottom-width: thin; border-bottom-color: black;
   border-top-color: black; border-right-width: thin; border-right-color: black;">
   <asp:UpdateProgress ID="UpdateProgress1" DisplayAfter="200" runat="server">
      <ProgressTemplate>
         Updating...</ProgressTemplate>
   </asp:UpdateProgress>
</div>

Tip Submitted By: David McCarter


 
Categories: AJAX | ASP.NET

August 27, 2007
@ 01:47 PM

This site has been designed by the SQL Server Data Mining team to provide the SQL Server community with access to and information about our exciting data mining features.

http://www.sqlserverdatamining.com/


 
Categories: ASP.NET | dotNetDave | Link

August 20, 2007
@ 10:57 AM

Want to see what your site or others looked like in the past? Check out the Wayback Machine at: http://www.archive.org/


 
Categories: ASP.NET | dotNetDave | Link

January 1, 2007
@ 03:33 PM

Here is a pretty cool web site that will monitor your web sites for free!

http://www.montastic.com/


 
Categories: ASP.NET | dotNetDave | Link

July 19, 2005
@ 12:03 AM

Web page to easily create a machine key for encryption:

http://www.eggheadcafe.com/articles/GenerateMachineKey/GenerateMachineKey.aspx


 
Categories: .NET | ASP.NET | Development | Security

A common problem for administrators of IIS servers is configuring and troubleshooting SSL enabled websites. To assist in administrators efforts, Microsoft has designed a tool - SSL Diagnostics - to aid in quickly identifying configuration problems in the IIS metabase, certificates, or certificate stores.

This tool allows users to review configuration information in a easy to read view mode or to run the tool silently with only the creation of a log file. During use, administrators can simulate the SSL handshake to find errors. They can also quickly "hot swap" certificates for testing purposes.

These packages come in two forms: Express and Full. The express will only give the pertinent tools for administrators to use SSL Diagnostics while full install installs the same files with the appropriate documentation. Included in the full install is a SSL Frequently Asked Questions that can assist in the learning of SSL for administrators.

Click here to download.


 
Categories: ASP.NET

Authentication and Access Control Diagnostics 1.0 (more commonly known as AuthDiag) is a tool released by Microsoft aimed at aiding IT professionals and developers at more effectively finding the source of authentication and authorization failures.

These users have often seen behavior from Internet Information Services (IIS) that doesn't seem appropriate or random when users authenticate to the IIS server. The complex world of authentication types and the various levels of security permissions necessary to allow a user to access the server causes many hours of labor for those tasked with troubleshooting these problems.

AuthDiag 1.0 offers a robust tool that offers a efficient method for troubleshooting authentication on IIS 5.x and 6.0. It will analyze metabase configuration and system-wide policies and warn users of possible points of failure and guide them to resolving the problem. AuthDiag 1.0 also includes a robust monitoring tool called AuthMon designed at capturing a snapshot of the problem while it occurs in real-time. AuthMon is robust and specially designed for IIS servers removing any information not pertinent to the authentication or authorization process.

Click here to download.


 
Categories: ASP.NET

The IIS Diagnostics Toolkit is a combined release of popular tools used by today's IIS users. These tools include tools aimed at resolving problems related to Secure Socket Layer (SSL) issues, permission or security problems, gathering data for your SMTP server included with IIS, as well as the famous Log Parser utility used to sift through hundreds or thousands of log files very quickly.

The toolkit consolidates all the tools into a convienant download and is supplemented by updates every 90-days to ensure that users have the most current diagnostics tools at their fingertips.

Click here to download.


 
Categories: ASP.NET

January 1, 2005
@ 11:26 AM
HTML Codes
Again, nothing to do with ASCII really, but has been requested by a number of you out there. To get special characters to show on an HTML web page, special codes can be used (ascii code or word) and are interpretted by the web browser.


 
Categories: ASP.NET

Microsoft is currently investigating a reported vulnerability affecting ASP.NET that could allow an attacker to send a specially-formed URL request that could result in the system bypassing authentication and disclosing content.

Microsoft is working on a security update for this reported vulnerability. To aid customers in protecting their ASP.NET applications, an HTTP module has been developed that implements canonicalization best practices. By applying this module to your web server, all ASP.NET applications on the server are protected against canonicalization problems known to Microsoft as of the publication date.

To download go to: http://www.microsoft.com/downloads/details.aspx?FamilyID=da77b852-dfa0-4631-aaf9-8bcc6c743026&DisplayLang=en


 
Categories: ASP.NET

Microsoft is currently investigating a reported vulnerability in Microsoft ASP.NET. An attacker can send specially crafted requests to the server and view secured content without providing the proper credentials. This reported vulnerability exists in ASP.NET and does not affect ASP.

This issue affects Web content owners who are running any version of ASP.NET on Microsoft Windows 2000, Windows 2000 Server, Windows XP Professional, and Windows Server 2003.

The underlying issue is that ASP.NET is failing to perform proper canonicalization of some URLs. Microsoft Knowledge Base (KB) article 887459, "Programmatically Checking for Canonicalization Issues with ASP.NET," describes how to add additional safeguards to an ASP.NET application to help protect against common canonicalization issues, such as those related to this reported vulnerability.

The ASP.NET Team has confirmed that all versions of ASP.NET on all operating systems may be susceptible to this potential exploit. They strongly recommend you apply the following code to the Global.asax for each of your applications.

Global.asax code sample (Visual Basic .NET)

Sub Application_BeginRequest(Sender as Object, E as EventArgs)
    If (Request.Path.IndexOf(chr(92)) >= 0 OR _
        System.IO.Path.GetFullPath(Request.PhysicalPath) <> Request.PhysicalPath) then
        Throw New HttpException(404, "Not Found")
    End If
End Sub

Global.asax code sample (C#)

void Application_BeginRequest(object source, EventArgs e) {
    if (Request.Path.IndexOf('\\') >= 0 ||
        System.IO.Path.GetFullPath(Request.PhysicalPath) != Request.PhysicalPath) {
        throw new HttpException(404, "not found");
    }
}

The ASP.NET team is continuing to work on this problem and will post more information once it becomes available to http://www.microsoft.com/security/incident/aspnet.mspx.

Resources

http://www.microsoft.com/security/incident/aspnet.mspx

http://support.microsoft.com/?kbid=887459


 
Categories: ASP.NET

Is homepage layout effective? ... What effect do blurbs on the homepage have compared to headlines? ... When is multimedia appropriate? ... Are ads placed where they will be seen by the audience? Find out: http://www.poynterextra.org/eyetrack2004/main.htm


 
Categories: ASP.NET | Link | News

The service was initially built with Java, but CafePress.com came to realize that developing on that platform was slow, problematic, and was otherwise preventing them from moving their business forward. CafePress.com is now using the Microsoft .NET Framework and has seen a vast improvement in their ability to develop new features and solutions. The ability to quickly bring new ideas to market is resulting in increased sales.

Company Overview

CafePress.com offers an outsourced e-commerce solution that allows individuals, groups, and companies to sell a wide variety of merchandise without the typical hassles and overhead of doing business online. The company manages every aspect of doing business online, including e-commerce services, product manufacturing and sourcing, fulfillment, and customer service. In just minutes, anyone can set up a store selling imprinted merchandise, such as T-shirts, mugs, and more, with no setup fees and no inventory investment.

The service was originally built using Java. In time, the company came to realize that they were spending too much time patching components together and maintaining their development framework, and not enough time developing new features and solutions.

"We were running into serious compatibility problems with the previous solution," says Fred Durham, Chief Executive Officer, CafePress.com. "After an upgrade from the vendor, the issues still existed so we decided we could not wait any longer for the vendor to fix things and needed to find a new framework to develop around. Previously we had been using a combination of Java tools, runtimes, beans, and libraries. It became clear to us that a single framework would be far more productive. We wanted to get out of the cycle of maintenance and constant patching, and into new application development again."

Solution

"Along with the .NET Framework, we examined BEA WebLogic and Orion. The .NET Framework proved to have everything we wanted—the richest library, and the best price point," says Durham. "We were able to do a 100 percent conversion of all our systems in less than four months from initial testing to complete rollout. For a time during the transition, we had Java and the .NET Framework running side by side without problems on our live Web servers."

The company is now using the application server features of the Microsoft .NET Framework, including Microsoft ASP.NET to build their solutions. "A user simply uploads images and CafePress.com's servers superimpose those images onto product shots of items like T-shirts and mugs," explains Durham. "The user's store is then filled with products for sale without having to produce any actual merchandise in advance. Customers purchase items though the user's Web site and on the back end CafePress.com processes the payments." CafePress.com also has a manufacturing facility that accesses a private Web site where work orders, images, and product specifications are automatically accessed as needed to manufacture and deliver the products.

CafePress.com now uses the .NET Framework exclusively for every part of this service—utilizing ASP.NET pages, custom ASP.NET controls, and .NET-based console applications for various administrative tasks.

Benefits

Making the switch to the .NET Framework was easy and quick, and has resulted in significant advantages for CafePress.com. The most significant benefit involves development time. For CafePress.com, turning new ideas into features and services in a timely fashion is critical. Developing with the .NET Framework is allowing CafePress.com to quickly produce and add new features to their service, and to produce customized solutions to meet the needs of larger customers.

The advantages go beyond the improved developing capabilities of the .NET Framework: The CafePress.com Web site has realized impressive performance increases.

Faster Development

"We are a start-up in the classic Silicon Valley model—moving fast and bringing things to market at the bleeding edge," says Durham. "We evaluate products based on their ability to advance our business." For CafePress.com, the ability to quickly add features to their service and to develop new service for larger customers is critical to their success. The .NET Framework allows the company to move quickly in the increasingly competitive Internet industry.

"Since moving to the .NET Framework, our development speed has increased dramatically," says Durham. "Project cycle times have been reduced to approximately one-quarter of the previous development cycle times. That means more features and services for our users. With the .NET Framework, we can much more easily develop custom code for larger clients. It also means we offer more services and features at large. Again, this is because development times are compressed and the lines of code needed have dropped significantly."

An Efficient Platform

The reason that CafePress.com is realizing improved development times is because the .NET Framework provides a single development platform and eliminates the integration and maintenance issues that plagued the company when they were working with Java.

"Our development environment was messy," says Durham. "We had been using Borland Jbuilder for Java Code and HomeSite for HTML. We could never find a useful Java-based imaging library, so we were forced to use an OCX control. To use that we also had to use a COM-to-Java component from yet another vendor, with routine compatibility problems. The JDBC driver was ineffective and crashed periodically. Java is supposed to have everything, but it doesn't. We had to cobble together a lot of stuff from different vendors. We found developing in this environment to be highly inefficient. We were spending far too much time patching and maintaining our development process, when we should have been spending that time bringing new features and services to market."

The Microsoft .NET Framework Software Development Kit (SDK) contains a wealth of resources—including DLLs, tools, compilers, and samples—that enable developers to build efficient, powerful, and scalable Web-based applications and services. It provides companies like CafePress.com with a single framework for developing new applications.

"In the end, what really solidified our decision to adopt the .NET Framework was the incredibly rich class library that handled all the application plumbing you could ever think of," says Durham. The .NET Framework class library is a comprehensive, object-oriented collection of reusable classes that can be used to develop applications ranging from traditional command-line or graphical user interface (GUI) applications to applications based on the latest innovations provided by ASP.NET and XML Web services. "The class library saves us time. Our applications don't have to be built from the ground up anymore. It reduces the amount of code we have to produce and test."

One project that CafePress.com was able to undertake because of the improved development environment of the .NET Framework is called "Strip of the Day." One of CafePress.com's partners is Dilbert.com—the online home of the popular Dilbert comic strip. What CafePress.com had envisioned was a feature that would allow people to order any comic strip printed on a variety of merchandise. Previously, only select strips from the past were available. Every Dilbert comic strip is now available on CafePress.com's array of merchandise, including today's strip.

"We had wanted to do this with Dilbert.com for a long time," says Durham. "When we were on the Java platform, we always knew that developing this feature would be troublesome and would take too long. Simply put, we never got around to it because we knew what we were in for. With the .NET Framework, we developed this feature in just one week. Since implementing this feature, sales have increased dramatically—perhaps a four or five times increase in sales. More projects like this are in the works. Previously, these projects would not have even made it to our development list."

Improving Web Site Performance

Moving to the .NET Framework has not only benefited the company because of the improved development environment, it has also resulted in improved Web site performance. Web traffic is significant for CafePress.com, a Webby Award recipient. Monthly traffic for CafePress.com runs at about 50 million hits. "The performance increase after moving to the .NET Framework was unbelievable," says Durham. "The machines used to run at about 50- to 70-percent utilization and now run at about 2- to 3-percent. I have never heard of such an increase in performance."

"We're supporting about 5,000 concurrent sessions, and 10-20 pages per second with imaging, plus lots of dynamic database page views," says Durham. "We had five dual processor machines that have now been converted to one machine. There's no way we could have done that with Java."

"We handle about 1 million unique visitors a month on a single server that refuses to go above 200-megabytes of ram usage even though it has 1 gig installed, and never goes above 3 percent CPU utilization. We sustain a 5 megabit per second average throughput. Where's the top end? I have no idea."

VSDN Tips & Tricks CafePress.com store 

Posted: November 11, 2001

Original Article: http://www.microsoft.com/resources/casestudies/CaseStudy.asp?CaseStudyID=11721


 
Categories: ASP.NET | News

Microsoft® Windows® Server 2003 and IIS 6.0 provide the services to support a secure, available, and scalable Web server on which to run your Web sites and applications. Whether you manage a single Web server or many, Internet Information Services (IIS) 6.0 Resource Kit will help you effectively plan, deploy, operate, and troubleshoot your IIS 6.0 solution. This comprehensive technical resource delivers an in-depth description of the new IIS 6.0 architecture, as well as reference information about IIS 6.0 features and services. It also includes practical information and tools to help you accomplish everyday administrative tasks.

Deployment scenarios in part one of this book include installing a new Web server, upgrading an existing Web server from an earlier version of IIS, and migrating existing Apache or IIS Web sites and applications to a newly installed Web server. Part two of this book includes information about running IIS 6.0 as a platform for Web applications, managing a secure IIS 6.0 solution, administering servers programmatically, and capitalizing on built-in scalability features to manage large-scale deployments. In addition, part two includes a thorough discussion of IIS 6.0 troubleshooting concepts, tools, and procedures.

http://www.microsoft.com/downloads/details.aspx?familyid=80a1b6e6-829e-49b7-8c02-333d9c148e69&displaylang=en


 
Categories: ASP.NET | News

It uses a fast-paced approach and Murach’s “paired pages” format to teach how to develop business applications for the web.
After an overview of ASP.NET in chapter 1, chapters 2 through 5 show how to use Visual Studio .NET and its time-saving tools to design, code, and test multi-page web applications that manage state, use cookies, and retrieve database data. Along the way, developers see how the use of code-behind files and business classes can speed up and simplify development. They also see the value of view state, a productivity feature unique to ASP.NET that saves a lot of coding.
The rest of the book covers a full range of professional ASP.NET skills. That includes:

  • The use of all types of Web Server, validation, user, and custom server controls
  • ADO.NET skills for sophisticated database handling
  • The creation and use of Web Services
  • Report generation with Crystal Reports
  • How to secure an application
  • How to send email
  • How to deploy finished applications

All the content is formatted in Murach’s distinctive “paired pages” style. Each two-page spread presents a single topic. The lefthand page explains the topic while the righthand page shows the critical details, using syntax, code, screen shots, and how-to notes.
To illustrate each new feature, Murach’s ASP.NET uses complete applications that implement an e-commerce site selling Halloween products. As a result, developers see how the features interact in typical business apps and learn how to handle the coding complexities they’ll face on the job.
Murach’s ASP.NET Web Programming with VB.NET is available directly from the publisher at www.murach.com and from online and brick-and-mortar bookstores.


 
Categories: ASP.NET

February 27, 2004
@ 10:24 PM

Follow the instructions in the following Microsoft article and it should do the job.


HOW TO: Enable Extensions Used by Visual Studio .NET in IIS 6.0

The information in this article applies to:
Microsoft Internet Information Services version 6.0
Microsoft Visual Studio .NET (2002), Enterprise Architect Edition
Microsoft Visual Studio .NET (2002), Enterprise Developer Edition
Microsoft Visual Studio .NET (2002), Professional Edition
Microsoft Visual Studio .NET (2002), Academic Edition

 

This article was previously published under Q329473

SUMMARY

If you install Microsoft Visual Studio .NET with Internet Information Services (IIS) 6.0 to host Web applications or XML Web services, you must also enable Active Server Pages (ASP) and FrontPage Server Extensions (FPSE). ASP and FPSE are installed with IIS. By default, ASP and FPSE are disabled, and you must enable them by using IIS Manager, the IIS administration tool.

If you install Visual Studio .NET 2002, you must also map an application extension for .tmp files.

Note You do not have to map an application extension for .tmp files when you install Visual Studio .NET 2003.

Enable the Correct Web Service Extensions in IIS 6.0

After you install Visual Studio .NET, follow these steps to enable the Web service extensions:

  1. Click Start, click Administrative Tools, and then click Internet Information Services (IIS) Manager. IIS Manager opens.
  2. Expand the computer name, and then click Web Service Extensions. The Web Service Extensions window appears on the right side of IIS Manager.
  3. Under Tasks, click Add a new Web service extension. The New Web Service Extension dialog box appears.
  4. For Extension name, select ASP.NET v1.0.3705.
  5. Add the Aspnet_isapi.dll file to the list of required files. To do this, click Add, click Browse, click the v1.0.3705 version of Aspnet_isapi.dll (found in C:\Windows\Microsoft.NET\Framework\v1.0.3705), and then click Open. Click OK.
  6. Click to select the Set extension status to Allowed check box, and then click OK.
  7. Click OK.

Map .tmp Files

  1. Click Start, click Administrative Tools, and then click Internet Information Services (IIS) Manager.
  2. Right-click your Web site, click Properties, and click HTTP Headers.
  3. Click MIME Types, and then click New.
  4. For Extension, type .tmp.
  5. For MIME type, type text/plain.

Important You must repeat these steps for any Web site where Web projects will be created with Visual Studio .NET 2002.

 

Another Cause

Another cause might be that ASP.NET mappings are not correct. If so, try this:

  • Run the Aspnet_regiis.exe utility: Click Start, and then click Run.
  • In the Open text box, type cmd, and then press ENTER.
  • At the command prompt, type the following, and then press ENTER: "%windir%\Microsoft.NET\Framework\version\aspnet_regiis.exe" -i
    In this path, version represents the version number of the .NET Framework that you installed on your server. You must replace this placeholder with the actual version number when you type the command.

If you reinstalled IIS, you must also do this:

  • Register the Aspnet_isapi.dll: Click Start, and then click Run.
  • In the Open text box, type the following, and then press ENTER: regsvr32 %windir%\Microsoft.NET\Framework\version\aspnet_isapi.dll
    Regsvr32 returns the results of the registration.

 
Categories: ASP.NET

February 20, 2004
@ 10:16 PM

The kit contains step-by-step instructions for getting started with ASP.NET, free controls from third party vendors, access to great ASP.NET hosting deals and more.

http://www.microsoft.com/downloads/details.aspx?familyid=aef6aa76-ab88-4264-87b4-8e946ef584d7&displaylang=en


 
Categories: ASP.NET

The Microsoft® .NET Framework version 1.1 includes ASP.NET Mobile Controls that enable developers to easily create mobile Web applications. Developers can write and maintain a single application that targets multiple devices. The mobile controls deliver markup language specifically adapted for each browser that accesses the application. ASP.NET Mobile Controls originally shipped in the Microsoft Mobile Internet Toolkit.

 

http://www.microsoft.com/downloads/details.aspx?FamilyID=02fa15fe-40d9-4dce-9bb1-4dd61a5b7ccb&DisplayLang=en


 
Categories: ASP.NET

<asp:CompareValidator CssClass="NormalTextBox" id="cmvEndDate" runat="server" ErrorMessage="Please enter a valid date!" ControlToValidate="txtEndDate" Operator="GreaterThan" Type="Date" ValueToCompare="01/01/2000" Display="Dynamic" />

 
Categories: ASP.NET

August 22, 2003
@ 12:57 AM
These controls aren't supported anymore, but still are useful. You can download them my going to: http://msdn.microsoft.com/downloads/samples/internet/asp_dot_net_servercontrols/webcontrols/Default.asp
 
Categories: ASP.NET | Link

So I created the nifty little Function below:

Private Function GetWebFormValue(ByRef WebForm As System.Collections.Specialized.NameValueCollection, _
                                   ByVal ControlName As String) As String
  Try
    Return WebForm(ControlName).ToString
  Catch
    Return String.Empty
  End Try
End Function


Here is how to use it:

pstrTemp = GetWebFormValue(Request.Form, "txtZipCode")

If you have an easier, better way to do this same thing, please let me know. Best of all, this will not cause an exception!!! 

Tip Submitted By: David McCarter


 
Categories: ASP.NET | VB.NET