<EditItemTemplate> <asp:TextBox ID="txtDate" Text='<%#Bind("Date") %>' runat="server"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtDate" ErrorMessage="Please enter EventDate">*</asp:RequiredFieldValidator> </EditItemTemplate>
<div> <asp:TextBox ID="TextBox1" runat="server" ></asp:TextBox> <asp:TextBox ID="TextBox2" runat="server" ></asp:TextBox> <asp:Button ID="button1" runat="server" OnClick="validate" /> </div>
protected void validate(object sender, EventArgs e) { string name1 = TextBox1.Text; string name2 = TextBox2.Text; if (((string.IsNullOrEmpty(name1)) && (!string.IsNullOrEmpty(name2))) || ((!string.IsNullOrEmpty(name1)) && (string.IsNullOrEmpty(name2)))) { Response.Write("Please fill the two boxes"); } else { Response.Write("Thank You"); } }
Thanks and Regards V.SaratChand Show difficulties that how difficult you are
Login to post response