EDN Admin
Well-known member
Dear All,
I am stuck in a issue, i am using Validation summary in My Visual WebPart for SharePoint.
Below is the code:
<tr align="left" style="height: 35px
<td colspan="2
Use this form for any inquiries you might have and well get back to you within
24 - 48 hours. All fields are required.
<asp:ValidationSummary ID="ValidationSummary1" runat="server" CssClass="errorText" EnableViewState="false" ForeColor="Red"/>
<br />
<asp:Label ID="lblMessage" runat="server" CssClass="errorText" ForeColor="Red" Visible="false </asp:Label>
</td>
</tr>
<tr style="height: 35px;" align="left
<td style="width: 50%;
<label for="<%= txtCompanyName.ClientID %> Company Name <span class="errorText mandatoryField *</label>
</td>
<td>
<asp:TextBox ID="txtCompanyName" runat="server" Width="400px" MaxLength="50 </asp:TextBox>
</td>
</tr>
<tr style="height: 35px;" align="left
<td style="width: 30%
<label for="<%= txtFirstName.ClientID %> First Name <span class="errorText mandatoryField *</label>
</td>
<td>
<asp:TextBox ID="txtFirstName" runat="server" Width="400px" MaxLength="50 </asp:TextBox>
</td>
</tr>
=-------------------
<asp:RequiredFieldValidator ID="rfvCompanyName" runat="server"
ControlToValidate="txtCompanyName" EnableViewState="false"
Display="None" ErrorMessage="Company Name is required."
CssClass="errorText" Text=" </asp:RequiredFieldValidator>
<asp:RequiredFieldValidator ID="rfvFirstName" runat="server"
ControlToValidate="txtFirstName" EnableViewState="false"
Display="None" ErrorMessage="First Name is required."
CssClass="errorText"/>
---------------------------
Now when i load page first time validation summary shows messages
. error message 1
. error message 2
While i havnt validated any thing. validation is only to be performed on button click (post back)
Can any one help in this regard.
HBkhan
View the full article
I am stuck in a issue, i am using Validation summary in My Visual WebPart for SharePoint.
Below is the code:
<tr align="left" style="height: 35px
<td colspan="2
Use this form for any inquiries you might have and well get back to you within
24 - 48 hours. All fields are required.
<asp:ValidationSummary ID="ValidationSummary1" runat="server" CssClass="errorText" EnableViewState="false" ForeColor="Red"/>
<br />
<asp:Label ID="lblMessage" runat="server" CssClass="errorText" ForeColor="Red" Visible="false </asp:Label>
</td>
</tr>
<tr style="height: 35px;" align="left
<td style="width: 50%;
<label for="<%= txtCompanyName.ClientID %> Company Name <span class="errorText mandatoryField *</label>
</td>
<td>
<asp:TextBox ID="txtCompanyName" runat="server" Width="400px" MaxLength="50 </asp:TextBox>
</td>
</tr>
<tr style="height: 35px;" align="left
<td style="width: 30%
<label for="<%= txtFirstName.ClientID %> First Name <span class="errorText mandatoryField *</label>
</td>
<td>
<asp:TextBox ID="txtFirstName" runat="server" Width="400px" MaxLength="50 </asp:TextBox>
</td>
</tr>
=-------------------
<asp:RequiredFieldValidator ID="rfvCompanyName" runat="server"
ControlToValidate="txtCompanyName" EnableViewState="false"
Display="None" ErrorMessage="Company Name is required."
CssClass="errorText" Text=" </asp:RequiredFieldValidator>
<asp:RequiredFieldValidator ID="rfvFirstName" runat="server"
ControlToValidate="txtFirstName" EnableViewState="false"
Display="None" ErrorMessage="First Name is required."
CssClass="errorText"/>
---------------------------
Now when i load page first time validation summary shows messages
. error message 1
. error message 2
While i havnt validated any thing. validation is only to be performed on button click (post back)
Can any one help in this regard.
HBkhan
View the full article