C# Validation(subpoenad.com)

submitted by XequenceXequence(5) 2 years, 11 months ago

Allow the different levels to enable validation for C# Visual Studio 2008 take hold. I have learned of a few valuable sites to validate your .aspx page, and if you're good, validate your .ashx pages. The first level comes from this site. http://www.codeproject.com/KB/validation/PhoneTextBox.aspx The said example above, is about the most basic way to code a validationControl on a <asp:TextBox> item. However, this example is beginner because they are someone who changed their program to a more customized, less embraced, format. The control would look like this. <asp:DropDownList ID="ddServiceDelegate" runat="server"> <asp:ListItem Value="--Select--" /> <asp:ListItem Value="1">Product Inquiry</asp:ListItem> <asp:ListItem Value="2">Comments</asp:ListItem> <asp:ListItem Value="3">General Assistance</asp:ListItem> </asp:DropDownList> <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ErrorMessage="Please choose your selection." ControlToValidate="ddServiceDelegate" InitialValue="--Select--">*</asp:RequiredFieldValidator> Take it from there to level 2 of the programatic way to code validation. "Validation" is another way for saying "Regular Expression Validation". The same way you would say you know politics at the age 18, and then say you know politics 30 years later. Much more complicated and complex. * * * http://www.c-sharpcorner.com/UploadFile/prasad_1/RegExpPSD12062005021717AM/RegExpPSD.aspx Once you read this example, you are probably wondering how to bother. Well make a class file and call it validation. Paste all of the bool methods into the class file between : #region Using Statements using System; #endregion namespace HowToActAsOneMethod { public class Validation { public Validation() { // // TODO: Add constructor logic here // } // end Validation // pasted bool methods from said url here[]<>{} } } The next step is up to you. Very different methods to handle different events. Try using Enumerator with your classes to delegate the responsibilities for a multithreading application. If you get confused, just email and I can explain with snippets.

add a comment |category: |Views: 20

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

No comments so far

information Login or create an account to comment on this story