vs 2005 migration problems

D

DS

I am trying to migrate a vs 2003 asp.net application to vs 2005 and am
having many problems. After dealing with 300+ compile errors after
conversion now I have many run time error. I lot of them seem to be
related to client script problems. Does vs 2005 handle client script
differently than 2003?

One of my problems is that some of my control events are not being
called. For example I have a textbox control:
<asp:textbox id=txtDate tabIndex="3" runat="server" Height="19px"
CssClass="textboxreadonly" Width="130px" MaxLength="10"
ReadOnly="True">

In client script I have this sub that is no longer being called after
the conversion:
sub txtDate_OnChange
document.frmTaskDetails.hDueDateChanged.Value =
document.frmTaskDetails.txtDate.value
EnableCmdSave()
end sub

I then tried to add this to my asp:textbox tag:
onChange="txtDate_OnChange"

And it's still will not working.
Any help would be greatly appreciated.
Thanks in advance for all help!!!!
Deidre
 
S

sirfunusa

Well you know you have runat="server" so your onchange is going to run
server side.
 
D

DS

I want it to do both. In vs 2003 it did both. First it check for client
events then server events.
It seems to be working for some of my other textboxes. It seems to have
something to do with this textbox not being manually entered by the
user. It has a calendar popup that is passing back a data that I am
using to value the textbox in this client sub:
sub SetDateNHidePopUp (dtDate)
document.all.ifrmCalendar.style.visibility = "hidden"
if IsDate(dtDate) then
Select Case miDateField
Case enuDUEDATE
document.frmTaskDetails.txtDate.value = dtDate

Case enuCLOSEDATE
document.frmTaskDetails.txtClosedDate.value = dtDate
End Select

end sub
 
D

DS

I figured it out. I had to change my textbox readonly property from
true to false and handle my readonly on client events. Apparently if
you make a textbox in vs2005 readonly it does return changes to the
server or call client script on events.
Hope this helps someone else.
Deidre
 
D

DS

Now I have another problem. Now that I changed the textbox to
readonly=false. I added script to the client onpaste, onchange,
onkeypress to window.event.keycode = 0. But it's still allowing me to
delete and paste in the textbox. I tried setting enabled property to
true but I don't like that it makes the text gray. Is there any way to
override that or a client script to stop the delete and pasting?
Thanks for helping.
Deidre
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,816
Latest member
nipsseyhussle

Latest Threads

Top