How to create a simple website using visual studio 2010

Lab 1: Introduction to ASP.NET

Create a web application that adds the contents of 2 text boxes and displays the result in a label. p> <ol

  • View media clip. Click on the bottom right for full screen.
  • Create an empty web application project called “Calculator”
  • Add 2 text boxes, a label, and a button to the designer for Default.aspx.
  • In the click event of the button, add the following code (on one line):Label1.Text = Integer.Parse(Me.Textbox1.Text) + Integer.Parse(Me.Textbox2.Text)
  • Extend the app to allow subtraction, multiplication, and division.
  • Extend the app to validate values ​​entered in text boxes.
  • Try it out and save the application.
  • View code file.
  • Lab 2: Managing the User Interface

    Create a skeleton website using Master Page, themes and navigation.

    1. Create an empty website called RentalLibrary:
    • First , create the folder (assigning it the sit io web name) where you want to save your website.
    • Go to the File Menu.
    • Select New and then Website.
    • Be sure to select File system in the list box next to Web Location (at the bottom left of the window).
    • Then browse to the folder you created in the first step.
    • Select ASP.NET Website and click OK.

    Add a theme called SimpleTheme. To do this, right-click the Project in Solution Explorer, then select Add>Add ASP.NET Folder>Theme from the context menu. Add a skin file for a tag to the theme. Call this Label.skin. To do this, right-click on the SimpleTheme, then select Add>New Element…>Skin File. Add this tag element to the bottom of the skin file: Add a Web.SiteMap file to the application. To do this, right-click the Project in Solution Explorer, then select Add>New Item…>Sitemap. Delete the existing master page and then add another one to the app. Right-click the Project in Solution Explorer, then select Add>New Item…>Master Page. Remove the first few ContentPlaceholder elements in the master page title. Only one content placeholder is needed. Add a label control to the master page, but make sure it is above the remaining content placeholder. Set the SkinID attribute of the tag to “Title”. Include the text RentalLibrary.com in the tag. Drag the SiteMapDataSource and TreeView controls from the toolbox onto the master page. Make sure again that these are positioned above the ContentPlaceholder. Set the TreeView data source to be a sitemap data source. Set these SiteMapDataSource properties: StartFromCurrentNode=False ShowStartingNode=True Add a web form using the master page called Default.aspx. Select the master page that you added in step 3. Make Default.aspx the application home page. Add the text “Welcome to RentalLibrary.com” within the page content elements. Set the theme of the site to “SimpleTheme” by adding this element to the web.config file:

    See Also:  How to Pair Altice Remote to TV in seconds

    Place this element inside the element.

    Add three more Web form using master page. Name them:

    • Games.aspx.
    • ContactUs.aspx
    • DVD.aspx.

    Edit the Web.SiteMap to include navigation to the four pages of the site. Include the URL, title, and description of each page. Try the website.

    Lab 3 – Configuring the Web Site Store the application configuration in the web.config file. The name of a mail server will be kept in this configuration file. It can then be easily changed without recompiling the application.

    1. Create an empty web application project named Configuration. Add a web form named Default.aspx. and set it as the home page.
    2. Store application settings by adding this element to the web.config file:

    Place this element immediately below the element.

    Drag a text box from the toolbox onto the designer for Default.aspx. Import the configuration namespace by adding this declaration at the top of Default.aspx.cs. Displays the application settings on the default web page. Access the configuration through the WebConfigurationManager object. Add this Page_Load event handler to Default.aspx.cs – Run the website to check if the application settings are displayed. See code file.

    Lab 4: Membership and Personalization

    Create a web application that allows authenticated users to change their personal settings. An ASP.Net database will be created to store usernames. Individual users can store and retrieve a personal email address.

    1. First, you’ll need to locate the aspnet_regsql.exe tool in C:WindowsMicrosoft.NetFramework. This is located in the V4.0.30319 folder or within the V2.0.50727 folder depending on whether you are running Framework version 4 or earlier.

      When you run the application, a security database called aspnetdb will be created. It is then automatically stored in SQL Server 2008.

    2. Next, go to Server Explorer (accessed via the View menu in Visual Studio) and add a connection to the aspnetdb database.
    3. Create an empty website called Membership.
    4. Open the Website Administration Tool > and configure security (this tab will have been activated when connecting to the aspnetdb database). Add a user’s credentials.
    See Also:  How to Be a Successful Art Blogger: 7 Effective Blogging Strategies for Artists

    Add profile settings to web.config to store an email address (with a default value of [not set]).

    Make sure it is located under the tag.

    Add a page (Profile.aspx) with a label. In Page_PreRender add code to set the label text to the profile email address. See code file. Add another page, EditProfile.aspx, and link to it from Profile.aspx. On this page, add a text box to allow the user to enter an email address. Save these values ​​in the profile. See code file. Try the

    Back to Top

    website.

    Leave a Reply

    Your email address will not be published. Required fields are marked *