Archive

Archive for the ‘ASP.NET’ Category

New ASP.NET Intro Videos Posted

April 12, 2009 Rhonda 1 comment

The ASP.NET web site has added a new ASP.NET with Visual Web Developer video series to their video tutorials page. The presenter for each video is Joe Stagner.  With the exception of the first one, the videos pretty much range from 8-23 minutes, which is great for a hurried schedule. 

Building Web Applications with ASP.NET 3.5 and Microsoft Visual Web Developer 2008

Looks like the start of a great series.  I highly recommend checking it out.

Debugging in .NET – Resources

August 14, 2008 Rhonda 3 comments

The main topic of our “brown bag” this week was Debugging in .NET.  There is always a need for pointers on good debugging techniques, so I thought I would post some debugging resources here.

Information Resources

Video Tutorials

Happy Learning !!!

Tutorials for C# and ASP.NET

October 21, 2007 Rhonda Leave a comment

There are many sites that contain great tutorials for C# and ASP.NET. Below are the ones that I have found useful.

The BlackWasp website is great. They have some very useful C# tutorials that they continually add to.

Coder Source also has some good C# Basics and Tutorials available.

When it comes to ASP.NET, I believe the best tutorials can be found in the Learn area of the ASP.NET website; however, there is some good material in the ASP.NET section of the W3Schools website as well.

In closing, there is a huge amount of beginner .NET content online, the sites that I have listed above are ones that have helped me the most. If anyone knows of anymore great tutorial sites, feel from to let me know.

Great Series on ASP.NET and Data Access

August 8, 2007 Rhonda 1 comment

Scott Mitchell has posted a series of articles on the 4 Guys From Rolla website titled Accessing and Updating Data in ASP.NET 2.0. The series is thorough and easy to follow. Some of the topics include Data Source Control Basics, Accessing Data, Retrieving XML Data and Inserting/Deleting/Updating data. There are several other articles.

There is also feed to the article series available. I highly recommend subscribing as it is a great series for anyone learning ASP.NET.

Wow, I just found a plethora of information on the subject of ASP.NET and Data Access on Scott’s blog as well as the ASP.NET website. This guy has been working really hard on this stuff and, in my opinion, has done a wonderful job.

Direct Links
The Remaining 9 “Working with Data in ASP.NET 2.0″ Tutorials – via Scott’s Blog
5 New “Working with Data in ASP.NET 2.0″ Tutorials Available – via Scott’s Blog
4 New “Working with Data in ASP.NET 2.0″ Tutorials Available – via Scott’s Blog
Working with Data in ASP.NET 2.0 – Complete!
Data Access Tutorials – via ASP.NET

The tutorials are available in both VB.NET and C#. I may be repeating some of the links, but there is so much material that I want to make sure I include everything.

“I am learning all the time. The tombstone will be my diploma.” ~Eartha Kitt

ASP.NET Calendar Class

March 18, 2007 Rhonda Leave a comment

The Calendar class displays a single month calendar that allows the user to select dates and move to the next or previous month. It is part of the System.Web.UI.WebControls namespace.

There are several style properties (color, border, cell, etc) that can be set to change the look and feel of the control. Below are the most useful (non-style) properties.

DayNameFormat
Gets or sets the name format of days of the week.

FirstDayOfWeek
Gets or sets the day of the week to display in the first day column of the Calendar control.

SelectedDate
Gets or sets the selected date.

SelectedDates
Gets a collection of System.DateTime objects that represent the selected dates on the Calendar control.

SelectionMode
Gets or sets the date selection mode on the Calendar control that specifies whether the user can select a single day, a week, or an entire month.

TodaysDate
Gets or sets the value for today’s date.

VisibleDate
Gets or sets the date that specifies the month to display on the Calendar control.

Simple Example of the Calendar Control

ASP.NET SOURCE

<asp:Calendar
   ID="Calendar1" runat="server"
   BackColor="#FFFFCC" BorderColor="#FFCC66"
   BorderWidth="1px"
   DayNameFormat="Shortest"
   Font-Names="Verdana" Font-Size="8pt"
   ForeColor="#663399" Height="200px"
   ShowGridLines="True" Width="220px"
   OnSelectionChanged="Calendar1_SelectionChanged">
   <SelectedDayStyle BackColor="#CCCCFF" Font-Bold="True" />
   <TodayDayStyle BackColor="#FFCC66" ForeColor="White" />
   <SelectorStyle BackColor="#FFCC66" />
   <OtherMonthDayStyle ForeColor="#CC9966" />
   <NextPrevStyle Font-Size="9pt" ForeColor="#FFFFCC" />
   <DayHeaderStyle BackColor="#FFCC66"
      Font-Bold="True" Height="1px" />
   <TitleStyle BackColor="#990000"
      Font-Bold="True" Font-Size="9pt"
      ForeColor="#FFFFCC" />
</asp:Calendar>

C# SOURCE

using System.Web;
using System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page
{
  protected void Page_Load(object sender, EventArgs e)
  {
      Label1.Text = Calendar1.TodaysDate.ToString();
  }
  protected void Calendar1_SelectionChanged(object sender, EventArgs e)
  {
      Label1.Text = Calendar1.SelectedDate.ToString();
  }
}

RESULT

The Calendar control is a rich control that can be extended much further. Online appointment calendars and event calendars are just the beginning.

Categories: ASP.NET

Using the app_offline.htm in ASP.NET

February 4, 2007 Rhonda Leave a comment

The app_offline.htm can be used as a nice & clean way to tell the people that access your website when it is down for maintenance tasks. Scott Guthrie talks about this very helpful feature of ASP.NET 2.0 here and also here.

Basically, when you do not want anyone to access your site, you place a file named app_offline.htm in the root of your web application. When users access your site, they will see the rendered contents of the app_offline.htm file. You can have it display a very simple message like “This site is down for maintenance”. Once the maintenance is complete, simply delete or rename the file.

This is my offline page -

Now I just need to remember to rename the app_offline.htm file when I am finished working on the site.

Categories: ASP.NET

ASP.NET 2.0’s Membership, Roles, and Profiles

January 12, 2007 Rhonda Leave a comment

There is a very informative eight-part article series from Scott Mitchell on ASP.NET 2.0’s Membership, Roles, and Profiles.

I tend to gravitate toward artices on the 4 Guys from Rolla website because they contain an abundant amount of great information for developers of all levels. This article series is a prime example of the material available on their website.

Categories: ASP.NET

Consuming Web Services in .NET

January 1, 2007 Rhonda Leave a comment

A Web Service is a software that is designed to support the interaction of diverse systems over the internet. A WSDL (Web Services Description Language) file is used to describe the web service.

There are several places to find free web services to consume on your website. One such place is a site called XMethods. This site has many “ready to consume” web services. For example, there are web services to retrieve stock quotes as well as services to retrieve weather information for a given zip code.

The one I chose to use in this post is the .NET Factoid web service. (WSDL File)

To enable your web application to consume this web service, you must first add a reference to the service.

  • Right-Click on the web project and select Add Web Reference…
  • In the Add Web Reference dialog box, type the url to the WSDL file for the desired service and click Go
  • Change the Web Reference Name to something descriptive and click Add Reference

You should now see the following in your web project:

After doing all of the prep work, the service is ready to be consumed by your web application.

In this case, I added a label control to the ASPX page and put the following code in my code-behind:

using System;
using System.Web.Services.Protocols;
using DotNetFacts;

public partial class AppDevl : System.Web.UI.Page
{
  protected void Page_Load(object sender, EventArgs e)
  {
    if (!Page.IsPostBack)
    {
      DotnetDailyFact fact = new DotnetDailyFact();
      string dayFact = fact.GetDotnetDailyFact();
      lblFact.Text = dayFact;
    }
  }
}

Below is what it looks like on my website:

Amazon also provides consumable web services (must have a free Amazon account). Using a post from Mads Kristensen, I created an interface that consumes an Amazon web service and pulls the album or book cover for a given author and title.

For more detail on the Amazon Web Service, see Mads Kristensen’s post – Download album art for free through a web service.

As you can see there are Web Services available in many places on the internet. In the future, I will also discuss creating Web Services.

Categories: ASP.NET

Playing with Themes in ASP.NET

December 4, 2006 Rhonda Leave a comment

In this post, I will be going through a basic example of utilizing Themes in ASP.NET. They are very easy to setup and use.

Basically, themes set the look and feel of the controls contained in the website.

First, add folder to the Website project called App_Themes. Then add a new item –> Skin file and name it TestSkin.skin

This creates a TestSkin folder underneath the App_Themes folder that contains the skin file.

Set a couple of common controls and save the file. (TestSkin.skin)(See below)

ASP.NET CODE (Skin file)

<asp:Label
    runat="server"
    BackColor="Green"
    ForeColor="White"
    font-size="8"
    font-name="Tahoma" />

<asp:Button
    runat="server"
    font-size="8"
    font-name="Tahoma"
    font-bold="True"
    ForeColor="Orange" />

<asp:DropDownList
    runat="server"
    font-size="8"
    font-name="Tahoma"
    ForeColor="Red" />

Go to the Page Directive of the page you want the theme to be applied to and add the Theme attribute

ASP.NET CODE (Aspx file)

<%@ Page Language="C#" AutoEventWireup="true"
        CodeFile="Default.aspx.cs" Theme="TestTheme" Inherits="_Default" %>

Once you save everything and view it in the browser, you can see that the controls take on the characteristics set in the theme/skin file.

RESULT

This is a very basic example, but themes can help make multiple pages look like an integrated web application. There is so much that can be done using themes in ASP.NET.

[-Related Links-]
Code in Style with ASP.NET Themes
Themes and Skins in ASP.NET 2.0
Colorful ASP.NET Themes
Using Themes to Customize a Site

Categories: ASP.NET

BulletedList Control in ASP.NET

November 27, 2006 Rhonda Leave a comment

There are several list controls available to ASP.NET. They are the DropDownList, ListBox, CheckBoxList, RadioButtonList and BulletedList controls. The one I will go over in this post is the BulletedList control.

The ASP.NET BulletedList control is used to create a defined list of items formated with bullets. Each item in a BulletedList control is considered a ListItem element. This control can be loaded manually through ASP.NET code (like my example) as well as from a data source.

The BulletedList control is part of the System.Web.UI.WebControls namespace.

Most common properties

DisplayMode
Gets or sets the display mode of the list content in a BulletedList control

BulletStyle
Gets or sets the bullet style for the BulletedList control

BackColor/ForeColor
Gets or sets the back/foreground color of the web server control

Border Color/Style/Width
Gets or sets the border color/style/width of the web server control

Font
Gets the font properties associated with the web server control

-

The BulletedList control has three display types:

  • Hyperlink
  • LinkButton
  • Text

-

The following BulletStyles are available for the BulletedList control:

  • Circle – Hollow Circle
  • Disc – most common Bullet
  • LowerAlpha – Letters
  • LowerRoman – Roman Numerals
  • Numbered
  • Square
  • UpperAlpha – Letters
  • UpperRoman – Roman Numerals
  • CustomImage

-

Simple Example of the BulletedList Control

This example fills the control to display.

ASP.NET SOURCE

Below are the current planets in our Solar System.<br />

<asp:BulletedList ID=blPlanets BulletStyle="Square" runat=server>
    <asp:ListItem>Mercury</asp:ListItem>
    <asp:ListItem>Venus</asp:ListItem>
    <asp:ListItem>Earth</asp:ListItem>
    <asp:ListItem>Mars</asp:ListItem>
    <asp:ListItem>Jupiter</asp:ListItem>
    <asp:ListItem>Saturn</asp:ListItem>
    <asp:ListItem>Uranus</asp:ListItem>
    <asp:ListItem>Neptune</asp:ListItem>
</asp:BulletedList>

C# SOURCE

You can also fill the BulletedList control dynamically using the Page load event instead of ASP.NET code.

protected void Page_Load(object sender, EventArgs e)
{
  if (!Page.IsPostBack)
  {
    blPlanets.Items.Add("Mercury");
    blPlanets.Items.Add("Venus");
    blPlanets.Items.Add("Earth");
    blPlanets.Items.Add("Mars");
    blPlanets.Items.Add("Jupiter");
    blPlanets.Items.Add("Saturn");
    blPlanets.Items.Add("Uranus");
    blPlanets.Items.Add("Neptune");
  }
}

RESULT

-

This post concludes my List Control series. There are many other methods of implementing the different List Controls in ASP.NET. I have barely scratched the surface of possibilities.

-

[- Related Links -]
ASP.NET Quickstart Tutorials – BulletedList
ASP.NET Tutorial – BulletedList

Categories: ASP.NET