By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,685 Members | 1,243 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,685 IT Pros & Developers. It's quick & easy.

too much spaces with Repeater control

P: n/a
Hi,

i use a repeater control for reading data from a database.
I have no error, but the table for showing the records defined in this code,
starts at the middle of the page. I noticed that the unasked space above the
table matchs the number of records in the table, as if the data were read
twice ...

Thanks for help
Bart

Here my code:

<form id="form1" runat="server">
<table width=100%><tr>
<asp:Repeater ID="Repeater1" runat="server"
DataSourceID="SqlDataSource1">
<ItemTemplate>
<tr>
<td><asp:Label ID="Label1" runat="server" Text='<%#
Eval("name") %>'></asp:Label><br /></td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
</form>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT [name] FROM [logo]"></asp:SqlDataSource>

May 31 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Try removing the very first opening <trafter <table>.

On 31 May, 18:56, "Bart" <b@swrote:
Hi,

i use a repeater control for reading data from a database.
I have no error, but the table for showing the records defined in this code,
starts at the middle of the page. I noticed that the unasked space above the
table matchs the number of records in the table, as if the data were read
twice ...

Thanks for help
Bart

Here my code:

<form id="form1" runat="server">
<table width=100%><tr>
<asp:Repeater ID="Repeater1" runat="server"
DataSourceID="SqlDataSource1">
<ItemTemplate>
<tr>
<td><asp:Label ID="Label1" runat="server" Text='<%#
Eval("name") %>'></asp:Label><br /></td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
</form>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT [name] FROM [logo]"></asp:SqlDataSource>

Jun 1 '07 #2

P: n/a
<form id="form1" runat="server">
> <table width=100%><tr>
<asp:Repeater ID="Repeater1" runat="server"
DataSourceID="SqlDataSource1">
<ItemTemplate>
> <tr>

There seems to be an HTML issue here... You have a <trinside <tr>

Remove the first "<tr>"!

--
Happy Hacking,
Gaurav Vaish | www.mastergaurav.com
www.edujini-labs.com
http://eduzine.edujini-labs.com
-----------------------------------------
Jun 5 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.