473,396 Members | 1,713 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Validate problem

js
My form has only one RequiredFieldValidator (called RqValidateSerial)
enabled at design time. In the code behind I set the validatior to
false when the form is submitted by certain button click. On the same
IIS6 server, I use port :801 as my development site, and :80 as the
production site. Both sites has identical configuration. The
validation works fine. Then I use Windows Explore (without using
XCOPY) to copy the .ASPX, .ASPX.cs,
..ASPX.resx to the \myApp\forms directory on the production site. The
..DLL and .PDB files are also copied to the \myApp\bin directory. For
some reason the validator is always enabled when the form is submitted,
even the buton's CLICK event has code that disables the validtor. Does
anyone know why? The following is an example of one of the button that
disable the validator.

////code behind in .cs file
private void btnSubmitLookup_Click(object sender, System.EventArgs e)
{
try
{
RqValidateSerial.Enabled = false;

if (SelectedInventory == null) //disable the RequiredFieldValidator
{
SelectedInventory = new Inventory();
}
saveFormValueToSession();
saveCriteria();
Server.Transfer("CustomPaging.aspx");
}
catch(Exception ex)
{
handleError(ex);
}
}

//// code in .aspx file
<TR>
<TD><B>Serial:</B></TD>
<TD>
<asp:textbox id="txtSerial" runat="server"></asp:textbox>
<asp:imagebutton id="btnResetSerial" runat="server"
EnableViewState="False" ImageUrl="/images/Scissors1.GIF"
CssClass="smallIcon" CommandName="reset"
CommandArgument="txtSerial"></asp:imagebutton>
<asp:requiredfieldvalidator id="RqValidateSerial" runat="server"
Display="Dynamic" ControlToValidate="txtSerial"
ErrorMessage="Partial or complete serial number is
required"></asp:requiredfieldvalidator></TD>
</TR>

Nov 19 '05 #1
0 877

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Rob Mayo | last post by:
I have a bunch of XSD files in my assembly as embedded content that are read out via reflection and streams. My app creates the XML on the fly, and I want to validate it using the schema files...
0
by: SHC | last post by:
Hi all, I have a VC++ .NET 2003 - Windows XP Pro PC. I created a Win32 console application in my VC++ .NET 2003 and copied validateDOM.cpp, books.xml and books.xsd (see the attached files below)...
7
by: Ali-R | last post by:
Hi all, I am getting a CSV file like this from our client: "C1","2","12344","Mr","John","Chan","05/07/1976"......... I need to validate **each filed value** against a set of rules ,for...
6
by: Jonny | last post by:
Hi, I'm trying to validate my xml against a xsd but I can't get it to work. Originally, I wanted to validate an xml string but since I didn't get that to work I tried to validate an xml file...
4
by: Brybot | last post by:
I have a form that i've split up into multiple asp:panels, each panel has a number of validators which work correctly. At on the last panel, i want to commit the data collected to a database. I...
24
by: Mike Hofer | last post by:
Please forgive the cross-post to multiple forums. I did it intentionally, but I *think* it was appropriate given the nature of my question. I'm working on an open source code library to help...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
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,...
0
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...
0
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.