473,503 Members | 2,166 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

A strange issue!

I have a repeater that displays records from a database.

All fairly straight forward with the repeater binding to a dataset, and a
datacommand filling the dataset from the database. The only complication is
that the data displayed can come from either of two stored procedures
according to a checkbox selection. If you check the checkbox the page uses
one data command to get data from the database and if you don't check the
checkbox then the page uses a different datacommand to provide a different
set of data but to the same dataset. Both sets of data fit the same template
and therefore is correctly laid out by the repeater (in fact the data comes
from the same database table).

The complication is that one of the fields in the repeater is a textbox with
the Text value bound to the date value from the dataset. As a result the
repeater provides the date value in the text box (which can later be used
for editing).

<asp:repeater id="repJobs" runat="server" enableviewstate="False"
onitemcommand="Job_Detail" DataMember="LiveJobs" DataSource="<%# dsManJobs
%>">
<itemtemplate>
<tr>
<td><asp:linkbutton id="link" runat="server" commandname="JobID"
commandargument='<%# DataBinder.Eval(Container, "DataItem.JobID") %>' >
<asp:Literal ID="litID" Text='<%# DataBinder.Eval(Container,
"DataItem.JobID") %>' Runat="server" ></asp:Literal></asp:linkbutton></td>
<td><%# DataBinder.Eval(Container, "DataItem.Title") %></td>
<td class="right"><%# DataBinder.Eval(Container, "DataItem.Name") %></td>
<td class="center"><asp:TextBox id="txtMassDate" runat="server" Width="75px"
Text='<%# DataBinder.Eval(Container, "DataItem.AddStop", "{0:d/MM/yyyy}")
%>'></asp:TextBox></td>
<td class="center"><asp:CheckBox id="chkDelete"
runat="server"></asp:CheckBox></td></tr>
</itemtemplate>
<headertemplate></headertemplate>
<footertemplate></table></footertemplate>
</asp:repeater>

The problem is that although when you load the first set of data, everything
works correctly with the correct dates displayed, when you then check the
checkbox and repost the page to view the alternative data the dates in the
textbox's displayed are those from the earlier page? I know the data in the
dataset is correct as when i bind a datagrid to the same dataset the data in
the grid is displayed with the correct dates for either set of data etc. I
have tried turning off the viewstate on the checkbox but this doesn't appear
to make any difference!

Any suggestions?

Martyn Fewtrell
mf*******@networkclub.co.uk
Nov 18 '05 #1
2 1178
This is a silly question but do have a Page.IsPostBack check around your Databind() method in page_load? Because if you do have that and then don't rebind your repeater on postback, like in the checkbox.OnClick event, it won't be getting rebound

-J
Nov 18 '05 #2
Thanks for your input - know question is to silly!

There is a page is post back clause that chooses the appropriate routine to
run to load the correct data into the dataset according to the checkbox
selection. The repeater is then bound to the dataset. I assume anyway that
if this was not the case then the other elements in the repeater like the
link button and the name wouldn't load correctly and these do all display
the correct data and function correctly.

I assume that the issue is something to do with the binding on the textbox
(something that I haven't done before in this context).

Martyn Fewtrell
mf*******@networkclub.co.uk
"John Linn" <an*******@discussions.microsoft.com> wrote in message
news:22**********************************@microsof t.com...
This is a silly question but do have a Page.IsPostBack check around your Databind() method in page_load? Because if you do have that and then don't
rebind your repeater on postback, like in the checkbox.OnClick event, it
won't be getting rebound.
-J

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

25
3696
by: Neil Ginsberg | last post by:
I have a strange situation with my Access 2000 database. I have code in the database which has worked fine for years, and now all of a sudden doesn't work fine on one or two of my client's...
2
1193
by: Joneleth | last post by:
Hi I was writing some aspx pages when i experimented a strange issue. I have a div tag like this: <div id="divCourses1" style="<%=GetDisplayStyle(eidlevel, arrIdLevel)%>"> Now, as long as i...
2
1098
by: BinaryMonk | last post by:
Ok, this makes absolutely no sense to me, so I am hoping that someone here will have run across this issue as well. I have a pretty simple PHP script. which essentially just selects and displays...
3
1520
by: Vish4u | last post by:
Hello Everyone, I have a encountered a strange issue with the execution of my stored procedure on clients machine. My stored procedure contains a cursor in which there is a select statement...
3
6718
by: Max Vit | last post by:
I have come across a strange issue whilst trying to use a shell command call from Access and have spent some time trying to figure this out but can't find the cause as yet. The issue is: I need...
0
7205
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7011
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7468
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5023
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4689
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3170
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1521
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
747
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.