473,569 Members | 2,573 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="Liv eJobs" DataSource="<%# dsManJobs
%>">
<itemtemplate >
<tr>
<td><asp:linkbu tton id="link" runat="server" commandname="Jo bID"
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.AddSt op", "{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*******@netwo rkclub.co.uk
Nov 18 '05 #1
2 1182
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.OnClic k 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*******@netwo rkclub.co.uk
"John Linn" <an*******@disc ussions.microso ft.com> wrote in message
news:22******** *************** ***********@mic rosoft.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.OnClic k 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
3705
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 machines. The code opens MS Word through Automation and then opens a particular Word doc. It's still working fine on most machines; but on one or two of...
2
1199
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 don't switch the page to HTML into Design everything works fine. But if i switch the page into Design and therefore into HTML again, then all the...
2
1106
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 data out of the database. When I run the script, the page just hangs forever when it gets to about the 40th record. The strange part is that when I...
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 written in concatinated string format (provided below). when i execute the procedure on my clients database some concatinated lines in the select...
3
6725
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 to execute a command call from within Access to execute a batch file (sample.bat). To do this, we use the Shell function, something like: Shell...
0
7701
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7615
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8130
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7677
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5219
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2115
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 we have to send another system
0
940
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.