I have what on the surface looks like a fairly simple scenario. I have a textbox validated by a radinputmanager via a webservice. This allows the user to enter a produce code. If the code is valid then I want to populate some values with the textboxes textchanged event.
Heres what I have:
This is fine if the code entered is valid, but if the code is invalid (i.e. the webservice validation fails) I don't want to postback to the textchanged event.
Is there any way to do this?
Thanks
Heres what I have:
<asp:TextBox ID="ProductReferenceTextBox" runat="server" Text='<%#Bind("ProductReference") %>' MaxLength="8" AutoPostBack="true" OnTextChanged="ProductReferenceTextBox_TextChanged" /><t:RadInputManager ID="MainInputManager" runat="server"> <t:TextBoxSetting BehaviorID="ProductReferenceBehavior" Validation-Method="ValidateProductCode" Validation-Location="ValidationServices/ProductService.asmx" Validation-ValidateOnEvent="All" Validation-IsRequired="true" />protected void ProductReferenceTextBox_TextChanged(object Sender, EventArgs E){TextBox oSender = (TextBox)Sender;if (IocContainer.ProductDao.Exists(oSender.Text)){ Product eProduct = IocContainer.ProductDao.GetProduct(oSender.Text); GridDataInsertItem oContainer = (GridDataInsertItem)oSender.NamingContainer; Label oLabel = (Label)oContainer.Controls[5].Controls[0]; oLabel.Text = eProduct.StockUnit; } }This is fine if the code entered is valid, but if the code is invalid (i.e. the webservice validation fails) I don't want to postback to the textchanged event.
Is there any way to do this?
Thanks