ASP Homework Help, Project Help, ASP Assignment Solution

Welcome, you’ve visited the premier place if you require help with Asp homework. We guarantee that the work will be completed, or we will give you a complete refund.

ASP was Microsoft’s design for dynamic web pages, it stands for Active Server Pages. Normally used with C# as the backend (the code that runs on the server).

ASP.NET is a web development platform, which provides a programming model, to build up robust web applications for PC as well as mobile devices. Students who are studying ASP.net in their semesters have always felt the urge of completing the assignment through our asp.net assignment help.

Following is a Asp program to solve the assignment, if you need help with Asp this is just a sample of the kind of work we can do for you.

Problem:

Assignment 1:

  1. Add a master page that your other aspx pages will inherit from.
  2. Add a top menu (with at least 3 menu items, though they may not link to anywhere yet) and a graphic banner of your choice and bottom footer of your choice to the master page
  3. Add a style sheet that is referenced on the master page and has at least 3 items to help style your pages
  4. Add 2 user controls and display them on your default aspx page. One control will be a simple list of store contact information. The other control will be a featured product control which displays a featured product of your choosing with an image and a description.
  5. Add a pie chart to your main page using the Graphics class. Have the pie chart split into at least 3 different sections.

Assignment 2:

  1. Setup the sample database
  2. Create the products table with fields such as id, name, description, price, etc, and add at least 3 records into
    this database
  3. Create a DisplayProducts.aspx page that will query your products table and display the results on the page
  4. Create an InsertProduct.aspx page that will get the name, description, price, etc from the user through fields on
    the form with a submit button that will insert a new product record into your database with the values that the
    user entered.
  5. Create a DeleteProduct.aspx page that will have a textbox for the id of a product to delete and a submit button
    that will delete the product in the database with the cooresponding id.

Assignment 3:

Create a store application in Visual Studio

Create the following pages:

Home page, about us, products, registration, Contact us

Include a master page in your project that each page will inherit from

Include a style sheet in your project that will be on your master page

The products page should have at least 10 products with images and descriptions and prices.

The products page data should be pulled from a database of products

Include a products detail page when a product is selected in order to display it, passing in the product to display by an id in the query string and then querying a database to display that product (with an image and information and price)

The registration page should allow a user to fill out there information and the data will be stored in a database.

Include validation on each control on the registration page

  1. Each page added (Home page, about us, products, registration, Contact us)
  2. Each page uses the included master page
  3. 10 products on products page with images descriptions and prices
  4. All products page information should be pulled from a database
  5. Each product links to a product detail page by passing the product id in a querystring (page should display
    large product image, information, and price)
  6. Product detail page information should be pulled from the database
  7. Capture user information in the registration page and store their information in a database
  8. Validation on each control (as it makes sense) on the registration page
  9. Products table created in database which includes all product information (id, name, description, price, etc)
  10. Registration table created in database to store user information

They have always used our asp.net homework help for their assignment solutions and have found to be fruitful in their semester examinations. Our experts have found that the beginners face problems initially to understand the concepts of event driven model of interaction to the web applications.

Solution

Assignment 1

pie.ashx

<%@ WebHandler Language="C#" Class="Pie" %>

using System;
using System.Web;
using System.Drawing;
using System.Drawing.Imaging;
using System.Drawing.Drawing2D;
public class Pie : IHttpHandler {

    public void ProcessRequest (HttpContext context)
    { 
        string val1 = context.Request.QueryString["val1"];
        string names = context.Request.QueryString["val2"];
        string[] num = val1.Split(',');
        string[] nm = names.Split(',');
        displayImage(num,nm);
        context.Response.ContentType = "image/gif";
        bmp.Save(context.Response.OutputStream, ImageFormat.Gif);
    }

    Bitmap bmp;

    public void displayImage(string []num,string[] nms)
    {
        bmp = new Bitmap(500, 500);
        Graphics graphic = Graphics.FromImage(bmp);      
        SolidBrush whitebrush = new SolidBrush(Color.White);
        SolidBrush BlackBrush = new SolidBrush(Color.Black);
        Pen blackPen = new Pen(Color.Black, 2);
        graphic.FillRectangle(whitebrush, 0, 0, 500, 500); 
        float tot = 0;
        for (int i = 0; i < num.Length; i++)
        {
            tot += float.Parse(num[i]);
        }
        Random rnd = new Random(); 
        float[] val = new float[num.Length];
        if (tot == 0)
            tot = 1;

        int gap = Convert.ToInt32((30 / 100) * (440 / num.Length));
        int thickness = Convert.ToInt32((440 / num.Length) - ((60 / 100) * (440 / num.Length)));
        if (num.Length < 16)
        {
            gap = 20;
            thickness = 10;           
        }         
        float start = 0;
        for (int i = 0; i < val.Length; i++)
        {
            SolidBrush brush = new SolidBrush(Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)));
            val[i] = (float.Parse(num[i]) / tot) * 360;
            graphic.FillPie(brush, 0, 0, 380, 380, start, val[i]);
            graphic.FillRectangle(brush, 410, ((i * (gap + thickness)) + 40), thickness, thickness);
            graphic.DrawString(nms[i], new Font("Arial", 8), BlackBrush, 420 + thickness, ((i * (gap + thickness)) + 38));
            start += val[i];
        }
    }

    public bool IsReusable {
        get {
            return false;
        }
    }

}

 

ContactInfo.ascx

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ContactInfo.ascx.cs" Inherits="ContactInfo" %>
<style type="text/css">
    .auto-style1
    {
        width: 100%;
    }
    .auto-style2
    {
        width: 182px;
    }
</style>

<table cellspacing="0" class="auto-style1" style="border: 1px solid #000000">
    <tr>
        <td class="auto-style2">Name : </td>
        <td><%= this.UserName %></td>
    </tr>
    <tr>
        <td class="auto-style2">Phone : </td>
        <td><%= this.PhoneNumber %></td>
    </tr>
    <tr>
        <td class="auto-style2">Address : </td>
        <td><%= this.UserAddress %></td>
    </tr>
</table>

ContactInfo.ascx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class ContactInfo : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    private string Name;
    private string Phone;
    private string Address;

    public string UserName
    {
        get { return Name; }
        set { Name = value; }
    }

    public string PhoneNumber
    {
        get { return Phone; }
        set { Phone = value; }
    }

    public string UserAddress
    {
        get { return Address; }
        set { Address = value; }
    }
}

Assignment 2

InsertProduct.aspx

<%@ Page Title="INSERT PRODUCT" Language="C#" MasterPageFile="~/SiteMaster.master" AutoEventWireup="true" CodeFile="InsertProduct.aspx.cs" Inherits="InsertProduct" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .auto-style21
        {
            width: 800px;
        }
    </style>
    <script type="text/javascript">
        function CheckVal()
        {
            if (document.getElementById('<%=txtName.ClientID %>').value == "") {
                alert('Please enter Product Name');
                document.getElementById('<%=txtName.ClientID %>').focus();
                return false;
            }
            if (document.getElementById('<%=txtPrice.ClientID %>').value == "") {
                alert('Please enter Product Price');
                document.getElementById('<%=txtPrice.ClientID %>').focus();
                return false;
            }
            if (document.getElementById('<%=ddlImages.ClientID %>').value == "") {
                alert('Please select an image');
                document.getElementById('<%=ddlImages.ClientID %>').focus();
                return false;
            }
            if (document.getElementById('<%=txtDesc.ClientID %>').value == "") {
                alert('Please enter Product Description');
                document.getElementById('<%=txtDesc.ClientID %>').focus();
                return false;
            }
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
        <table width="100%">
        <tr>
            <td align="left">
    <fieldset><legend>Insert product</legend>
    <table class="auto-style21">
        <tr>
            <td align="left">
                &nbsp;</td>
            <td align="left">
                &nbsp;</td>
            <td align="left">
                &nbsp;</td>
            <td align="left">
                &nbsp;</td>
        </tr>
        <tr>
            <td align="left">
                <asp:Label ID="Label3" runat="server" CssClass="lblstyle" Text="Product Name"></asp:Label>
            </td>
            <td align="left">
                <asp:TextBox ID="txtName" runat="server" Width="150px"></asp:TextBox>
            </td>
            <td align="left">
                <asp:Label ID="Label4" runat="server" CssClass="lblstyle" Text="Price ($)"></asp:Label>
            </td>
            <td align="left">
                <asp:TextBox ID="txtPrice" runat="server" MaxLength="5" Width="150px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td align="left">
                <asp:Label ID="Label5" runat="server" CssClass="lblstyle" Text="Image"></asp:Label>
            </td>
            <td align="left">
                <asp:DropDownList ID="ddlImages" runat="server" Width="160px">
                    <asp:ListItem Value="NoImage.png">No Image</asp:ListItem>
                    <asp:ListItem Value="iPhone.png">iPhone</asp:ListItem>
                    <asp:ListItem Value="ipad.jpg">iPad</asp:ListItem>
                    <asp:ListItem Value="camera.jpg">Camera</asp:ListItem>
                </asp:DropDownList>
            </td>
            <td align="left">
                <asp:Label ID="Label6" runat="server" CssClass="lblstyle" Text="Description"></asp:Label>
            </td>
            <td align="left">
                <asp:TextBox ID="txtDesc" runat="server" Height="57px" TextMode="MultiLine" Width="150px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td align="left">&nbsp;</td>
            <td align="left">&nbsp;</td>
            <td align="left">&nbsp;</td>
            <td align="left">
                <asp:Button ID="btnAdd" runat="server" OnClientClick="return CheckVal();" Text="Insert" Width="70px" OnClick="btnAdd_Click" />
                <asp:Button ID="btnClear" runat="server" Text="Clear" Width="70px" OnClick="btnClear_Click" />
            </td>
        </tr>
    </table>
        </fieldset>
                </td>
            </tr>
            </table>
</asp:Content>

They start looking for asp.net assignments to solve their ASP.net assignment questions. Students always take help with asp.net homework in order to prepare themselves for their semester exams.

InsertProduct.aspx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.OleDb;
using System.Configuration;
public partial class InsertProduct : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        txtName.Focus();
        if (!IsPostBack)
            ddlImages.SelectedIndex = -1;
    }
    OleDbCommand cmd;
    OleDbConnection con;
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        con = new OleDbConnection(ConfigurationManager.ConnectionStrings["mycon"].ConnectionString);
        string q = "insert into Products(ProductName,Price,Description,Img) values (@name,@price,@desc,@img)";
        cmd = new OleDbCommand(q, con);
        cmd.Parameters.Add("@name", OleDbType.VarChar).Value = txtName.Text;
        cmd.Parameters.Add("@price", OleDbType.VarChar).Value = txtPrice.Text;
        cmd.Parameters.Add("@desc", OleDbType.VarChar).Value = txtDesc.Text;
        cmd.Parameters.Add("@img", OleDbType.VarChar).Value = ddlImages.SelectedValue;
        try
        {
            con.Open();
            cmd.ExecuteNonQuery();
            con.Close();
            ClearAll();
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "done", "javascript:alert('Product inserted successfully');", true);
        }
        catch
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "error", "javascript:alert('Product insertion failed. Please enter valid values');", true);
        }
        finally
        {
            if (con.State == System.Data.ConnectionState.Open)
                con.Close();
        }
    }
    void ClearAll()
    {
        txtName.Text = "";
        txtPrice.Text = "";
        txtDesc.Text = "";
        ddlImages.SelectedIndex = -1;
        txtName.Focus();
    }
    protected void btnClear_Click(object sender, EventArgs e)
    {
        ClearAll();
    }
}

DisplayProduct.aspx

<%@ Page Title="DISPLAY PRODUCTS" Language="C#" MasterPageFile="~/SiteMaster.master" AutoEventWireup="true" CodeFile="DisplayProduct.aspx.cs" Inherits="DisplayProduct" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <style type="text/css">
        .auto-style21
        {
            height: 39px;
        }
        .auto-style22
        {
            height: 30px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table width="100%">
        <tr>
            <td align="left">
                <fieldset><legend>PRODUCTS LIST</legend>
                <asp:datalist id="DataList1" runat="server"  bordercolor="#CCCCCC" borderstyle="None" borderwidth="1px" cellpadding="4" forecolor="Black" gridlines="Horizontal" width="100%">
                    <FooterStyle BackColor="#CCCC99" ForeColor="Black" />
                    <HeaderStyle BackColor="#333333" Font-Bold="True" ForeColor="White" />
                    <ItemTemplate>
                    <fieldset style="font-family:'Courier New'; font-size:13px"><legend>Product ID : <%# Eval("ID") %></legend>

                         <table class="auto-style10">
                             <tr>
                                 <td width="120px" class="auto-style21">
                                     <asp:Label ID="Label1" runat="server" Text="NAME" CssClass="auto-style20"></asp:Label>
                                 </td>
                                 <td  width="320px" class="auto-style21">
                                     <asp:Label ID="Label2" runat="server" Text='<%# Eval("ProductName") %>'></asp:Label>
                                 </td>
                                 <td rowspan="3" align="center" valign="middle">
                                     <img alt="" src='<%# "Images/"+Eval("Img").ToString() %>' style="height: 100px;" /></td>
                             </tr>
                              <tr>
                                 <td width="120px" class="auto-style22">
                                     <asp:Label ID="Label3" runat="server" Text="PRICE" CssClass="auto-style20"></asp:Label>
                                 </td>
                                 <td  width="320px" class="auto-style22">
                                     <asp:Label ID="Label4" runat="server" Text='<%# "$ "+Eval("Price").ToString() %>'></asp:Label>
                                 </td>
                             </tr>
                              <tr>
                                 <td width="120px">
                                     <asp:Label ID="Label5" runat="server" Text="DESCRIPTION" CssClass="auto-style20"></asp:Label>
                                 </td>
                                 <td  width="320px">
                                     <asp:Label ID="Label6" runat="server" Text='<%# Eval("Description") %>'></asp:Label>
                                 </td>
                             </tr>
                         </table>

                    </fieldset>
                    </ItemTemplate>
                    <SelectedItemStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
                        </asp:datalist>
                    </fieldset>
            </td>
        </tr>

    </table>
</asp:Content>

DisplayProduct.aspx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing;
using System.Drawing.Imaging;
using System.Data.OleDb;
using System.Configuration;
using System.Data;
public partial class DisplayProduct : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
            LoadProducts();
    }

    void LoadProducts()
    {
        OleDbConnection con = new OleDbConnection(ConfigurationManager.ConnectionStrings["mycon"].ConnectionString);
        string query = "select p.ID,p.ProductName,p.Price,p.Description,p.Img from Products p order by p.ID";
        OleDbDataAdapter adap = new OleDbDataAdapter(query, con);
        DataSet ds = new DataSet();
        adap.Fill(ds);
        DataList1.DataSource = ds.Tables[0];
        DataList1.DataBind();
    }
}

Our online ASP.net experts discuss about the different stages of the ASP.net page like Page request, Starting of page life cycle, Page initialization, Page load Validation, Postback event handling when they offer ASP.net homework help.

Assignment 3

Registration.aspx

<%@ Page Title="Registration" Language="C#" MasterPageFile="~/SiteMaster.master" AutoEventWireup="true" CodeFile="Registration.aspx.cs" Inherits="Registration" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .auto-style21
        {
            width: 694px;
        }
        .auto-style22
        {
            width: 247px;
        }
        .auto-style23
        {
            width: 97px;
        }
        .auto-style24
        {
            width: 116px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table cellspacing="0" class="mainTable">
        <tr>
            <td align="left">&nbsp;</td>
        </tr>
        <tr>
            <td align="left">
                <fieldset><legend>New Registration Form</legend>
                <table cellspacing="0" class="auto-style21">
                    <tr>
                        <td class="auto-style24">
                            <asp:Label ID="Label3" runat="server" CssClass="lblstyle" Text="Name"></asp:Label>
                        </td>
                        <td class="auto-style22">
                            <asp:TextBox ID="txtName" runat="server" Width="170px"></asp:TextBox>
                        </td>
                        <td class="auto-style23">
                            <asp:Label ID="Label4" runat="server" CssClass="lblstyle" Text="Gender"></asp:Label>
                        </td>
                        <td>
                            <asp:RadioButtonList ID="rblGender" runat="server" RepeatDirection="Horizontal">
                                <asp:ListItem Text="Male" Value="Male"></asp:ListItem>
                                <asp:ListItem Text="Female" Value="Female"></asp:ListItem>
                            </asp:RadioButtonList>
                        </td>
                    </tr>
                    <tr>
                        <td class="auto-style24">
                            &nbsp;</td>
                        <td class="auto-style22">
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtName" ErrorMessage="Please enter your name" SetFocusOnError="True"></asp:RequiredFieldValidator>
                        </td>
                        <td class="auto-style23">
                            &nbsp;</td>
                        <td>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="rblGender" ErrorMessage="Please select your gender" SetFocusOnError="True"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td class="auto-style24">
                            <asp:Label ID="Label5" runat="server" CssClass="lblstyle" Text="Age"></asp:Label>
                        </td>
                        <td class="auto-style22">
                            <asp:DropDownList ID="ddlAge" runat="server" Width="175px">
                            </asp:DropDownList>
                        </td>
                        <td class="auto-style23">
                            <asp:Label ID="Label7" runat="server" CssClass="lblstyle" Text="Address"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtAddress" runat="server" Height="44px" TextMode="MultiLine" Width="170px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="auto-style24">
                            &nbsp;</td>
                        <td class="auto-style22">
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="ddlAge" ErrorMessage="Select your age" SetFocusOnError="True"></asp:RequiredFieldValidator>
                        </td>
                        <td class="auto-style23">
                            &nbsp;</td>
                        <td>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtAddress" ErrorMessage="Enter your address" SetFocusOnError="True"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td class="auto-style24">
                            <asp:Label ID="Label6" runat="server" CssClass="lblstyle" Text="Contact #"></asp:Label>
                        </td>
                        <td class="auto-style22">
                            <asp:TextBox ID="txtContact" runat="server" Width="170px"></asp:TextBox>
                        </td>
                        <td class="auto-style23">&nbsp;</td>
                        <td>
                            <asp:Button ID="btnRegister" runat="server" Font-Bold="True" Font-Names="Courier New" Text="REGISTER" Width="90px" OnClick="btnRegister_Click" />
                            <asp:Button ID="btnClear" runat="server" Font-Bold="True" Font-Names="Courier New" Text="CLEAR" Width="85px" CausesValidation="False" OnClick="btnClear_Click" />
                        </td>
                    </tr>
                    <tr>
                        <td class="auto-style24">
                            &nbsp;</td>
                        <td class="auto-style22">
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtContact" ErrorMessage="Enter your contact number" SetFocusOnError="True"></asp:RequiredFieldValidator>
                        </td>
                        <td class="auto-style23">&nbsp;</td>
                        <td>&nbsp;</td>
                    </tr>
                </table>
                    </fieldset>
            </td>
        </tr>
    </table>
</asp:Content>

Registration.aspx.cs

using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data.OleDb;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Registration : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
            LoadAge();
        txtName.Focus();
    }
    OleDbCommand cmd;
    OleDbConnection con;
    void LoadAge()
    { 
        for(int i=1;i<100;i++)
        {
            ddlAge.Items.Add(i.ToString());
        }
        ddlAge.SelectedIndex = 17;
    }
    void ClearAll()
    {
        txtAddress.Text = "";
        txtContact.Text = "";
        txtName.Text = "";
        ddlAge.SelectedIndex = 17;
        rblGender.ClearSelection();
        txtName.Focus();
    }
    protected void btnClear_Click(object sender, EventArgs e)
    {
        ClearAll();
    }
    protected void btnRegister_Click(object sender, EventArgs e)
    {
        string query = "insert into Registration(UserName,Age,Gender,ContactNumber,Address,RegistrationDatetime) values (@uname,@age,@gender,@contact,@add,@dt)";
        con = new OleDbConnection(ConfigurationManager.ConnectionStrings["mycon"].ConnectionString);
        cmd = new OleDbCommand(query, con);
        cmd.Parameters.Add("@uname", OleDbType.VarChar).Value = txtName.Text;
        cmd.Parameters.Add("@age", OleDbType.VarChar).Value = ddlAge.SelectedValue;
        cmd.Parameters.Add("@gender", OleDbType.VarChar).Value = rblGender.SelectedValue;
        cmd.Parameters.Add("@contact", OleDbType.VarChar).Value = txtContact.Text;
        cmd.Parameters.Add("@add", OleDbType.VarChar).Value = txtAddress.Text;
        cmd.Parameters.Add("@dt", OleDbType.VarChar).Value = DateTime.Now; ;
        try
        {
            con.Open();
            cmd.ExecuteNonQuery();
            con.Close();
            ClearAll();
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "done", "javascript:alert('Registration successfully');", true);
        }
        catch
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "error", "javascript:alert('Registration failed. Please enter valid values');", true);
        }
        finally
        {
            if (con.State == System.Data.ConnectionState.Open)
                con.Close();
        }
    }
}

Beginners have found our asp.net assignments most helpful to solve their asp.net assignment questions. Learners avail the benefits of developing code in asp.net sample project where they get the support from our experts in coding.

Products.aspx

<%@ Page Title="Products" Language="C#" MasterPageFile="~/SiteMaster.master" AutoEventWireup="true" CodeFile="Products.aspx.cs" Inherits="Products" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table class="mainTable">
        <tr>
            <td>&nbsp;</td>
        </tr>
        <tr>
            <td align="left">
                <fieldset><legend>PRODUCTS LIST - SELECT A PRODUCT TO VIEW DETAILS</legend>
                    <asp:Panel ID="Panel1" runat="server" ScrollBars="Auto">
                        <asp:GridView ID="GridView1" AutoGenerateColumns="false" runat="server" CellPadding="4" EnableModelValidation="True" ForeColor="#333333" GridLines="None" Width="97%">
                            <Columns>
                                <asp:TemplateField HeaderText="NAME" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                                    <ItemTemplate>
                                        <a href='<%# "ProductDetails.aspx?ID="+Eval("ID").ToString() %>'><%# Eval("ProductName") %></a>
                                    </ItemTemplate>
                                </asp:TemplateField>
                               <asp:BoundField HeaderText="PRICE ($)" DataField="Price"  ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left"/>
                           </Columns>
                             <AlternatingRowStyle BackColor="White" />
                            <EditRowStyle BackColor="#7C6F57" />
                            <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                            <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White"  HorizontalAlign="Left"/>
                            <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
                            <RowStyle BackColor="#E3EAEB" />
                            <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
                        </asp:GridView>
                    </asp:Panel>
                </fieldset>
            </td>
        </tr>
    </table>
</asp:Content>

Products.aspx.cs

using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.OleDb;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Products : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
            LoadProducts();
    }
    void LoadProducts()
    {
        OleDbConnection con = new OleDbConnection(ConfigurationManager.ConnectionStrings["mycon"].ConnectionString);
        string query = "select p.ID,p.ProductName,p.Price from Products p Order by ID";
        OleDbDataAdapter adap = new OleDbDataAdapter(query, con);
        DataSet ds = new DataSet();
        adap.Fill(ds);
        GridView1.DataSource = ds.Tables[0];
        GridView1.DataBind();
    }
}

ProductDetails.aspx

<%@ Page Title="PRODUCT DETAILS" Language="C#" MasterPageFile="~/SiteMaster.master" AutoEventWireup="true" CodeFile="ProductDetails.aspx.cs" Inherits="ProductDetails" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <style type="text/css">
        .auto-style21
        {
            height: 39px;
        }
        .auto-style22
        {
            height: 30px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table width="100%">
        <tr>
            <td align="left">
                <fieldset><legend>PRODUCT DETAILS</legend>
                    <asp:datalist id="DataList1" runat="server"  bordercolor="#CCCCCC" borderstyle="None" borderwidth="1px" cellpadding="4" forecolor="Black" gridlines="Horizontal" width="100%">
                        <FooterStyle BackColor="#CCCC99" ForeColor="Black" />
                        <HeaderStyle BackColor="#333333" Font-Bold="True" ForeColor="White" />
                        <ItemTemplate>
                        <fieldset style="font-family:'Courier New'; font-size:13px"><legend>Product ID : <%# Eval("ID") %></legend>

                             <table class="auto-style10">
                                 <tr>
                                     <td width="120px" class="auto-style21">
                                         <asp:Label ID="Label1" runat="server" Text="NAME" CssClass="auto-style20"></asp:Label>
                                     </td>
                                     <td  width="320px" class="auto-style21">
                                         <asp:Label ID="Label2" runat="server" Text='<%# Eval("ProductName") %>'></asp:Label>
                                     </td>
                                     <td rowspan="3" align="center" valign="middle">
                                         <img alt="" src='<%# "Images/"+Eval("Img").ToString() %>' style="height: 200px;" /></td>
                                 </tr>
                                  <tr>
                                     <td width="120px" class="auto-style22">
                                         <asp:Label ID="Label3" runat="server" Text="PRICE" CssClass="auto-style20"></asp:Label>
                                     </td>
                                     <td  width="320px" class="auto-style22">
                                         <asp:Label ID="Label4" runat="server" Text='<%# "$ "+Eval("Price").ToString() %>'></asp:Label>
                                     </td>
                                 </tr>
                                  <tr>
                                     <td width="120px">
                                         <asp:Label ID="Label5" runat="server" Text="DESCRIPTION" CssClass="auto-style20"></asp:Label>
                                     </td>
                                     <td  width="320px">
                                         <asp:Label ID="Label6" runat="server" Text='<%# Eval("Description") %>'></asp:Label>
                                     </td>
                                 </tr>
                             </table>

                        </fieldset>
                        </ItemTemplate>
                        <SelectedItemStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
                    </asp:datalist>
                </fieldset>
            </td>
        </tr>

    </table>
</asp:Content>

ProductDetails.aspx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing;
using System.Drawing.Imaging;
using System.Data.OleDb;
using System.Configuration;
using System.Data;
public partial class ProductDetails : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string id = Request.QueryString["ID"];
            LoadProducts(id);
        }
    }

    void LoadProducts(string ID)
    {
        OleDbConnection con = new OleDbConnection(ConfigurationManager.ConnectionStrings["mycon"].ConnectionString);
        string query = "select p.ID,p.ProductName,p.Price,p.Description,p.Img from Products p where p.ID="+ID;
        OleDbDataAdapter adap = new OleDbDataAdapter(query, con);
        DataSet ds = new DataSet();
        adap.Fill(ds);
        DataList1.DataSource = ds.Tables[0];
        DataList1.DataBind();
    }
}

Here is an example of a Asp home work, compare our solutions to anyone else. Check out our Asp programming homework help.

Problem:

This assignment introduces ASP.NET. We will continue to use the database tables from assignment 4 to store all
notes (and tags). Your application has largely the same functions from assignment 4, except that the user
interface is a web browser. The requirements are specified below.

  1. Provide a user interface to display all notes from the database. Provide options to sort notes based on the title, the creation time, and the most recent update time. Note that tags are required to be displayed in this view. In case that the text body or title of a note is very long to be displayed nicely, you do not have to show the complete text.
  2. Provide a user interface to add a new note. Pay attention that neither the creation time nor the update time can be set by the user.
  3. Provide a user interface to select a note and display the complete information of this note, edit it, or delete it. Similar to the above requirement, pay attention that neither the creation time nor the update time can be set by the user.
  4. All above changes need to be saved in the database.
  5. Your system shall provide a user interface to take an input tag and display the notes with the specified tag. Show the value of the number of found notes.
  6. Display all tags somewhere in your application. Allow the user to select a tag and display nicely all notes that are associated with this tag. Similar to requirement 5, show the number of notes.
  7. Pay attention to programming styles and documentation.
  8. Your database shall have at least 20 notes. At least five of them have a tag “test”. This requirement is for the grading purpose. You do not get points for it. But if you do not provide the sufficient number of notes, your projects gets 0 points.
  9. If you implement some useful new features not specified above, you can get up to 10 more bonus points.
    Provide documentation of your new features both in the source code and on blackboard when you submit. You do not get bonus points without such documentation.

Solution:

Default.aspx

<%@ Page Language="C#" MasterPageFile="~/Site.master" CodeBehind="Default.aspx.cs" Inherits="mynotesasp._Default" %>

<asp:Content ID="headContent" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server" />

        <asp:Panel ID="pnlList" runat="server" Visible="true">
            <h2 class="DDSubHeader">My Notes</h2>
            <br /><br />
            <asp:CheckBox runat="server" Checked="true" ID="chkAllNotes" OnCheckedChanged="chkAllNotes_CheckedChanged" Text="All Tags" AutoPostBack="true" />
            <asp:CheckBoxList runat="server" ID="chkTags" AutoPostBack="true" DataTextField="Description" DataValueField="Id" OnSelectedIndexChanged="chkTags_SelectedIndexChanged"
                RepeatDirection="Horizontal" />
            <asp:GridView ID="gvNotes" runat="server" BorderColor="#999999" AutoGenerateColumns="False"
                BorderWidth="1px" CellPadding="4" ForeColor="#333333" GridLines="None" AllowSorting="true" 
                AllowPaging="true" PageSize="5" OnPageIndexChanging="gvNote_PageIndexChanging"
                OnSorting="gvNotes_Sorting" OnRowEditing="gvNotes_RowEditing" OnRowDeleting="gvNotes_RowDeleting">
                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                <Columns>
                    <asp:TemplateField HeaderText="Id">
                        <ItemTemplate>
                            <asp:Label ID="lblNoteId" runat="server" Text='<%# Eval("id") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Title" SortExpression="title">
                        <ItemTemplate>
                            <asp:Label ID="lblTitle" runat="server" Text='<%# Eval("title") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Body" SortExpression="body">
                        <ItemTemplate>
                            <asp:Label ID="lblBoby" Text='<%# Eval("body") %>' runat="server"></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Tags" SortExpression="tags">
                        <ItemTemplate>
                            <asp:Label ID="lblTags" runat="server" Text='<%# Eval("tags") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Created" SortExpression="created">
                        <ItemTemplate>
                            <asp:Label ID="lblCreated" runat="server" Text='<%# Eval("created") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Modified" SortExpression="modified">
                        <ItemTemplate>
                            <asp:Label ID="lblModified" runat="server" Text='<%# Eval("modified") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:ButtonField ButtonType="Button" CommandName="edit" Text="edit" />
                    <asp:ButtonField ButtonType="Button" CommandName="delete" Text="delete" />
                </Columns>
                <EditRowStyle BackColor="#999999" />
                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            </asp:GridView>
            <asp:Button runat="server" ID="btnAddNote" OnClick="btnAddNote_Click" Text="Add" />
        </asp:Panel>
        <asp:Panel ID="pnlEditDelete" runat="server" Visible="false">
            <h2 runat="server" id="lblEditDeleteTitle" class="DDSubHeader">My Notes</h2>
            <br /><br />
            <asp:HiddenField runat="server" ID="hddId" />
            <table>
                <tr>
                    <td>Title</td>
                    <td><asp:TextBox runat="server" ID="txtTitle" /></td>
                </tr>
                <tr>
                    <td>Body</td>
                    <td><asp:TextBox runat="server" ID="txtBody" /></td>
                </tr>
                <tr>
                    <td>Created</td>
                    <td><asp:TextBox runat="server" ID="txtCreated" Enabled="false" /></td>
                </tr>
                <tr>
                    <td>Last modified</td>
                    <td><asp:TextBox runat="server" ID="txtModified" Enabled="false" /></td>
                </tr>
                <tr>
                    <td colspan="2">
                        <asp:CheckBoxList runat="server" ID="chkEditTags" DataTextField="Description" DataValueField="Id" RepeatDirection="Vertical" />
                    </td>
                </tr>
            </table>
            <asp:Button runat="server" ID="btnSave" OnClick="btnSave_Click" Text="Save" />
            <asp:Button runat="server" ID="btnCancel" OnClick="btnCancel_Click" Text="Cancel" />
        </asp:Panel>
    <asp:Label runat="server" ID="debug"></asp:Label>
</asp:Content>

Default.aspx.cs

using System;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web.DynamicData;
using System.Data.Odbc;
using System.Configuration;
using System.Web.UI.WebControls;
using System.Data;
using MySql.Data.MySqlClient;
using System.Collections.Generic;

namespace mynotesasp
{
    public partial class _Default : System.Web.UI.Page
    {
        #region Session vars

        private DataView View
        {
            get
            {
                return Session["_Default_aspx_view"] as DataView;
            }
            set
            {
                Session["_Default_aspx_view"] = value;
            }
        }

        #endregion

        protected void Page_Load(object sender, EventArgs e)
        {
            if (View == null)
            {
                View = new DataView();
                View.Table = new DataTable("notes");
                View.Table.Columns.Add("id");
                View.Table.Columns.Add("title");
                View.Table.Columns.Add("body");
                View.Table.Columns.Add("tags");
                View.Table.Columns.Add("tagsFilter");
                View.Table.Columns.Add("created");
                View.Table.Columns.Add("modified");
            }

            if (!Page.IsPostBack)
            {
                List<Tag> tags = TagDA.GetAll();
                chkTags.DataSource = tags;
                chkTags.DataBind();

                chkEditTags.DataSource = tags;
                chkEditTags.DataBind();

                GetNotes();
                Rebind();

                this.chkAllNotes.Checked = true;
                chkAllNotes_CheckedChanged(sender, e);
            }
        }

        private void Rebind()
        {
            gvNotes.Caption = View.Count + " notes found.";
            gvNotes.DataSource = View;
            gvNotes.DataBind();
        }

        private void GetNotes()
        {
            View.Table.Clear();

            try
            {
                foreach (Note note in NoteDA.GetAll())
                {
                    View.Table.Rows.Add(
                        note.Id,
                        note.Title,
                        note.Body,
                        String.Join(", ", note.Tags.Select(t => t.Description).ToArray()),
                        "-" + String.Join("-", note.Tags.Select(t => t.Id).ToArray()) + "-",
                        note.Created,
                        note.Modified);
                }
            }
            catch (Exception ex)
            {
                Response.Write("An error occured: " + ex.Message);
            }
        }

        public static String FormatDateTime(Object dateTime)
        {
            DateTime local = ((DateTime)dateTime).ToLocalTime();
            return local.ToString("yyyy/MM/dd HH:mm");
        }

        protected void gvNotes_Sorting(object sender, GridViewSortEventArgs e)
        {
            string sortingDirection = string.Empty;
            if (direction == SortDirection.Ascending)
            {
                direction = SortDirection.Descending;
                sortingDirection = "Desc";
            }
            else
            {
                direction = SortDirection.Ascending;
                sortingDirection = "Asc";

            }
            View.Sort = e.SortExpression + " " + sortingDirection;

            Rebind();
        }

        protected void gvNote_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            gvNotes.PageIndex = e.NewPageIndex;

            Rebind();
        }

        private DataRow GetRow(int rowIndex)
        {
            return View.ToTable().Rows[5 * gvNotes.PageIndex + rowIndex];
        }

        public SortDirection direction
        {
            get
            {
                if (ViewState["directionState"] == null)
                {
                    ViewState["directionState"] = SortDirection.Ascending;
                }
                return (SortDirection)ViewState["directionState"];
            }
            set
            {
                ViewState["directionState"] = value;
            }
        }

        private void ShowNote(DataRow dr)
        {
            this.hddId.Value = string.Empty;
            this.txtTitle.Text = string.Empty;
            this.txtBody.Text = string.Empty;
            this.txtCreated.Text = string.Empty;
            this.txtModified.Text = string.Empty;
            foreach (ListItem item in chkEditTags.Items)
            {
                item.Selected = false;
            }
            if (dr != null)
            {
                this.hddId.Value = dr["id"] as string;
                this.txtTitle.Text = dr["title"] as string;
                this.txtBody.Text = dr["body"] as string;
                this.txtCreated.Text = dr["created"] as string;
                this.txtModified.Text = dr["modified"] as string;

                string selectedTags = dr["tagsFilter"] as string;
                foreach (ListItem item in chkEditTags.Items)
                {
                    item.Selected = selectedTags.Contains("-" + item.Value + "-");
                }
            }

            this.pnlEditDelete.Visible = true;
            this.pnlList.Visible = false;
        }

        private void HideNote()
        {
            this.pnlEditDelete.Visible = false;
            this.pnlList.Visible = true;
        }

        protected void btnAddNote_Click(object sender, EventArgs e)
        {
            this.lblEditDeleteTitle.InnerText = "Add new note";
            this.btnSave.Text = "Add";
            this.txtTitle.Enabled = true;
            this.txtBody.Enabled = true;
            this.chkEditTags.Enabled = true;

            ShowNote(null);
        }

        protected void gvNotes_RowEditing(object sender, GridViewEditEventArgs e)
        {
            DataRow dr = GetRow(e.NewEditIndex);

            this.lblEditDeleteTitle.InnerText = "Edit note " + dr["id"];
            this.btnSave.Text = "Save";
            this.txtTitle.Enabled = true;
            this.txtBody.Enabled = true;
            this.chkEditTags.Enabled = true;

            ShowNote(dr);
        }

        protected void gvNotes_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            DataRow dr = GetRow(e.RowIndex);

            this.lblEditDeleteTitle.InnerText = "Delete note " + dr["id"];
            this.btnSave.Text = "Confirm Delete";
            this.txtTitle.Enabled = false;
            this.txtBody.Enabled = false;
            this.chkEditTags.Enabled = false;

            ShowNote(dr);
        }

        protected void btnSave_Click(object sender, EventArgs e)
        {
            Note note = new Note
                        {
                            Id = String.IsNullOrEmpty(this.hddId.Value) ? -1 : Int32.Parse(this.hddId.Value),
                            Title = this.txtTitle.Text,
                            Body = this.txtBody.Text,
                            Tags = new List<Tag>()
                        };

            foreach (ListItem selectedTag in chkEditTags.Items.OfType<ListItem>().Where(i => i.Selected))
            {
                note.Tags.Add(new Tag { Id = Int32.Parse(selectedTag.Value), Description = selectedTag.Text });
            }

            switch (this.btnSave.Text)
            {
                case "Add":
                    {
                        NoteDA.Add(note);
                        break;
                    }
                case "Save":
                    {
                        NoteDA.Edit(note);
                        break;
                    }
                case "Confirm Delete":
                    {
                        NoteDA.Delete(note);
                        break;
                    }
            }

            GetNotes();
            Rebind();
            HideNote();
        }

        protected void btnCancel_Click(object sender, EventArgs e)
        {
            HideNote();
        }

        private void UpdateFilter()
        {
            var selectedTags = chkTags.Items.OfType<ListItem>().Where(i => i.Selected);
            View.RowFilter = String.Join(" OR ", selectedTags.Select(i => "tagsFilter LIKE '%-" + i.Value + "-%'").ToArray());
        }

        protected void chkAllNotes_CheckedChanged(object sender, EventArgs e)
        {
            if (chkAllNotes.Checked)
            {
                foreach (ListItem chk in chkTags.Items)
                {
                    chk.Selected = true;
                }

                UpdateFilter();
                Rebind();
            }
        }

        protected void chkTags_SelectedIndexChanged(object sender, EventArgs e)
        {
            UpdateFilter();
            Rebind();
        }
    }
}

Site.css

/*  Global classes  */
.DDMainHeader
{
    font: small-caps bold 1.6em Trebuchet MS, Arial, sans-serif;
    color:#888;
    padding-bottom: 12px;
    border-bottom: 1px dotted #bbbbbb;
}

.DDSubHeader
{
    margin-bottom: 10px;
    font:1.2em Trebuchet MS, Arial, sans-serif;
    color: #888;
}

.DD 
{
    padding: 0px 8px;
    font: .75em Tahoma, Arial, sans-serif;
    color: #666;
}

.DDLightHeader
{
    font-weight: bold;
    background-color: #F7F7FF;
}

.DDTextBox, .DDDropDown
{
    color: #666;
    font: .95em Tahoma, Arial, Sans-Serif;
    border: solid 1px #dcdcdc;
    background-color: #FEFEFE;
}

.DDDropDown
{
    padding:2px;
}

.DDFilter
{
    font: .95em Tahoma, Arial, Sans-serif;
    color:#666;
}

.DDControl
{
    padding: 0px;
    font: .95em Tahoma, Arial, Sans-Serif;
    color: #666;
}

.DDFloatLeft
{
    float:left;
}

.DDFloatRight
{
    float:right;
}

.DDFooter
{
    background-color: #dbddff;
}

.DDSelected
{
    background-color: #fdffb8;
}

div.DDNoItem
{
    color:Red;
    font-family:Trebuchet MS, Arial, sans-serif;
}

.DDValidator
{
    color:Red;
    font-family:Trebuchet MS, Arial, sans-serif;
}

/*  Navigation  */

div.DDNavigation
{
    font:.75em Tahoma, Arial, Sans-Serif;
    position: relative;
    top: -28px;
    margin-bottom: -10px;
    padding: 0px 5px;
}

div.DDNavigation img
{
    position: relative;
    margin-top: 0em;
    padding: 0px 8px;
    border: none;
    background-color: #fff;
}
div.DDNavigation a
{
    color: #839ce7;
    text-decoration: none;
    background-color: #fff;
    padding-right: 8px;
    top: -.2em;
    left: .25em;
}
div.DDNavigation a:hover
{
    color: #000099;
    text-decoration: underline !important;
}

/*  Details VIEW/EDIT   */
table.DDDetailsTable
{
    color: #666;
    background-color: #FCFDFE;
    border: 1px solid #dbddff;
    border-bottom-width: 3px;
}

table.DDDetailsTable a
{
    color:#718ABE;
    text-decoration: none;
    padding-right: 6px;
}

table.DDDetailsTable a:hover
{
    color: #000099;
    text-decoration: underline !important;
}

table.DDDetailsTable .td
{
    padding: 3px 6px;
    border: 1px solid #dbddff;
    border-bottom-style: dotted;
    font-size: .7em;
    font-family:Tahoma, Arial, Sans-Serif;
}

/*  DDGridView/DDListView   */
table.DDGridView, table.DDListView
{
    width: 100%;
    color: #666;
    border:solid 1px #dbddff;
    font: .7em Tahoma, Arial, Sans-Serif;
}

table.DDGridView .th, table.DDGridView .td, table.DDListView .th, table.DDListView .td
{
    white-space: nowrap;
}

table.DDGridView .th, table.DDListView .th
{
    background: url(DynamicData/Content/Images/header_back.gif) repeat-x;
    line-height:1.3em;
    text-align: left;
    font-size: 1em;
    border:solid 1px #dbddff;
}

table.DDGridView .th a, table.DDListView .th a
{
    color: #666;
    text-decoration: none;
}

table.DDGridView .td, table.DDListView .td
{
    border: dotted 1px #dbddff;
    border-left-width:0px;
    border-right-width:0px;
    padding: 6px;
}

table.DDGridView .td a, table.DDListView .td a
{
    color: #718ABE;
    text-decoration: none;
    margin-right: 6px;

}

table.DDGridView .DDSelected a, table.DDListView .DDSelected a
{
    color: #718ABE;
    text-decoration: none;
    margin-right: 6px;

}

table.DDGridView .DDSelected a:hover, table.DDListView .DDSelected a:hover
{
    color: #000099;
    text-decoration: underline;
}

table.DDGridView .td a:hover, table.DDListView .td a:hover
{
    color: #000099;
    text-decoration: underline;
}

/*  DataPager   */
div.DDPager
{
    padding: 0px 6px;
}

/* Bottom hyperlink design*/
div.DDBottomHyperLink
{   
    font: .75em Tahoma, Arial, Sans-Serif;
}
div.DDBottomHyperLink a
{
    color: #839ce7;
    text-decoration: none;
}
div.DDBottomHyperLink a:hover
{
    color: #000099;
    text-decoration: underline !important;
}
div.DDBottomHyperLink img
{
    padding-right: 5px;
    border: none;
}

Our tutors at programming homework help provide assistance to the learners so that they understand the concepts of coding in various languages of .net framework like C#, Visual Basic.Net, Jscript, J# in asp.net homework help.

NoteDA.cs

using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;

namespace mynotesasp
{
    public class Note
    {
        public int Id { get; set; }
        public string Title { get; set; }
        public string Body { get; set; }
        public DateTime Created { get; set; }
        public DateTime Modified { get; set; }
        public List<Tag> Tags { get; set; }
    }

    public static class NoteDA
    {
        public static List<Note> GetAll()
        {
            List<Note> res = new List<Note>();
            Dictionary<int, Tag> allTags = TagDA.GetAll().ToDictionary(t => t.Id);
            using (MySqlConnection connection = new MySqlConnection(ConfigurationManager.ConnectionStrings["MySQLConnStr"].ConnectionString))
            {
                connection.Open();
                using (MySqlCommand command = new MySqlCommand("SELECT * FROM notes", connection))
                {
                    using (MySqlDataReader dr = command.ExecuteReader())
                    {
                        while (dr.Read())
                        {
                            res.Add(new Note
                            {
                                Id = dr.GetInt32("id"),
                                Tags = GetTags(dr.GetInt32("id"), allTags),
                                Title = dr.GetString("title"),
                                Body = dr.GetString("body"),
                                Created = dr.GetDateTime("created"),
                                Modified = dr.GetDateTime("modified")
                            });
                        }
                        dr.Close();
                    }
                }
                connection.Close();
            }
            return res;
        }

        private static List<Tag> GetTags(int noteId, Dictionary<int, Tag> allTags)
        {
            List<Tag> res = new List<Tag>();
            using (MySqlConnection connection = new MySqlConnection(ConfigurationManager.ConnectionStrings["MySQLConnStr"].ConnectionString))
            {
                connection.Open();
                using (MySqlCommand command = new MySqlCommand("SELECT tagid FROM notetags WHERE noteId = " + noteId, connection))
                {
                    using (MySqlDataReader dr = command.ExecuteReader())
                    {
                        while (dr.Read())
                        {
                            res.Add(allTags[dr.GetInt32("tagid")]);
                        }
                        dr.Close();
                    }
                }
                connection.Close();
            }
            return res;
        }

        public static void Add(Note note)
        {
            using (MySqlConnection connection = new MySqlConnection(ConfigurationManager.ConnectionStrings["MySQLConnStr"].ConnectionString))
            {
                connection.Open();
                using (MySqlCommand command = new MySqlCommand("INSERT INTO notes(title, body) VALUES ('" + note.Title + "', '" + note.Body + "')", connection))
                {
                    command.ExecuteNonQuery();
                }
                using (MySqlCommand command = new MySqlCommand("SELECT last_insert_id()", connection))
                {
                    note.Id = Int32.Parse(command.ExecuteScalar().ToString());
                }
                AddTags(connection, note);
                connection.Close();
            }
        }

        public static void Edit(Note note)
        {
            using (MySqlConnection connection = new MySqlConnection(ConfigurationManager.ConnectionStrings["MySQLConnStr"].ConnectionString))
            {
                connection.Open();

                using (MySqlCommand command = new MySqlCommand("UPDATE notes SET title = '" + note.Title + "', body = '" + note.Body + "' WHERE id = " + note.Id, connection))
                {
                    command.ExecuteNonQuery();
                }

                DeleteAllTags(connection, note);
                AddTags(connection, note);
                connection.Close();
            }
        }

        public static void Delete(Note note)
        {
            using (MySqlConnection connection = new MySqlConnection(ConfigurationManager.ConnectionStrings["MySQLConnStr"].ConnectionString))
            {
                connection.Open();
                DeleteAllTags(connection, note);

                using (MySqlCommand command = new MySqlCommand("DELETE FROM notes WHERE id = " + note.Id, connection))
                {
                    command.ExecuteNonQuery();
                }
                connection.Close();
            }
        }

        private static void AddTags(MySqlConnection connection, Note note)
        {
            foreach (Tag tag in note.Tags)
            {
                using (MySqlCommand command = new MySqlCommand("INSERT INTO notetags(noteId, tagId) VALUES(" + note.Id + "," + tag.Id + ")", connection))
                {
                    command.ExecuteNonQuery();
                }
            }
        }

        private static void DeleteAllTags(MySqlConnection connection, Note note)
        {
            using (MySqlCommand command = new MySqlCommand("DELETE FROM notetags WHERE noteId = " + note.Id, connection))
            {
                command.ExecuteNonQuery();
            }
        }
    }
}

As a demonstration of a Asp project, this demonstrates the type of solution we can offer.

Students seek help with asp.net homework for solving questions related to exceptions, event handlings, delegates, etc. Our experts offer asp.net assignment help to the students by providing several assignment questions with proper solutions. Students also seek our help with asp.net assignment just because of our excellent service and accurate solutions.

Problem

You will create an application that collects data about the popularity of different types of
biscuit. The application must work on a Windows environment.

The application will contain a form that collects three pieces of information: the name of the
user, the type of biscuit, and a score marked out of 100. The biscuit types that scores can
be submitted for are: Digestive, Chocolate Digestive, Rich Tea, Ginger Nuts and Custard
Creams.

The application will permanently store this information. The application will also display a report for the
collected information. The report will give summaries for each biscuit type including the maximum, minimum
and average score and the total number of scores submitted. The report will also display all submitted scores
ranked by the score, highest first.

You will need to write the code to save the form data to the data store and fetch the data
for the report and display the report to the user. You should feel free to use development bases that you feel
are appropriate such as javascript, jquery or CSS baselines.

Solution

Biscuitscript.sql

USE [dbBiscuit]
GO
/****** Object:  Table [dbo].[BiscuitType]    Script Date: 09/17/2014 01:21:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[BiscuitType](
    [Id] [int] IDENTITY(1,1) NOT NULL,
    [Type] [varchar](50) NOT NULL,
 CONSTRAINT [PK_BiscuitType] PRIMARY KEY CLUSTERED 
(
    [Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[BiscuitData]    Script Date: 09/17/2014 01:21:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[BiscuitData](
    [Id] [int] IDENTITY(1,1) NOT NULL,
    [UserName] [varchar](100) NOT NULL,
    [BiscuitType] [int] NOT NULL,
    [Score] [int] NOT NULL,
 CONSTRAINT [PK_BiscuitData] PRIMARY KEY CLUSTERED 
(
    [Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  StoredProcedure [dbo].[sp_GetReportData]    Script Date: 09/17/2014 01:21:37 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[sp_GetReportData] 
AS
BEGIN
    SELECT bt.Type AS BiscuitType,AVG(bd.score) AS AverageScore, MAX(bd.score)AS MaxScore,
MIN(bd.score)AS Minscore, SUM(bd.score) AS Total 
FROM dbo.BiscuitData AS  bd INNER JOIN dbo.BiscuitType AS bt 
ON bd.BiscuitType= bt.Id
GROUP BY bt.Type ORDER BY MAX(bd.score) Desc
END
GO
/****** Object:  ForeignKey [FK_BiscuitData_BiscuitType]    Script Date: 09/17/2014 01:21:34 ******/
ALTER TABLE [dbo].[BiscuitData]  WITH CHECK ADD  CONSTRAINT [FK_BiscuitData_BiscuitType] FOREIGN KEY([BiscuitType])
REFERENCES [dbo].[BiscuitType] ([Id])
GO
ALTER TABLE [dbo].[BiscuitData] CHECK CONSTRAINT [FK_BiscuitData_BiscuitType]
GO

Report.aspx

<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="Report.aspx.cs" Inherits="BiscuitApp.Site.Report" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="article">
        <h2>
            <span>Report</span></h2>
        <div class="clr">
        </div>
        <p>
            The report will give summaries for each biscuit type including the maximum, minimum
            and average score and the total number of scores submitted
        </p>
    </div>
    <div class="article">
        <!--Repetaer Control For Showing Report Data-->
        <asp:Repeater runat="server" ID="rptReport">
            <HeaderTemplate>
                <table class="DataTable">
                    <tr>
                        <td>
                            Biscuit Type
                        </td>
                        <td>
                            Maximum Score
                        </td>
                        <td>
                            Minimum Score
                        </td>
                        <td>
                            Average Score
                        </td>
                        <td>
                            Total Score
                        </td>
                    </tr>
            </HeaderTemplate>
            <ItemTemplate>
                <tr>
                    <td>
                        <%#Eval("BiscuitType")%>
                    </td>
                    <td>
                        <%#Eval("MaxScore")%>
                    </td>
                    <td>
                        <%#Eval("Minscore")%>
                    </td>
                    <td>
                        <%#Eval("AverageScore")%>
                    </td>
                    <td>
                        <%#Eval("Total")%>
                    </td>
                </tr>
            </ItemTemplate>
            <FooterTemplate>
                </table>
            </FooterTemplate>
        </asp:Repeater>
        <!--End-->
    </div>
</asp:Content>

Report.aspx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BiscuitApp.Data;

namespace BiscuitApp.Site
{
    public partial class Report : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                BindGrid();
            }
        }

        /// <summary>
        /// Method  for bind the report grid
        /// </summary>
        void BindGrid()
        {
            List<sp_GetReportDataResult> _reportData =  Repository.GetReportData();
            rptReport.DataSource = _reportData;
            rptReport.DataBind();
        }
    }
}

Register.aspx

<%@ Page Title="Register" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="Register.aspx.cs" Inherits="BiscuitApp.Account.Register" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <asp:CreateUserWizard ID="RegisterUser" runat="server" EnableViewState="false" OnCreatedUser="RegisterUser_CreatedUser">
        <LayoutTemplate>
            <asp:PlaceHolder ID="wizardStepPlaceholder" runat="server"></asp:PlaceHolder>
            <asp:PlaceHolder ID="navigationPlaceholder" runat="server"></asp:PlaceHolder>
        </LayoutTemplate>
        <WizardSteps>
            <asp:CreateUserWizardStep ID="RegisterUserWizardStep" runat="server">
                <ContentTemplate>
                    <h2>
                        Create a New Account
                    </h2>
                    <p>
                        Use the form below to create a new account.
                    </p>
                    <p>
                        Passwords are required to be a minimum of <%= Membership.MinRequiredPasswordLength %> characters in length.
                    </p>
                    <span class="failureNotification">
                        <asp:Literal ID="ErrorMessage" runat="server"></asp:Literal>
                    </span>
                    <asp:ValidationSummary ID="RegisterUserValidationSummary" runat="server" CssClass="failureNotification" 
                         ValidationGroup="RegisterUserValidationGroup"/>
                    <div class="accountInfo">
                        <fieldset class="register">
                            <legend>Account Information</legend>
                            <p>
                                <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User Name:</asp:Label>
                                <asp:TextBox ID="UserName" runat="server" CssClass="textEntry"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName" 
                                     CssClass="failureNotification" ErrorMessage="User Name is required." ToolTip="User Name is required." 
                                     ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
                            </p>
                            <p>
                                <asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email">E-mail:</asp:Label>
                                <asp:TextBox ID="Email" runat="server" CssClass="textEntry"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="EmailRequired" runat="server" ControlToValidate="Email" 
                                     CssClass="failureNotification" ErrorMessage="E-mail is required." ToolTip="E-mail is required." 
                                     ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
                            </p>
                            <p>
                                <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label>
                                <asp:TextBox ID="Password" runat="server" CssClass="passwordEntry" TextMode="Password"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password" 
                                     CssClass="failureNotification" ErrorMessage="Password is required." ToolTip="Password is required." 
                                     ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
                            </p>
                            <p>
                                <asp:Label ID="ConfirmPasswordLabel" runat="server" AssociatedControlID="ConfirmPassword">Confirm Password:</asp:Label>
                                <asp:TextBox ID="ConfirmPassword" runat="server" CssClass="passwordEntry" TextMode="Password"></asp:TextBox>
                                <asp:RequiredFieldValidator ControlToValidate="ConfirmPassword" CssClass="failureNotification" Display="Dynamic" 
                                     ErrorMessage="Confirm Password is required." ID="ConfirmPasswordRequired" runat="server" 
                                     ToolTip="Confirm Password is required." ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
                                <asp:CompareValidator ID="PasswordCompare" runat="server" ControlToCompare="Password" ControlToValidate="ConfirmPassword" 
                                     CssClass="failureNotification" Display="Dynamic" ErrorMessage="The Password and Confirmation Password must match."
                                     ValidationGroup="RegisterUserValidationGroup">*</asp:CompareValidator>
                            </p>
                        </fieldset>
                        <p class="submitButton">
                            <asp:Button ID="CreateUserButton" runat="server" CommandName="MoveNext" Text="Create User" 
                                 ValidationGroup="RegisterUserValidationGroup"/>
                        </p>
                    </div>
                </ContentTemplate>
                <CustomNavigationTemplate>
                </CustomNavigationTemplate>
            </asp:CreateUserWizardStep>
        </WizardSteps>
    </asp:CreateUserWizard>
</asp:Content>

Register.aspx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace BiscuitApp.Account
{
    public partial class Register : System.Web.UI.Page
    {

        protected void Page_Load(object sender, EventArgs e)
        {
            RegisterUser.ContinueDestinationPageUrl = Request.QueryString["ReturnUrl"];
        }

        protected void RegisterUser_CreatedUser(object sender, EventArgs e)
        {
            FormsAuthentication.SetAuthCookie(RegisterUser.UserName, false /* createPersistentCookie */);

            string continueUrl = RegisterUser.ContinueDestinationPageUrl;
            if (String.IsNullOrEmpty(continueUrl))
            {
                continueUrl = "~/";
            }
            Response.Redirect(continueUrl);
        }

    }
}

ChangePassword.aspx

<%@ Page Title="Change Password" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="ChangePassword.aspx.cs" Inherits="BiscuitApp.Account.ChangePassword" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h2>
        Change Password
    </h2>
    <p>
        Use the form below to change your password.
    </p>
    <p>
        New passwords are required to be a minimum of <%= Membership.MinRequiredPasswordLength %> characters in length.
    </p>
    <asp:ChangePassword ID="ChangeUserPassword" runat="server" CancelDestinationPageUrl="~/" EnableViewState="false" RenderOuterTable="false" 
         SuccessPageUrl="ChangePasswordSuccess.aspx">
        <ChangePasswordTemplate>
            <span class="failureNotification">
                <asp:Literal ID="FailureText" runat="server"></asp:Literal>
            </span>
            <asp:ValidationSummary ID="ChangeUserPasswordValidationSummary" runat="server" CssClass="failureNotification" 
                 ValidationGroup="ChangeUserPasswordValidationGroup"/>
            <div class="accountInfo">
                <fieldset class="changePassword">
                    <legend>Account Information</legend>
                    <p>
                        <asp:Label ID="CurrentPasswordLabel" runat="server" AssociatedControlID="CurrentPassword">Old Password:</asp:Label>
                        <asp:TextBox ID="CurrentPassword" runat="server" CssClass="passwordEntry" TextMode="Password"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="CurrentPasswordRequired" runat="server" ControlToValidate="CurrentPassword" 
                             CssClass="failureNotification" ErrorMessage="Password is required." ToolTip="Old Password is required." 
                             ValidationGroup="ChangeUserPasswordValidationGroup">*</asp:RequiredFieldValidator>
                    </p>
                    <p>
                        <asp:Label ID="NewPasswordLabel" runat="server" AssociatedControlID="NewPassword">New Password:</asp:Label>
                        <asp:TextBox ID="NewPassword" runat="server" CssClass="passwordEntry" TextMode="Password"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="NewPasswordRequired" runat="server" ControlToValidate="NewPassword" 
                             CssClass="failureNotification" ErrorMessage="New Password is required." ToolTip="New Password is required." 
                             ValidationGroup="ChangeUserPasswordValidationGroup">*</asp:RequiredFieldValidator>
                    </p>
                    <p>
                        <asp:Label ID="ConfirmNewPasswordLabel" runat="server" AssociatedControlID="ConfirmNewPassword">Confirm New Password:</asp:Label>
                        <asp:TextBox ID="ConfirmNewPassword" runat="server" CssClass="passwordEntry" TextMode="Password"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="ConfirmNewPasswordRequired" runat="server" ControlToValidate="ConfirmNewPassword" 
                             CssClass="failureNotification" Display="Dynamic" ErrorMessage="Confirm New Password is required."
                             ToolTip="Confirm New Password is required." ValidationGroup="ChangeUserPasswordValidationGroup">*</asp:RequiredFieldValidator>
                        <asp:CompareValidator ID="NewPasswordCompare" runat="server" ControlToCompare="NewPassword" ControlToValidate="ConfirmNewPassword" 
                             CssClass="failureNotification" Display="Dynamic" ErrorMessage="The Confirm New Password must match the New Password entry."
                             ValidationGroup="ChangeUserPasswordValidationGroup">*</asp:CompareValidator>
                    </p>
                </fieldset>
                <p class="submitButton">
                    <asp:Button ID="CancelPushButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel"/>
                    <asp:Button ID="ChangePasswordPushButton" runat="server" CommandName="ChangePassword" Text="Change Password" 
                         ValidationGroup="ChangeUserPasswordValidationGroup"/>
                </p>
            </div>
        </ChangePasswordTemplate>
    </asp:ChangePassword>
</asp:Content>

ASP assignment help is a jewel in the crown of our offerings. The experts that provide ASP homework help are excellent programmers  hence they are fully capable of providing high quality code. Students seeking ASP project help can approach us for quick assistance.