Tips & Tricks for Visual Studio 2008

3. May 2010

MAP Design & Development

28. April 2010

Re-enrolled as Microsoft Registered Partner today.

Interesting new Microsoft Action Pack that I am going to order: MAP Design & Development.  Includes SQL Server, VS 2010, and MSDN.  With 15% off coupon they offer price is $365.

Available week of May 24, 2010.

Good deal!

 

 

ASP.NET , ,

Validating an asp:DropDownList selection has been made

20. March 2010

A tip for validating an item on a drop down list has been selected. 

The following shows a drop down list for selecting gender.  The initial setting is to '----'.  In order to validate that the gender has been selected, use the asp:RequiredFieldValidator and set the InitialValue = '----'. 

I tried using an asp:RegularExpressionValidator first, but had problems when there was a space in the value... 

 <asp:DropDownList ID="drpGender" width="100px" runat="server">

 <asp:ListItem Selected="True" Text="----" Value="----" />

<asp:ListItem Text="Female" Value="F" />

<asp:ListItem Text="Male" Value="M" />

</asp:DropDownList>

<asp:RequiredFieldValidator ID="rfvGender" runat="server" ErrorMessage="This field is required" ControlToValidate="drpGender" InitialValue="----"></asp:RequiredFieldValidator >

 

ASP.NET

Stylesheets for Content pages

2. March 2010

Did research on this, quickest way to implement a separate stylesheet for content page is to add an extra content placeholder in the head section of the master page. Then for each content page can set a link to the stylesheet. Note that the head section of the master page must be set to runat server. So master page has the following head section:

<head runat="server">
    <title>Master Page</title>
    <asp:ContentPlaceHolder runat="server" ID="cphHeadSection">
</asp:ContentPlaceHolder>   
</head>

Add the following to your content page:

<asp:Content ID="ContentHead" ContentPlaceHolderID="cphHeadSection" runat="server">
    <link href="ContentStyles.css" rel="Stylesheet" type="text/css" />    
</asp:Content>

ASP.NET , ,

User Control

28. February 2010

This is an implementation of a generic contest entry user control using the BlogEngine.NET format.  Validation is done on the client and once validated, the data is encrypted and then entered into SQL Server.  (Go ahead and try it out - don't worry any data entered will be deleted).  I also added a captcha to prevent programs from entering contests.

Enter the Sweepstakes below for your chance to WIN!
Must be 18 to enter
Contest Runs Between 8/6/2010 and 10/5/2010
Gender 
First Name  
Last Name  
Address 1 
Address 2
City  
State 
Zipcode  
Year of Birth  
Home Phone  
Email  
Enter Text     
No purchase necessary to enter or win. See the Official Rules for eligibility requirements and complete details.
 

 

BlogEngine.NET , , , ,