Sunday, January 17, 2010

databing sample code11 html

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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table>
<caption>
<strong>Order Form</strong></caption>
<tr>
<td style="width: 100px">
<strong>
Customer Id</strong></td>
<td style="width: 100px">
<asp:TextBox ID="TxtCustId" runat="server"></asp:TextBox></td>
<td style="width: 100px">
</td>
<td style="width: 100px">
</td>
</tr>
<tr>
<td style="width: 100px">
<strong>Order Id</strong></td>
<td style="width: 100px">
<asp:TextBox ID="TxtOrdId" runat="server"></asp:TextBox></td>
<td style="width: 100px">
</td>
<td style="width: 100px">
</td>
</tr>
<tr>
<td style="width: 100px">
<strong>
Order Date</strong></td>
<td style="width: 100px">
<asp:TextBox ID="TxtOrdDate" Text="<%# Today %>" runat="server"></asp:TextBox></td>
<td style="width: 100px">
</td>
<td style="width: 100px">
</td>
</tr>
<tr>
<td style="width: 100px">
<strong>
Product Name</strong></td>
<td style="width: 100px">
<asp:TextBox ID="TxtProdName" Text="<%# ProdList.SelectedItem.ToString()%>" runat="server" Enabled="False" OnTextChanged="TxtProdName_TextChanged"></asp:TextBox></td>
<td style="width: 100px">
<asp:DropDownList ID="ProdList" runat="server" Width="83px" OnSelectedIndexChanged="ProdList_SelectedIndexChanged" AutoPostBack="True">
</asp:DropDownList></td>
<td style="width: 100px">
</td>
</tr>
<tr>
<td style="width: 100px">
<strong>
Quantity</strong></td>
<td style="width: 100px">
<asp:TextBox ID="TxtQauntity" runat="server" OnTextChanged="TxtQauntity_TextChanged"></asp:TextBox></td>
<td style="width: 100px">
<asp:Button ID="BtnDiscount" runat="server" Text="Calculate Discount" OnClick="BtnDiscount_Click" /></td>
<td style="width: 100px">
&nbsp;
<asp:Label ID="LblDiscount" runat="server" Text='<%# "Discount: " +CalculateDiscount() %>' Height="15px" Width="76px" ></asp:Label>
</tr>
<tr>
<td style="width: 100px; height: 21px">
<strong>
Price</strong></td>
<td style="width: 100px; height: 21px">
<asp:TextBox ID="TxtPrice" runat="server" Text="<%#ProdList.SelectedValue.ToString() %>"></asp:TextBox></td>
<td style="width: 100px; height: 21px">
</td>
<td style="width: 100px; height: 21px">
</td>
</tr>
<tr>
<td style="width: 100px">
<strong>
Amount</strong></td>
<td style="width: 100px">
<asp:TextBox ID="TxtAmt" runat="server" Text="<%# Convert.ToString(Convert.ToInt16(TxtQauntity.Text) * Convert.ToInt16(TxtPrice.Text) - Convert.ToInt16(TxtQauntity.Text))%>"></asp:TextBox></td>
<td style="width: 100px">
<asp:Button ID="BtnAmt" runat="server" Text="Calculate Amount" OnClick="BtnAmt_Click" /></td>
<td style="width: 100px">
</td>
</tr>
<tr>
<td style="width: 100px">
</td>
<td style="width: 100px">
<asp:Button ID="BtnSubmit" runat="server" Text="Submit" OnClick="BtnSubmit_Click" /></td>
<td style="width: 100px">
</td>
<td style="width: 100px">
</td>
</tr>
<tr>
<td style="width: 100px; height: 21px;">
</td>
<td style="width: 100px; height: 21px;">
<asp:Label ID="LblMessage" runat="server" Text='<%# "You Have Entered:" + TxtProdName.Text %>' Width="150px"></asp:Label></td>
<td style="width: 100px; height: 21px;">
</td>
<td style="width: 100px; height: 21px;">
</td>
</tr>
</table>

</div>
</form>
</body>
</html>

No comments:

Post a Comment