TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sharanya M Sharu
NA
1
1k
how to calculate total in datalist by adding label box value
Apr 6 2015 1:49 PM
hello, I'm displaying cart by using datalist. How do I add the price of all the products displaying in the datalist. pls help.
this is the design of my datalist
<asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource2">
<ItemTemplate>
<table style="width:100%;">
<tr>
<td class="style5" style="font-size: x-large; font-weight: 700">
<asp:Label ID="Label2" runat="server" Text='<%# Eval("Brand") %>'></asp:Label>
</td>
<td class="style6">
Total Amout to paid</td>
<td>
<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/close.png"
onclick="ImageButton1_Click" />
</td>
</tr>
<tr>
<td class="style5">
<asp:Image ID="Image1" runat="server" Height="146px"
ImageUrl='<%# Eval("Image") %>' Width="133px" />
</td>
<td class="style6">
Rs.<asp:Label ID="Label3" runat="server" Text='<%# Eval("Price") %>'></asp:Label>
</td>
<td>
</td>
</tr>
<tr>
<td class="style5">
<asp:Label ID="Label1" runat="server" Text='<%# Eval("Modelid") %>'></asp:Label>
</td>
<td class="style6">
</td>
<td>
</td>
</tr>
<tr>
<td class="style3" style="text-align: right">
<b>Total</b></td>
<td class="style4">
<b>Rs.<asp:Label ID="Label4" runat="server" Text='<%# Eval("Price") %>'></asp:Label>
</b>
</td>
<td>
</td>
</tr>
<tr>
<td class="style3" style="text-align: left">
</td>
<td class="style4">
<asp:Button ID="Button1" runat="server" Text="PROCEED" onclick="Button1_Click" CommandArgument='<%# Eval("Modelid") %>' CommandName="Proceed"
style="font-weight: 700" />
</td>
<td>
</td>
</tr>
<tr>
<td class="style3" style="text-align: left">
</td>
<td class="style4">
</td>
<td>
</td>
</tr>
</table>
<br />
</ItemTemplate>
</asp:DataList>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:VISHConnectionString8 %>"
SelectCommand="SELECT * FROM [cart] WHERE ([uname] = @uname)">
<SelectParameters>
<asp:SessionParameter Name="uname" SessionField="UN" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:VISHConnectionString8 %>"
SelectCommand="SELECT * FROM [cart] WHERE ([Modelid] = @Modelid)">
<SelectParameters>
<asp:SessionParameter Name="Modelid" SessionField="modelid" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
Reply
Answers (
0
)
automatically capture snap shot and store database in c#
C# GUI program