Validate Password textbox

Satyapriyanayak
Posted by Satyapriyanayak under C# category on | Points: 40 | Views : 1403
Change password form, which I would like to check :
1.it shouldn't be empty or null
2.txtNewpassword.Text = txtConfimPassword.Text


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Fetch_multi_in_combobox
{
public partial class Form3 : Form
{
public Form3()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{

if (txtNewpassword.Text == "" || txtConfimPassword.Text == "")
{
MessageBox.Show("Please enter values");
return;
}
if (txtConfimPassword.Text != txtNewpassword.Text)
{
MessageBox.Show("confirm password not matching with new passsword");
txtConfimPassword.Focus();
return;
}
}
}
}

Comments or Responses

Login to post response