这是我的代码。我无法访问函数中的构造函数值。
public partial class ForgotPassword : UserControl
{
private string mobile_num2 = "";
public ForgotPassword(string _mobile_num)
{
mobile_num2 =_mobile_num;
MessageBox.Show(mobile_num2);//Getting Value here
InitializeComponent();
}
private void btn_submit_Click(object sender, RoutedEventArgs e)
{
string val_conf_pwd;
string conf_pwd = txt_new_conf_pwd.Password;
val_conf_pwd = c.validate_conf_Password(pwd, conf_pwd);
if (val_conf_pwd == "success")
{
MessageBox.Show(mobile_num2);//Getting Null Value Here
}
}
}