|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
custom validator and button eventsI have a program with a textbox, customvalidator and button. <asp:TextBox ID="txtName" Runat="server" MaxLength="30" AutoPostBack="True" CausesValidation="True"></asp:TextBox> <asp:CustomValidator ID="CVltxtNombre" Runat="server" ControlToValidate="txtName" Display="Dynamic" OnServerValidate="CVltxtNombre_ServerValidate"asp:CustomValidator> <asp:Button ID="btnGo" Runat="server" Text="Go" OnClick="btnGo_Click" /> I have this: Sub CVltxtNombre_ServerValidate(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs) Try If.... Then End If Catch ex As Exception args.IsValid = False End Try End Sub Sub btnAceptar_Click(ByVal sender As Object, ByVal e As System.EventArgs) If Page.IsValid Then InsertarDatos() End If End Sub I want to save in Database the textbox.text. If I want to modify one database record, I get the record and put it in the textbox. When I change the textbox.text and press button go, goes to CVltxtNombre_ServerValidate event because it has been a change. But after this it doesn't go to btnGo_Click event. Why? If Page.IsValid is true, why doesn't it go to Button event? Is this a 2005 Beta 1 bug? Can any help me?? I'm using .NET 2005 beta 1. Thanks I just tried to reproduce your situation and it seems to work for me. I'm
running the 2005 Feb CTP. Is there any more info that might help us find out why it's not working? -Brock DevelopMentor http://staff.develop.com/ballen Show quoteHide quote > Hi, > I have a program with a textbox, customvalidator and button. > <asp:TextBox ID="txtName" Runat="server" MaxLength="30" > AutoPostBack="True" CausesValidation="True"></asp:TextBox> > <asp:CustomValidator ID="CVltxtNombre" Runat="server" > ControlToValidate="txtName" Display="Dynamic" > OnServerValidate="CVltxtNombre_ServerValidate"asp:CustomValidator> > <asp:Button ID="btnGo" Runat="server" Text="Go" OnClick="btnGo_Click" > /> > I have this: > Sub CVltxtNombre_ServerValidate(ByVal source As Object, ByVal args As > System.Web.UI.WebControls.ServerValidateEventArgs) > Try > If.... Then > End If > Catch ex As Exception > args.IsValid = False > End Try > End Sub > Sub btnAceptar_Click(ByVal sender As Object, ByVal e As > System.EventArgs) > If Page.IsValid Then > InsertarDatos() > End If > End Sub > I want to save in Database the textbox.text. If I want to modify one > database record, I get the record and put it in the textbox. When I > change the textbox.text and press button go, goes to > CVltxtNombre_ServerValidate event because it has been a change. But > after this it doesn't go to btnGo_Click event. Why? If Page.IsValid is > true, why doesn't it go to Button event? Is this a 2005 Beta 1 bug? > Can any help me?? I'm using .NET 2005 beta 1. Thanks > Hi, Brock, thanks again for answering me. I'm downloading 2005 Feb
CTP. I forgot 1 thing, I have to change the textbox.text and click the button without doing tab or enter. So, to save textbox.text in Database I have to click twice the button and I want to do it in one click. First click goes to CVltxtNombre_ServerValidate event but doesn't go to btnGo event. Second click goes to CVltxtNombre_ServerValidate event and then to btnGo event and save the textbox.text. Thanks again!! Show quoteHide quote Brock Allen <ballen@NOSPAMdevelop.com> wrote in message news:<438619632489033912908976@msnews.microsoft.com>... > I just tried to reproduce your situation and it seems to work for me. I'm > running the 2005 Feb CTP. Is there any more info that might help us find > out why it's not working? > > -Brock > DevelopMentor > http://staff.develop.com/ballen > Yeah, there's something strange if this isn't working. I really don't know
how to help from here... Try the FebCTP and let us know, though I doubt that's the problem... Sorry I can't help more. -Brock DevelopMentor http://staff.develop.com/ballen Show quoteHide quote > Hi, Brock, thanks again for answering me. I'm downloading 2005 Feb > CTP. I forgot 1 thing, I have to change the textbox.text and click the > button without doing tab or enter. So, to save textbox.text in > Database I have to click twice the button and I want to do it in one > click. First click goes to CVltxtNombre_ServerValidate event but > doesn't go to btnGo event. Second click goes to > CVltxtNombre_ServerValidate event and then to btnGo event and save the > textbox.text. Thanks again!! > > Brock Allen <ballen@NOSPAMdevelop.com> wrote in message > news:<438619632489033912908976@msnews.microsoft.com>... > >> I just tried to reproduce your situation and it seems to work for me. >> I'm running the 2005 Feb CTP. Is there any more info that might help >> us find out why it's not working? >> >> -Brock >> DevelopMentor >> http://staff.develop.com/ballen
IE Web Controls - discontinued ???
custom validator and button events Re: At which life cycle should EnsureChildControls() be called? Cant Render Page Control with Visual Studio 2005 Beta Control Template How do I post hidden variables to another form from a popup? Custom Templated Control not rendering asp.net controls correctly Enter Key form with many UserControls DataGrid1 UpdateCommand calling DataGrid2 UpdateCommand Sorting problem in Data grid control |
|||||||||||||||||||||||