H
Hongbo
Hi,
I have a Asp.Net written in C#. It serve as information input form. The form encounters sort of
random problem with the email field and state field. I have validator attached with these 2 fields
as the following:
=====
<form id="creditcardform" method="post" runat="server">
Email: <asp:textbox id="txtBillEmail" maxlength="50" width="200" runat="server" />
<asp:requiredfieldvalidator id="vp10" runat="server" initialvalue=""
controltovalidate="txtBillEmail" errormessage="Billing Email cannot be empty" />
<asp:regularexpressionvalidator id="vp11" runat="server" controltovalidate="txtBillEmail"
errormessage="Billing Email must follow (e-mail address removed)"
validationexpression="^.+\@.+\..+$" display="Dynamic" />
State: <asp:dropdownlist id="lstBillState" runat="server" />
<asp:requiredfieldvalidator id="vp7" runat="server" initialvalue=""
controltovalidate="lstBillState"
errormessage="Billing State must select one" display="Dynamic" />
<asp:button id="btnSubmit" causesvalidation="True" text="Submit" runat="server" cssclass="button" />
</form>
=====
My understanding is that the <asp:requiredfieldvalidator> should guarantee the value of the field when the value of
"causesvalidation" sets to "True" in the submit button. But what happened was that no error was generated when "btnSubmit" was clicked, but the value of one of these 2 fields get lost in the codebehind file. I tried to catch it on our development server, but I've never caught it. It only occurs on our production server. This problem doesn't always occur.
It only happens once a while randomly.
Would you please help me to figure out the cause of such value loss?
Thank you
hb
I have a Asp.Net written in C#. It serve as information input form. The form encounters sort of
random problem with the email field and state field. I have validator attached with these 2 fields
as the following:
=====
<form id="creditcardform" method="post" runat="server">
Email: <asp:textbox id="txtBillEmail" maxlength="50" width="200" runat="server" />
<asp:requiredfieldvalidator id="vp10" runat="server" initialvalue=""
controltovalidate="txtBillEmail" errormessage="Billing Email cannot be empty" />
<asp:regularexpressionvalidator id="vp11" runat="server" controltovalidate="txtBillEmail"
errormessage="Billing Email must follow (e-mail address removed)"
validationexpression="^.+\@.+\..+$" display="Dynamic" />
State: <asp:dropdownlist id="lstBillState" runat="server" />
<asp:requiredfieldvalidator id="vp7" runat="server" initialvalue=""
controltovalidate="lstBillState"
errormessage="Billing State must select one" display="Dynamic" />
<asp:button id="btnSubmit" causesvalidation="True" text="Submit" runat="server" cssclass="button" />
</form>
=====
My understanding is that the <asp:requiredfieldvalidator> should guarantee the value of the field when the value of
"causesvalidation" sets to "True" in the submit button. But what happened was that no error was generated when "btnSubmit" was clicked, but the value of one of these 2 fields get lost in the codebehind file. I tried to catch it on our development server, but I've never caught it. It only occurs on our production server. This problem doesn't always occur.
It only happens once a while randomly.
Would you please help me to figure out the cause of such value loss?
Thank you
hb