ASP.Net Form Issues Solved
Aug
4
Written by:
8/4/2009 3:25 PM
ASP.Net Form Issues Solved
I was working on a ASP.Net form this week that created several issues that I need to research to solve. Radio Buttons on the page were making all other controls undetectable within the code. Validation text was wrapping from next to the validated control to underneath the control. And the Reset button on the page was causing validation to occur which is not desirable.
Radio Button List
I was able to solve the issue of radio buttons on the page affecting all other controls by wrapping the buttons into a radio button list.
<asp:radiobuttonlist id="rdSpecificInvoiceInfo" runat="server">
<asp:listitem id="rdSpecificInvoiceInfoY" runat="server" value="Yes" />
<asp:listitem id="rdSpecificInvoiceInfoN" runat="server" value="No" />
</asp:radiobuttonlist>
Validation Text Wrapping
The second issue was solved by adding a style tag to the validation control itself.
<asp:RequiredFieldValidator style="white-space:nowrap"
ID="rfvYourName" visible="False" runat="server" ErrorMessage="Your Name is Required"
Font-Bold="True" Font-Italic="False" ControlToValidate="txtYourName"
Enabled="True"></asp:RequiredFieldValidator>
No Validation on Reset
The reset button was the simplest but most difficult to solve. I found one article detailing the use of validation groups which did nothing but waste time in the implementation. Finally I found some information online about setting one property on the button, CausesValidation.
<asp:Button ID="bReset" CausesValidation="False" CssClass="form_control"
runat="server" ToolTip="Reset" Width="60" Text="Reset" />
4 comment(s) so far...
Re: ASP.Net Form Issues Solved
I'm also facing same kind of problem. I'm very grateful to you for providing the proper / accurate solution.
By ansv@Webdevelopment ny on
8/13/2009 2:29 AM
|
Re: ASP.Net Form Issues Solved
I recommend this method method to my friend. He also facing the same problem.
By ansv@Webdesign ny on
9/3/2009 10:12 AM
|
Re: ASP.Net Form Issues Solved
thank u for providing the proper / accurate solution.
By seamless steel pipe on
10/22/2009 7:58 PM
|
Re: ASP.Net Form Issues Solved
one more method which found for ASP.NET is to add an image button to the aspx page with an image url referencing the desired button, then on the click event on the code behind page, do a Response.Redirect and use the email option from the code provides after the button is designed.it also provide good help
By Venice Hotels on
9/7/2010 1:50 AM
|