Show ASP.Net Button when no error found in C#

indradeo
 
on Jul 28, 2022 03:46 AM
437 Views

how to make button1 true while Label20 msg No_Error using asp.net c#

namespace BPM
{
    public partial class vw : System.Web.UI.Page
    {
        protected void calculate_Click(object sender, EventArgs e)
        {
            String Label = "Label20.Text";

            if (Label == "No_Error")
            {

                Button1.Visible = true;

            }
            calcualtion();
            calcualtion1();
            calcualtion2();
            calcualtion3();
            //error();           
        }        
    }
}
Download FREE API for Word, Excel and PDF in ASP.Net: Download
PrinceG
 
on Jul 28, 2022 04:34 AM
indradeo says:
        protected void calculate_Click(object sender, EventArgs e)
        {
            String Label = "Label20.Text";
 
            if (Label == "No_Error")
            {
 
                Button1.Visible = true;
 
            }
            calcualtion();
            calcualtion1();
            calcualtion2();
            calcualtion3();
            //error();
            
        }

Replace above code with below code. 

protected void calculate_Click(object sender, EventArgs e)
{
    string Label = Label20.Text;

    if (Label == "No_Error")
    {
        Button1.Visible = true;
    }
    calcualtion();
    calcualtion1();
    calcualtion2();
    calcualtion3();
    //error();
}