.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
satyapriyanayak
Jean Paul
SP
Sambanthamoorthy
Swati Kadam
Post New Web Links

username validation using c# code

Posted By:      Posted Date: October 08, 2010    Points: 0   Category :ASP.Net
 

Hi All,

I wnat to check "UserName" input with for the following conditions using C#,

must Srating with alpha numeric character
length is 6 to 15 chars
do not use more than 5 numeric characters
do not use any special characters




View Complete Post


More Related Resource Links

DataGrid ValidationRule or IDataErrorInfo validation code called multiple times for each data change

  
Following my enquiry regarding a problem in Datagrid validation, for which managing exceptions is apparently a problem, I tested the two other methods: using validation rules, or implementing the IDataErrorInfo interface. I ran into other problems there, more insidious this time. This has been done on Windows7 (32-bit), .NET 4.0.30319. 1) IDataErrorInfo When this interface is implemented, the this[string columnName] property is called four times for each modification: two times before the cell enters edit mode (with the old value in the corresponding property) two times when the new value has to be validated (with the new value) It strikes me as not really efficient, is there something wrong with my code? Here's the C# part: using System; using System.Windows; using System.Collections.ObjectModel; using System.ComponentModel; namespace DataGridTest2 { public partial class MainWindow : Window { ObservableCollection<User> users; public MainWindow() { InitializeComponent(); users = new ObservableCollection<User>() { new User { Name = "Teddy", Age = "2" }, new User { Name = "Avi", Age = "19" } }; datagrid.ItemsSource = users; datagrid.Focus(); } } public class User : INotifyPropertyChanged, IDataErrorInfo { string name; public string Name

jQuery Validation of Username in MVC

  

Hello,

The below code is not working when validating a unique username but the required rule works.


<script src="http://ajax.microsoft.com/ajax/jQuery.Validate/1.6/jQuery.Validate.min.js" type="text/javascript"></script>

        <script type="text/javascript">
            $(document).ready(function () {

                $('form').validate({
                    username: {
                        required: true,
                        uniqueUsername: (function () {
                            CheckUsername();
                      

Sharepoint 2010 error on username in ASPX code

  

Here is the error:

Web page error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; GTB6.6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3; .NET4.0C; .NET4.0E)
Timestamp: Tue, 2 Nov 2010 20:12:57 UTC

Message: Expected '}'
Line: 1076
Char: 440
Code: 0
URI: http://my.local.sharepoint2010server/Lists/TreatmentRoomB/calendar.aspx

I have reset the users profiles and even had the user use a different computer. here is what I think the deal is. Her last name is "O'Tool", and when the list is generating the calendar view it is freaking out... could it be the "'" in her name?

I have tried to go to the back end database and remove her, or at lease change the name.. but can't find the information.

the page works great for anyone else, even on the same computer?  

Frustrated!


Jason

Code Optimized Web Development Profile (VS 2010 and .NET 4.0 Series)

  
When you first run VS 2010 it prompts you to select an IDE profile to use. The profile you select will configure how tool windows are displayed/docked in the IDE by default and set the default keyboard shortcuts. You can then customize any of these settings by using the Tools->Options menu within the IDE and then override/change them. You can also later reset your profile and pick a different one by choosing the Tools->Import and Export Settings menu command.

Free Code Snippets - ASP.NET

  
You Can Find Useful ASP.NET Related Posts on the above link.

Free Code Snippets - C#

  
Free C# Code Snippets

call JavaScript - jQuery code from ASP.NET Server-Side

  
jQuery got so close to me lately that I can see myself adding the scripts to my project almost unconsciously. The thing is, jQuery is very useful for me, in almost all situations and it has been a do or die enhancement for all my project since I first put my hands on it.

Of course while using it, you encounter few situations which need a bit of research to solve, mostly when you are trying to combine it with some other technologies like: UpdatePanels and ASP.NET Ajax. For instance there are many situations when I would like to run some jQuery magic based on some decision that I make on the server side.

call JavaScript - jQuery code from ASP.NET Server-Side

  
jQuery got so close to me lately that I can see myself adding the scripts to my project almost unconsciously. The thing is, jQuery is very useful for me, in almost all situations and it has been a do or die enhancement for all my project since I first put my hands on it.

Of course while using it, you encounter few situations which need a bit of research to solve, mostly when you are trying to combine it with some other technologies like: UpdatePanels and ASP.NET Ajax. For instance there are many situations when I would like to run some jQuery magic based on some decision that I make on the server side

Microsoft StyleCop: Source Code Analyzer for C#

  
StyleCop is similar in many ways to Microsoft Code Analysis (specifically FxCop), but there are some important distinctions. FxCop performs its analysis on compiled binaries, while StyleCop analyzes the source code directly. For this reason, FxCop focuses more on the design of the code, while StyleCop focuses on layout, readability and documentation. Most of that information is stripped away during the compilation process, and thus cannot be analyzed by FxCop.

Code spelling checker extension for visual studio 2010

  
Building a spelling checker for source code as an extension for visual studio 2010.

C# and XML Source Code Documentation

  
Through many years of enterprise level software development and consulting, I became critically aware of the importance of good source code documentation, and several years ago when I began working with the first release of Visual Studio .NET beta 1 and found C# provided built-in support for inline XML code documentation, I was thrilled.

Bar Code Scanners with the .NET Compact Framework

  
Summary: Learn how to make your applications use bar code scanners in a generic way-ndependent of the specific bar code scanners that are used on different devices. Using the design patterns Façade and Factory, the implementation not only supports multiple bar code scanners, but it also makes it easy to add support for other bar code scanners. After a brief discussion about bar code scanners and the bar code scanner pattern, a download code sample, written in C#, demonstrates the use of the pattern and technologies.

PrinterCE for .NetCF - Code Samples

  
1)Example:Hello World
2)Example:Form Test
3)Example:DrawTextFlow
4)Example:TextColumns
5)Example: Bar Code Test
6)Example:Text Wheel
7)Example:Image Rotation
8)Example:Line Fun

.net code converter

  
For coverting your programming langugae to another languge the below site is very help full

http://www.developerfusion.com/tools/convert/vb-to-csharp/
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend