 |
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|

August 29th, 2006, 07:30 AM
|
Registered User
|
|
Join Date: Mar 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Events not firing in IE
I've got a datalist which uses an update button to trigger the updatecommand
It works fine in Firefox, but when the same page is loaded in IE, the update button does nothing (also the logout button on the same page doesn't work)
The strange thing is that it does fire for some records, but most do nothing
Any ideas what might be going on?
|

August 29th, 2006, 07:41 AM
|
Wrox Author
|
|
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
|
|
I have had a similiar problem using the EditItemCommand in Datagrids, though I ended up fixing the problem I can't remember what it was. (It was something extremely trivial)
What is the difference between the rows that work and the rows that don't?
Does the entire control work 100% correctly in Firefox?
What is the logout button doing/calling?
"The one language all programmers understand is profanity."
|

August 29th, 2006, 08:51 AM
|
Registered User
|
|
Join Date: Mar 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
thanks for your salient questions
i looked at the difference in records, and it appears the problem is being caused by the date textbox fields
when the DataBinder.Eval(Container.DataItem,"DepDate") is used to fill the textbox, there is a 00:00:00 inserted after the date (eg 29/09/2006 00:00:00 instead of the 29/09/2006 that is stored in the db)
when i remove the offending 00's, the update button fires
do i need to fill the textbox with some date format function?
|

August 29th, 2006, 09:38 AM
|
Wrox Author
|
|
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
|
|
Do something like this.
DateTime tempDT;
tempDT = dr["Edate"];
dr["EDate"] = String.Format(tempDT, "MM/dd/yyyy");
That should give you just the mmddyyy.
hth
"The one language all programmers understand is profanity."
|

August 29th, 2006, 10:00 AM
|
Registered User
|
|
Join Date: Mar 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
thanks- that should work, but it seems an unnecessary bit of code.
i would have though that a date would be displayed in the same way as in the db when bound to a textbox control.
would debugging have picked up on this problem?
|

August 29th, 2006, 10:26 AM
|
Wrox Author
|
|
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
|
|
here is the thing:
I use a SQL Server 2000 backend to all of my applications, very rarely do I capture both the Date and Time of a specific action, I am more concerned with the date; problem is SQL Server stores the Date and time in one field as opposed to splitting it up so that if you send in a date value and no time, SQL sets the time field to its default (00:00:00:000). You have 2 options to return just the date information from a datetime field:
1. You can do something pragmatically in code like I have show you above
or
2. You can do something like this inside of your SQL Syntax/Stored Procedure:
convert(varchar(10), [datefield], 101)
which will return mm/dd/yyyy
Otherwise just doing a SELECT [datefield] From Table will return:
mm/dd/yyyy hh:mm:ss
and it will be displayed on your page as such.
hth
"The one language all programmers understand is profanity."
|

August 29th, 2006, 01:18 PM
|
Registered User
|
|
Join Date: Mar 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
thanks again- it's unlikely i'll have this issue again knowing this (although i'm actually using an access database)
even so, it is strange that the browser should make any difference (the problem records updated ok in firefox)
|

August 29th, 2006, 01:32 PM
|
Wrox Author
|
|
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
|
|
A strange error indeed, but I have no insight as to why.
"The one language all programmers understand is profanity."
|
|
 |