|
rep1 is the parent repeater and inside this, there are two child repeaters rep2 and rep3. i used rep2 to show the information of the items along with its amount. I used rep3 to show the total amount of the items.
code is still look like this:
<asp:Repeater runat="server" id="rep1">
<HeaderTemplate><b>Books</b><br /></HeaderTemplate>
<ItemTemplate>
<b><%# DataBinder.Eval(Container.DataItem, "Mathematics") %>
<asp:Repeater id="rep2" runat="server">
<HeaderTemplate>
<asp:Table ID="tblLists" runat="server">
<asp:TableRow>
<asp:TableCell>BookName</asp:TableCell>
<asp:TableCell>Amount</asp:TableCell>
</asp:TableRow>
</asp:Table>
</HeaderTemplate>
<ItemTemplate>
<asp:Table ID="tblListItems" runat="server">
<asp:TableRow>
<asp:TableCell><%# DataBinder.Eval(Container.DataItem, "BookName")%></asp:TableCell>
<asp:TableCell>$<%# DataBinder.Eval(Container.DataItem,"Amount")%></asp:TableCell>
</asp:TableRow>
</asp:Table>
</ItemTemplate>
</asp:Repeater>
<asp:Repeater ID="rep3" runat="server">
<ItemTemplate>
<asp:Table ID="tblTotal" runat="server">
<asp:TableRow>
<asp:TableCell></asp:TableCell>
<asp:TableCell></asp:TableCell>
<asp:TableCell></asp:TableCell>
<asp:TableCell>$<%# DataBinder.Eval(Container.DataItem, "TotalAmount") %></asp:TableCell>
</asp:TableRow>
</asp:Table>
</ItemTemplate>
</asp:Repeater>
</ItemTemplate>
<FooterTemplate>
</FooterTemplate>
<separatortemplate>
<br /><br /><br />
</separatortemplate>
</asp:Repeater>
I wanted to show something like this:
Books
BookName Amount
Eng Math $25
basic Math $40
Inter Math $60
$125
But it is showing like this:
Books
$
BookName Amount
Eng Math $25
basic Math $40
Inter Math $60
$125
$
$
$
Well, If i take out "$" from the code, display doesn't have any problem but I need to show that "$" sign before the amount and it gives that display problem. I tried to show total amount table of rep3 in its headerTemplate but that doesn't sound good. Any ideas on this kind of error ?
suchita
|
|
|
|
|
Yes your code still looks like that. And that is a bad thing. Lack of proper indentation makes it hard to read. And you still have extra table cells for no reason. I don't know where the dollar signs are coming from since they aren't in your code. If you need to format something as currency don't just slap a dollar sign in there, use a formatString. Another thing, since you aren't doing any real manipulation of the table rows or cells you don't need the server side control versions of the table elements. You can use just the regular HTML tags. If the problem is with the dollar signs, then show us the code with the dollar signs. Showing us the code that doesn't have the problem is pointless. Throw out what you have and restart with what is below.
<asp:Repeater runat="server" ID="rep1">
<HeaderTemplate>
<b>Books</b><br />
</HeaderTemplate>
<ItemTemplate>
<b>
<%# DataBinder.Eval(Container.DataItem, "Mathematics") %>
<asp:Repeater ID="rep2" runat="server">
<HeaderTemplate>
<table id="tblLists">
<tr>
<td>Book Name</td>
<td>Amount</td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<table id="tblListItems">
<tr>
<td><%# DataBinder.Eval(Container.DataItem, "BookName")%></td>
<td>$<%# DataBinder.Eval(Container.DataItem,"Amount")%></td>
</tr>
</table>
</ItemTemplate>
</asp:Repeater>
<asp:Repeater ID="rep3" runat="server">
<ItemTemplate>
<table id="tblTotal">
<tr>
<td>$<%# DataBinder.Eval(Container.DataItem, "TotalAmount") %></td>
</tr>
</table>
</ItemTemplate>
</asp:Repeater>
</ItemTemplate>
<FooterTemplate>
</FooterTemplate>
<SeparatorTemplate>
<br />
<br />
<br />
</SeparatorTemplate>
</asp:Repeater>
|
|
|
|
|
<asp:Repeater runat="server" id="rep1">
<HeaderTemplate><b>Books</b><br /></HeaderTemplate>
<ItemTemplate>
<b><%# DataBinder.Eval(Container.DataItem, "Mathematics") %>
<asp:Repeater id="rep2" runat="server">
<HeaderTemplate>
<asp:Table ID="tblLists" runat="server">
<asp:TableRow>
<asp:TableCell>BookName</asp:TableCell>
<asp:TableCell>Amount</asp:TableCell>
</asp:TableRow>
</asp:Table>
</HeaderTemplate>
<ItemTemplate>
<asp:Table ID="tblListItems" runat="server">
<asp:TableRow>
<asp:TableCell><%# DataBinder.Eval(Container.DataItem, "BookName")%></asp:TableCell>
<asp:TableCell>$<%# DataBinder.Eval(Container.DataItem,"Amount")%></asp:TableCell>
</asp:TableRow>
</asp:Table>
</ItemTemplate>
</asp:Repeater>
<asp:Repeater ID="rep3" runat="server">
<ItemTemplate>
<asp:Table ID="tblTotal" runat="server">
<asp:TableRow>
<asp:TableCell></asp:TableCell>
<asp:TableCell></asp:TableCell>
<asp:TableCell></asp:TableCell>
<asp:TableCell>$<%# DataBinder.Eval(Container.DataItem, "TotalAmount") %></asp:TableCell>
</asp:TableRow>
</asp:Table>
</ItemTemplate>
</asp:Repeater>
</ItemTemplate>
<FooterTemplate>
</FooterTemplate>
<separatortemplate>
<br /><br /><br />
</separatortemplate>
</asp:Repeater>
Lines
<asp:TableCell>$<%# DataBinder.Eval(Container.DataItem,"Amount")%></asp:TableCell>
and
<asp:TableCell>$<%# DataBinder.Eval(Container.DataItem, "TotalAmount") %></asp:TableCell>
have the $ signs. Its the same code that i posted up.
thanks
suchita
|
|
|
|
|
Read the documentation[^] to find out how to format databound items. I am too frustrated with your refusal to use good formatting despite being given both formatted code and keystrokes to format it yourself to provide any further help on this topic.
|
|
|
|
|
Thank you Gray.
<asp:TableCell><%# DataBinder.Eval(Container.DataItem,"Amount","{0:c}") %></asp:TableCell>
this one worked out. Well I didnt know we can format the string in ascx page. now its working. thanks a lot.
suchita
|
|
|
|
|
FindAndReplace method applied for Word 2007 in C#.net Windows Application not running in Windows Server 2003
It is giving me problem at below mentioned point
_aDoc.Content.Find.Replacement.ClearFormatting();
Please suggest me the Requirement for the same.
Any Help.Its urgent
Thanks,
Harish Devadiga
|
|
|
|
|
Hai,
I have a girdview in an aspx page and if I click the EDIT button inside that gridview, it will open a particular page in an iframe. How can I get the values of the textboxes inside that page that already in an iframe from the main page that the grid is placed.
If anyone can help me please help me
|
|
|
|
|
|
Is there any reason you are doing screen scraping rather than getting the data behind the scenes? This sounds very phishy. Make sure you aren't violating the terms of use of whatever site you are bringing up in the iframe.
|
|
|
|
|
You can pass the textbox values in querystring in the IFrame or you can use
window.parent.document.getElementById("textboxID").value
|
|
|
|
|
Hi All ,
i hope every one has seen google calender to schedule appointment.
i want same thing in my web application i can buy this calender from Telerik and other provider.
but is it possible to make it free by using Google Api i have already tried googling it but with no result
can u guys provide me sample if u have done this befoe.
regards,
Amit
|
|
|
|
|
hi mates,
is it possible to have a calendar popup in a showmodaldialog?
i have tried the code but doesn't work. it will not fire the calendar button to show the calendar.
i call the showdialog.aspx in when i click a button in my parent.aspx
parent.aspx
<script type="text/javascript" language="JavaScript">
function ShowPopup(){
window.showModalDialog("~/page/showdialog.aspx", "Dialog",
"dialogWidth:100px;dialogHeight:130px;");
}
</script>
<asp:Button ID="btnPrint" TabIndex="23" runat="server" CssClass="Button" Width="100px"
Text="Print" OnClientClick="ShowPopup" > </asp:Button>
showdialog.aspx
<asp:TextBox ID="txtReportDate" runat="server" Width="67px">2010/07/20</asp:TextBox>
<img src="../images/SmallCalendar.gif" border="0"></td>
<td style="width: 48px"><a href="javascript:;" onclick="window.open('calendar.aspx?textbox=txtReportDate','cal','width=220,height=200,left=760,top=180')">
note: the calendar is working if it is not in a showmodaldialog.
C# コードMicrosoft End User
2000-2008
「「「「「「「「「「「「「「「「「「「「「「「「「「「「
The best things in life are free
」」」」」」」」」」」」」」」」」」」」」」」」」」」」
|
|
|
|
|
|
Why are you opening an intermediate page instead of just opening the calendar page in your modal call? I think your problem is that when you open the modal it isn't a window, its a dialog. So calls to things like window.open don't apply.
|
|
|
|
|
@Keith Barrow thanks but i didn't use ajax thing.
old school coding. hehehe..
@T M Gray
got it, i replace window.open from window.showmodaldialog.
thank you.
another thing, why is it my treeview not keeping the state when i navigate to another page. i search to google and i have this site
http://forums.asp.net/t/1022893.aspx[^]
but the problem is still wont keep the treeview. i dont use datasource but i use nodes.
<Nodes>
<asp:TreeNode Text="Main Menu" Value="MainMenu">
<asp:TreeNode Text="Analysis Order" Value="AnalysisOrder">
<asp:TreeNode Text="New Analysis" NavigateUrl ="~/page/FrmBunsekiOrder.aspx" Value="NewOrder">
</asp:TreeNode>
<asp:TreeNode Text="Analysis" NavigateUrl ="~/page/FrmBunsekiOrderSentaku.aspx" Value="ModOrder">
</asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode Text="Certificate" NavigateUrl ="~/page/FrmSuishituShumeisho.aspx" Value="Certificate">
</asp:TreeNode>
<asp:TreeNode Text="Laboratory" NavigateUrl ="~/page/FrmBunsekiSearch.aspx" Value="LAS">
</asp:TreeNode>
</asp:TreeNode>
</Nodes>
C# コードMicrosoft End User
2000-2008
「「「「「「「「「「「「「「「「「「「「「「「「「「「「
The best things in life are free
」」」」」」」」」」」」」」」」」」」」」」」」」」」」
|
|
|
|
|
i wanna implement a webservice dat will syncronise wit my gmail and also with my yahoo acount. pls caould any1help mewit the source codes
|
|
|
|
|
Abdulhafeezo wrote: i wanna implement a webservice dat will syncronise wit my gmail and also with my yahoo acount.
Joo may use RSS.
Abdulhafeezo wrote: pls caould any1help mewit the source codes
ShoDawg, hep bein found heyah.
|
|
|
|
|
D00D tha's fly maaan.
ragnaroknrol The Internet is For Porn[^]
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.
|
|
|
|
|
|
I hope you know enough ASP.Net so that when someone hands you the "codes" and it contains a backdoor that forwards all your e-mail somewhere else you can spot it before they get all your Benjamins (or more likely considering your writing style, your Washingtons).
|
|
|
|
|
Hello Guys, I am new in ASP.net and faced with few questions.
Could you please some one explain, why we need to have multiple Controller in ASP.Net MVC?
what is the advantages of having different controllers?
I know the purpose of home controller. I was looking at a project which developed by ASP.net MVC2. they have different controller such as Users, Store Management and the like?
the question is how come they use different controller?
|
|
|
|
|
You can as many controllers are you need. Using separate controllers allows for code to be separated logically, just as any good OOD would do. In this case methods that pertain to Users don't have to be placed in the Home controller. Otherwise you would end up with a monolithic, unwieldy class.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
hi..
I have created a rdlc in asp .net web application.When project runs,by clicking a button,report appears.But there is a problem.When only the
maximise button is clicked,that window will become maximise..I need that when page is loaded,it became in maximised form.Pls help me..There
is not any property such as" window state" for aspx page.Pls help me
|
|
|
|
|
You can use JavaScript to set it. You can do it like this:
<script language="javascript">
window.moveTo(0,0);
window.resizeTo(screen.availWidth, screen.availHeight);
</script>
|
|
|
|
|
Thanks a lot..It works...
|
|
|
|