When I choose an element from DropDownList, I want a TexBox to disappear and to be replaced by another one in the same exact position.
For example: I have a DropDownList filled with categories of SI equipments, Laptop, Desktop, Display etc. So when I choose Display, the RAM, CPU, HARD DISK textboxes must disappear and INCH TextBox should replace RAM TextBox.
This is my code:
<div>
<label id="l1" class="label" >Numéro de série:</label>
<asp:TextBox ID="NumSerie" CssClass="textbox" runat="server" Height="32px" Width="200px" />
<label id="l8" class="label"> Systeme d'exploitation: </label>
<asp:TextBox ID="SystemEx" CssClass="textbox" runat="server" Height="32px" Width="200px" />
<asp:Button class="NButton" ID="Button1" runat="server" Height="38px" Text="Ajouter" Width="140px" OnClick="Button1_Click" />
</div>
<div>
<label id="l2" class="label">Désignation:</label>
<asp:TextBox ID="Designation" CssClass="textbox" runat="server" Height="32px" Width="200px" />
<label id="l9" class="label"> Processeur:</label>
<asp:TextBox ID="Cpu" CssClass="textbox" runat="server" Height="32px" Width="200px" />
<asp:Button CssClass="NButton" ID="Button2" runat="server" Height="38px" Text="Modifier" Width="140px" />
</div>
<div>
<label id="l3" class="label">
<asp:TextBox ID="Marque" CssClass="textbox" runat="server" Height="32px" Width="200px" />
<label id="l10" class="label">Ram: </label>
<asp:TextBox ID="Ram" CssClass="textbox" runat="server" Height="32px" Width="200px" />
<asp:Button CssClass="NButton" ID="Button3" runat="server" Height="38px" Text="Supprimer" Width="140px" />
</div>
<div>
<label id="l4" class="label">
<br />
Catégorie:</label>
<asp:DropDownList ID="IdCategorie" CssClass="textbox" runat="server" Height="32px" Width="200px"/>
<label id="l11" class="label"> Capacité destockage:</label>
<asp:TextBox ID="CapaciteSt" CssClass="textbox" runat="server" Height="32px" Width="200px" />
<asp:Button CssClass="NButton" ID="Button4" runat="server" Height="38px" Text="Rechercher" Width="140px" />
</div>
<div>
<label id="l5" class="label">
<br />
Code de fournisseur:</label>
<asp:DropDownList ID="CodeFour" CssClass="textbox" runat="server" Height="32px" Width="200px" />
<label id="l12" class="label"></label>
<asp:TextBox ID="Remise" class="textbox" runat="server" Height="32px" Width="200px" />
<asp:Label ID="l15" runat="server" CssClass="label" Text="ID Equi:"></asp:Label>
<asp:TextBox CssClass="Rtextbox" ID="TextBox1" runat="server" Height="22px" Width="70px"></asp:TextBox>
</div>
<div>
<label id="l6" class="label"></label>
<asp:TextBox ID="Prix" CssClass="textbox" runat="server" Height="32px" Width="200px" />
<label id="l13" class="label">Modele </label>
<asp:TextBox Id="Modele" CssClass="textbox" runat="server" Height="32px" Width="200px" />
</div>
<div>
<label id="l7" class="label"> </label>
<asp:TextBox ID="EtatGarantie" CssClass="textbox" runat="server" Height="32px" Width="200px" />
<label id="l14" class="label"></label>
<asp:TextBox ID="Pouces" CssClass="textbox" runat="server" Height="32px" Width="200px" />
</div>
<asp:Button CssClass="NButton" ID="Button5" runat="server" Text="<<" Width="55px" />
There is no need to replace the textbox. but it depends on if different selected items have different number of texboxes.
First set on your DropDownList AutoPostBack="true" then
You can simply change the placeholde runtime on SelectedIndexChanged of DropDownList like this
protected void ddlProducts_SelectedIndexChanged(object sender, EventArgs e)
{
txtDOB.Attributes.Add("placeholder", ddlProducts.SelectedItem.Text);
}
you can use same textbox for any item you selected.
Related
I'm trying to implement UpdatePanels and UpdateProgress controls. I have two UpdatePanels that contain two different DropDownLists (ddlQuestion5IDs and ddlQuestion6IDs).
When I change the selected index of ddlQuestion6IDs, the UpdateProgress loads for both UpdatePanels/DropDownLists. Is this how they normally behave and is there a way of only displaying the corresponding UpdateProgress for each UpdatePanel?
<p>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="Label6" runat="server" Text="Question 5:" Font-Bold="true"></asp:Label>
<br />
<asp:DropDownList ID="ddlQuestion5IDs" runat="server" OnSelectedIndexChanged="ddlQuestion5IDs_SelectedIndexChanged" AutoPostBack="true"></asp:DropDownList>
<asp:UpdateProgress ID="UpdateProgress1" runat="server" DynamicLayout="true">
<ProgressTemplate>
<img src="images/loader.gif" height="20" />
</ProgressTemplate>
</asp:UpdateProgress>
<br />
<asp:Label ID="Label19" runat="server" Text="Question type:" Font-Italic="true"></asp:Label>
<br />
<asp:Label ID="lblQuestion5Type" runat="server" Text=""></asp:Label>
<br /><br />
<asp:Label ID="Label22" runat="server" Text="Question:" Font-Italic="true"></asp:Label>
<br />
<asp:Label ID="lblQuestion5" runat="server" Text=""></asp:Label>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ddlQuestion5IDs" EventName="SelectedIndexChanged"/>
</Triggers>
</asp:UpdatePanel>
</p>
<p>
<asp:UpdatePanel ID="UpdatePanel2" runat="server" ChildrenAsTriggers="False" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="Label7" runat="server" Text="Question 6:" Font-Bold="true"></asp:Label>
<br />
<asp:DropDownList ID="ddlQuestion6IDs" runat="server" OnSelectedIndexChanged="ddlQuestion6IDs_SelectedIndexChanged" AutoPostBack="true"></asp:DropDownList>
<asp:UpdateProgress ID="UpdateProgress2" runat="server" DynamicLayout="true">
<ProgressTemplate>
<img src="images/loader.gif" height="20" />
</ProgressTemplate>
</asp:UpdateProgress>
<br />
<asp:Label ID="Label21" runat="server" Text="Question type:" Font-Italic="true"></asp:Label>
<br />
<asp:Label ID="lblQuestion6Type" runat="server" Text=""></asp:Label>
<br /><br />
<asp:Label ID="Label24" runat="server" Text="Question:" Font-Italic="true"></asp:Label>
<br />
<asp:Label ID="lblQuestion6" runat="server" Text=""></asp:Label>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ddlQuestion6IDs" EventName="SelectedIndexChanged"/>
</Triggers>
</asp:UpdatePanel>
</p>
By adding a AssociatedUpdatePanelID="UpdatePanelID" property to UpdateProgress
when i put RequiredFieldValidator in asp.net page then it disturbs page layout. It works in all places but in specific places it disturbs page layout.
Before Putting Validator:
<asp:Panel ID="pnlSearchComplaint" Visible="false" BackColor="#dbdbdb"
runat="server" Width="400px">
<br />
<label>Search By Subject</label>
<asp:TextBox ID="txtSearchCompBySubject" runat="server" ></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server"
ControlToValidate="txtSearchCompBySubject" ErrorMessage="Enter Subject"
ForeColor="Red" ValidationGroup="GroupSearchCompSubject">Enter Subject
</asp:RequiredFieldValidator>
<br/>
<asp:Button ID="btnSearchBySubject" ValidationGroup="GroupSearchCompSubject"
CssClass="btn btn-success" runat="server" Text="Search"
ClientIDMode="Static" OnClick="btnSearchBySubject_Click" />
<asp:GridView ID="gridViewComplaintsBySubject" AllowPaging="true" OnPageIndexChanging="gridViewComplaintsBySubject_PageIndexChanging" AutoGenerateSelectButton="true" runat="server" CssClass="mGrid" OnSelectedIndexChanged="gridViewComplaintsBySubject_SelectedIndexChanged" Width="408px">
<EmptyDataRowStyle BorderStyle="None" ForeColor="Red" BorderWidth="0px" />
<EmptyDataTemplate>
No Data Found for this Input. Try Again.
</EmptyDataTemplate>
<SelectedRowStyle CssClass="selected-row" ForeColor="white" />
</asp:GridView>
<br />
<label>Search By Date</label>
<asp:Label ID="lblDateFrom" runat="server" Text="From"></asp:Label>
<asp:TextBox ID="txtFromDate" runat="server" ></asp:TextBox>
<asp:CalendarExtender ID="CalendarExtenderFromDate" TargetControlID="txtFromDate" runat="server">
</asp:CalendarExtender>
<asp:Label ID="lblDateTo" runat="server" Text="To"></asp:Label>
<asp:TextBox ID="txtToDate" runat="server"></asp:TextBox>
<asp:CalendarExtender ID="CalendarExtenderToDate" TargetControlID="txtToDate" runat="server">
</asp:CalendarExtender>
<asp:Button ID="btnSearchByDate" CssClass="btn btn-success" runat="server" Text="Search"
ClientIDMode="Static" OnClick="btnSearchByDate_Click" />
<asp:GridView ID="gridViewComplaintsByDate" AllowPaging="true" AutoGenerateSelectButton="true" runat="server" CssClass="mGrid" Width="408px" OnPageIndexChanging="gridViewComplaintsByDate_PageIndexChanging" OnSelectedIndexChanged="gridViewComplaintsByDate_SelectedIndexChanged">
<EmptyDataRowStyle BorderStyle="None" ForeColor="Red" BorderWidth="0px" />
<EmptyDataTemplate>
No Data Found for this Input. Try Again.
</EmptyDataTemplate>
<SelectedRowStyle CssClass="selected-row" ForeColor="white" />
</asp:GridView>
<br />
</asp:Panel>
After Putting Validator:
Code:
<asp:Panel ID="pnlSearchComplaint" Visible="false" BackColor="#dbdbdb"
runat="server" Width="400px">
<br />
<label>Search By Subject</label>
<asp:TextBox ID="txtSearchCompBySubject" runat="server" ></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server"
ControlToValidate="txtSearchCompBySubject" ErrorMessage="Enter Subject"
ForeColor="Red" ValidationGroup="GroupSearchCompSubject">Enter Subject
</asp:RequiredFieldValidator>
<br/>
<asp:Button ID="btnSearchBySubject" ValidationGroup="GroupSearchCompSubject"
CssClass="btn btn-success" runat="server" Text="Search"
ClientIDMode="Static" OnClick="btnSearchBySubject_Click" />
<asp:GridView ID="gridViewComplaintsBySubject" AllowPaging="true" OnPageIndexChanging="gridViewComplaintsBySubject_PageIndexChanging" AutoGenerateSelectButton="true" runat="server" CssClass="mGrid" OnSelectedIndexChanged="gridViewComplaintsBySubject_SelectedIndexChanged" Width="408px">
<EmptyDataRowStyle BorderStyle="None" ForeColor="Red" BorderWidth="0px" />
<EmptyDataTemplate>
No Data Found for this Input. Try Again.
</EmptyDataTemplate>
<SelectedRowStyle CssClass="selected-row" ForeColor="white" />
</asp:GridView>
<br />
<label>Search By Date</label>
<asp:Label ID="lblDateFrom" runat="server" Text="From"></asp:Label>
<asp:TextBox ID="txtFromDate" runat="server" ></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server"
ControlToValidate="txtFromDate" ErrorMessage="Enter Subject"
ForeColor="Red" ValidationGroup="GroupSearchCompSubject">Enter Subject
</asp:RequiredFieldValidator>
<asp:CalendarExtender ID="CalendarExtenderFromDate" TargetControlID="txtFromDate" runat="server">
</asp:CalendarExtender>
<asp:Label ID="lblDateTo" runat="server" Text="To"></asp:Label>
<asp:TextBox ID="txtToDate" runat="server"></asp:TextBox>
<asp:CalendarExtender ID="CalendarExtenderToDate" TargetControlID="txtToDate" runat="server">
</asp:CalendarExtender>
<asp:Button ID="btnSearchByDate" CssClass="btn btn-success" runat="server" Text="Search"
ClientIDMode="Static" OnClick="btnSearchByDate_Click" />
<asp:GridView ID="gridViewComplaintsByDate" AllowPaging="true" AutoGenerateSelectButton="true" runat="server" CssClass="mGrid" Width="408px" OnPageIndexChanging="gridViewComplaintsByDate_PageIndexChanging" OnSelectedIndexChanged="gridViewComplaintsByDate_SelectedIndexChanged">
<EmptyDataRowStyle BorderStyle="None" ForeColor="Red" BorderWidth="0px" />
<EmptyDataTemplate>
No Data Found for this Input. Try Again.
</EmptyDataTemplate>
<SelectedRowStyle CssClass="selected-row" ForeColor="white" />
</asp:GridView>
<br />
</asp:Panel>
Please set the "Display='dynamic'" property in your Validation control.
<asp:RequiredFieldValidator Display="Dynamic"></asp:RequiredFieldValidator>
If you do not want disturb your UI when it shows the message then
<asp:RequiredFieldValidator Display="Dynamic" ErrorMessage="*" ToolTip="Set your message here"></asp:RequiredFieldValidator>
Edit 1:
<label>
Search By Date</label>
<asp:Label ID="lblDateFrom" runat="server" Text="From"></asp:Label>
<asp:TextBox ID="txtFromDate" runat="server"></asp:TextBox>
<asp:Label ID="lblDateTo" runat="server" Text="To"></asp:Label>
<asp:TextBox ID="txtToDate" runat="server"></asp:TextBox>
<div>
<asp:RequiredFieldValidator Display="Dynamic" ID="RequiredFieldValidator9" runat="server" ControlToValidate="txtFromDate"
ErrorMessage="Enter Subject" ForeColor="Red" ValidationGroup="GroupSearchCompSubject">Enter Subject
</asp:RequiredFieldValidator>
</div>
<asp:Button ID="btnSearchByDate" CssClass="btn btn-success" runat="server" Text="Search"
ClientIDMode="Static" />
I am creating a shopping cart web app for my class. When the user clicks on the add to cart button, I want to pass the value of the ID of each specific product to a separate method in the code behind. Not sure if my syntax is off or if this just wont work. Here is my mark up:
<asp:Button ID="AddToCart" CommandName="Add"
OnClientClick ='<%# ListView1_AddToCart(Eval("ID"))%>'
CssClass ="Button" runat="server" Text="Add to Cart" />
Here is my code behind:
public void ListView1_AddToCart(string CatID)
{cart.AddToCart(CatID);}
I keep getting various issues, but this gives me the following error:
The best overloaded method match for 'OurCats_GrumpyCats.ListView1_AddToCart(string)'
has some invalid arguments.
How can I resolve this? Is there any better way?
EDIT: Here is my mark up
<%# Page Title="All Cats" Language="C#" MasterPageFile="~/MasterPage/Layout.master" AutoEventWireup="true" CodeFile="AllCats.aspx.cs" Inherits="OurCats_GrumpyCats" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpMainContent" Runat="Server">
<h1>Meet all of our kittens!</h1>
<asp:ListView ID="ListView1" runat="server" DataKeyNames="ID" DataSourceID="SqlDataSource2">
<EmptyDataTemplate>
<span>No data was returned.</span>
</EmptyDataTemplate>
<InsertItemTemplate>
<span style="">ID:
<asp:TextBox ID="IDTextBox" runat="server" Text='<%# Bind("ID") %>' />
<br />
Name:
<asp:TextBox ID="NameTextBox" runat="server" Text='<%# Bind("Name") %>' />
<br />
Price:
<asp:TextBox ID="PriceTextBox" runat="server" Text='<%# Bind("Price") %>' />
<br />
Imgu:
<asp:TextBox ID="ImguTextBox" runat="server" Text='<%# Bind("Img") %>' />
<br />
Description:
<asp:TextBox ID="DescriptionTextBox" runat="server" Text='<%# Bind("Description") %>' />
<br />
<asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="Insert" />
<asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Clear" />
<br />
<br />
</span>
</InsertItemTemplate>
<ItemTemplate>
<table class ="Table" style="border-style: solid; ">
<tr>
<td >
<a href ="Details.aspx?ID=<%# Eval("ID")%>">
<img src="../Images/<%# Eval("Img") %>" width ="200" />
</a>
</td>
<td style="width:700px; margin-left: 100px">
<asp:Label ID="Label1" runat="server" Text="Name: "></asp:Label><asp:Label ID="NameLabel" runat="server" Text='<%# Eval("Name") %>' />
<asp:Textbox ID="CatID" runat="server" Visible="false" Text='<%# Eval("ID")%>'></asp:Textbox>
<br />
<br />
<asp:Label ID="Label2" runat="server" Text="Price: $"></asp:Label><asp:Label ID="PriceLabel" runat="server" Text= '<%# Eval("Price") %>'/>
<br />
<br />
<asp:Label ID="Label3" runat="server" Text="Description: "></asp:Label><asp:Label ID="DescriptionLabel" runat="server" Text= '<%# Eval("Description") %>' />
<br />
<br />
<asp:Button ID="AddToCart" CommandName="Add" OnClientClick='<%# "AddToCart(" +Eval("ID") + " );" %>' CssClass ="Button" runat="server" Text="Add to Cart" />
</td>
</tr>
</table>
</ItemTemplate>
<LayoutTemplate>
<div id="itemPlaceholderContainer" runat="server" style =" margin-left :30px;">
<span runat="server" id="itemPlaceholder" />
</div>
<div style="">
</div>
</LayoutTemplate>
</asp:ListView>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:420_Project_GLConnectionString1 %>" SelectCommand="SELECT * FROM [OurCats]">
</asp:SqlDataSource>
</asp:Content>
try below code
<asp:Button ID="AddToCart" CommandName="Add"
OnClientClick ='<%# ListView1_AddToCart((string)Eval("ID"))%>'
CssClass ="Button" runat="server" Text="Add to Cart" />
OnClientClick ='<%# "ListView1_AddToCart(" +Eval("ID") + " );" %>'
I have 2 radio button (radiobtn1 and radiobtn2) in one group and 4 text box which names are a, b, c, d. And end of the page there is standard button. I add asp:requiredFieldValidators to all of textboxes. So when I clicked my button asp:validationsummary works for all of textboxes.
I want to do that if radiobtn1 was clicked, validationsummary should work for textbox a and b, if radiobtn2 was clicked, validationsummary should work for should textbox c and d.
how can I do that?
thx.
this is working as of your requirement..
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<br />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TextBox1" ErrorMessage="*" Font-Size="Medium" ForeColor="Red" ValidationGroup="group 1">*</asp:RequiredFieldValidator>
<br />
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
<br />
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="TextBox2" ErrorMessage="*" Font-Size="Medium" ForeColor="Red" ValidationGroup="group 1">*</asp:RequiredFieldValidator>
<br />
<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
<br />
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="TextBox3" ErrorMessage="*" Font-Size="Medium" ForeColor="Red" ValidationGroup="group 2">*</asp:RequiredFieldValidator>
<br />
<asp:TextBox ID="TextBox4" runat="server"></asp:TextBox>
<br />
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="TextBox4" ErrorMessage="*" Font-Size="Medium" ForeColor="Red" ValidationGroup="group 2">*</asp:RequiredFieldValidator>
<br />
<br />
<br />
<br />
<br />
<asp:RadioButton ID="RadioButton1" runat="server" AutoPostBack="True" Text="valid first 2" CausesValidation="True" GroupName="g" ValidationGroup="group 1"/>
<asp:RadioButton ID="RadioButton2" runat="server" AutoPostBack="True" Text="valid last 2" CausesValidation="True" GroupName="g" ValidationGroup="group 2" />
<br />
<br />
</div>
</form>
Edit:
Current layout:
Im trying to work out how within my ASP webpage design I can posistion a div (server side) under another div.
To my question further I'll use the following screenshots:
Currently this is my layout:
I want to position 2 more div one under another to give me a 'title' div and a 'description' div tat will later be populated by my database results, as shown:
This is my current source code. Can someone push me in the right direction of how i go about implementing these divs one of top of another like this?
<%# Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Show.aspx.cs" Inherits="ViewCDs.Show" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div style=" float:left;">
<asp:Image ID="Image1" runat="server" Height="145px" ViewStateMode="Enabled"
Width="185px" />
</div>
<div style=" float:left; width: 395px; height: 140px;">
<asp:FormView ID="FormView1" runat="server">
<EditItemTemplate>
coffeeName:
<asp:TextBox ID="coffeeNameTextBox" runat="server"
Text='<%# Bind("coffeeName") %>' />
<br />
coffeeOrigin:
<asp:TextBox ID="coffeeOriginTextBox" runat="server"
Text='<%# Bind("coffeeOrigin") %>' />
<br />
coffeeStrength:
<asp:TextBox ID="coffeeStrengthTextBox" runat="server"
Text='<%# Bind("coffeeStrength") %>' />
<br />
coffeeGrind:
<asp:TextBox ID="coffeeGrindTextBox" runat="server"
Text='<%# Bind("coffeeGrind") %>' />
<br />
coffeePrice:
<asp:TextBox ID="coffeePriceTextBox" runat="server"
Text='<%# Bind("coffeePrice") %>' />
<br />
coffeeQty:
<asp:TextBox ID="coffeeQtyTextBox" runat="server"
Text='<%# Bind("coffeeQty") %>' />
<br />
coffeeRRP:
<asp:TextBox ID="coffeeRRPTextBox" runat="server"
Text='<%# Bind("coffeeRRP") %>' />
<br />
<asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True"
CommandName="Update" Text="Update" />
<asp:LinkButton ID="UpdateCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel" Text="Cancel" />
</EditItemTemplate>
<InsertItemTemplate>
coffeeName:
<asp:TextBox ID="coffeeNameTextBox" runat="server"
Text='<%# Bind("coffeeName") %>' />
<br />
coffeeOrigin:
<asp:TextBox ID="coffeeOriginTextBox" runat="server"
Text='<%# Bind("coffeeOrigin") %>' />
<br />
coffeeStrength:
<asp:TextBox ID="coffeeStrengthTextBox" runat="server"
Text='<%# Bind("coffeeStrength") %>' />
<br />
coffeeGrind:
<asp:TextBox ID="coffeeGrindTextBox" runat="server"
Text='<%# Bind("coffeeGrind") %>' />
<br />
coffeePrice:
<asp:TextBox ID="coffeePriceTextBox" runat="server"
Text='<%# Bind("coffeePrice") %>' />
<br />
coffeeQty:
<asp:TextBox ID="coffeeQtyTextBox" runat="server"
Text='<%# Bind("coffeeQty") %>' />
<br />
coffeeRRP:
<asp:TextBox ID="coffeeRRPTextBox" runat="server"
Text='<%# Bind("coffeeRRP") %>' />
<br />
<asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True"
CommandName="Insert" Text="Insert" />
<asp:LinkButton ID="InsertCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel" Text="Cancel" />
</InsertItemTemplate>
<ItemTemplate>
<b>Origin:</b>
<asp:Label ID="coffeeOriginLabel" runat="server"
Text='<%# Bind("coffeeOrigin") %>' />
<br />
<br />
<b>Grind:</b>
<asp:Label ID="coffeeGrindLabel" runat="server"
Text='<%# Bind("coffeeGrind") %>' />
<br />
<br />
<b>Price: £</b>
<asp:Label ID="coffeePriceLabel" runat="server"
Text='<%# Bind("coffeePrice") %>' />
<br />
<br />
<b>Strength:</b>
<asp:Label ID="coffeeStrengthLabel" runat="server"
Text='<%# Bind("coffeeStrength") %>' />
<br />
<br />
<b>Stock Level:</b>
<asp:Label ID="coffeeQtyLabel" runat="server" Text='<%# Bind("coffeeQty") %>' />
<br />
</ItemTemplate>
</asp:FormView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:CoffeeConnectionString %>"
SelectCommand="SELECT [coffeeName], [coffeeOrigin], [coffeeStrength], [coffeeGrind], [coffeePrice], [coffeeQty], [coffeeRRP] FROM [Coffees]">
</asp:SqlDataSource>
<br />
</div>
<div style=" float:left; width: 339px; height: 140px;">
<br />
<div style=" float:left; width: 165px; height: 25px;">
<b><asp:Label ID="Label1" runat="server" Text="Select Coffee Grind:"></asp:Label> </b>
</div>
<div style=" float:right; width: 165px; height: 25px;">
<asp:DropDownList ID="DropDownList1" runat="server" Height="21px" Width="161px">
<asp:ListItem>Beans</asp:ListItem>
<asp:ListItem>Smooth</asp:ListItem>
<asp:ListItem>Course</asp:ListItem>
</asp:DropDownList>
</div>
<div style=" float:left; width: 165px; height: 40px;">
<br />
<b><asp:Label ID="Label2" runat="server" Text="Quantity:"></asp:Label></b>
</div>
<div style=" float:right; width: 165px; height: 40px;">
<br />
<asp:TextBox ID="TextBox1" runat="server" Width="40px">1</asp:TextBox>
</div>
<div style=" float:left; width: 165px; height: 40px;">
<br />
<asp:Button ID="Button1" runat="server" Text="Buy" />
</div>
</div>
You would simply need to add two more divs beneath that code.
<div id="title"> </div> <br/>
<div id="description"> </div> <br/>
However if you would like to control their attributes such as visibility then you would just need to make those asp.net panels.
<asp:Panel runat="server" ID="title"> </asp:Panel> <br/>
<asp:Panel runat="server" ID="description"> </asp:Panel> <br/>