I have used required field validator to validate a simple textbox and a textbox whose textmode is set to multiline. The validator works fine for the simple textbox , it shows error on clicking the submit button, but it doesnt show the error message for multiline textbox. It validates both the textboxes when I click the submit button 2nd time. I just dont know whats wrong with it. below is the code:
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
<script type="text/javascript" src="../Scripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
// General options
mode: "textareas",
theme: "simple",
encoding: "xml"
}
);
<script type="text/C#">
public string BodyHtml
{
get { return HttpUtility.HtmlDecode(txtDescription.Value); }
set { txtDescription.Value = value; }
}
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<asp:Label ID="lblTitle" runat="server" Text="Title (required)"></asp:Label>
<br /> <asp:TextBox ID="txtTitle" runat="server" Width="557px"></asp:TextBox>
<%--<asp:RequiredFieldValidator ID="reqTitle" runat="server" ErrorMessage="*"ControlToValidate="txtTitle"></asp:RequiredFieldValidator>--%>
<asp:Label ID="lblDescription" Text="Description (required)" runat="server"></asp:Label>
<%--<asp:RequiredFieldValidator ID="reqDescription" runat="server" ErrorMessage="*" ControlToValidate="txtDescription" ></asp:RequiredFieldValidator>--%>
<asp:FileUpload ID="FileUpload1" runat="server" />
<br />
<br />
<asp:Button ID="btnSubmit" runat="server" Text="Save"
onclick="btnSubmit_Click" />
<asp:Label ID="Label1" runat="server"></asp:Label>