Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

navigating to second page after validation of username and password in visual studio 2012 windows phone using C#

$
0
0

Hi,

I have created one login form having username and password ,I have restricted username as only number and password as special character ,length greater than 8,(a-z),(A-Z)these all should be there.i have created one LOGIN button ,I want to navigate to second page by clicking login button after validating these two field .

validation for password is not running properly ,I have used code as 

<PasswordBoxx:Name="PasswordBox" 

PasswordChanged

="PasswordBox_PasswordChanged">

 

privatevoidPasswordBox_PasswordChanged(objectsender,RoutedEventArgse)

        {

           

PasswordBoxpassBox = senderasPasswordBox;

           

boolisValidPassword = passBox.Password.Any(char.IsDigit)

                           && passBox.Password.Any(

char.IsLetter)

                           && passBox.Password.IndexOfAny(

newchar[] { '@','$','#'}) != -1

&& passBox.Password.Length >= 8;

            PasswordText.Text = isValidPassword ?

"valid":"not valid";

       

        }

actually whenever I am entering wrong password that is not valid pwd then too on click of  button page is getting navigated.How to write the code in c# for visual studio express 2012 for windows phone.so that after correct password only it shd navigate to second page.

 

 

 

 

 

 

 

 

 

 

 


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>