Want to show the information about execution of methods in asp.net

问题内容:

The button click event of my ASP.NET(2015) application has 5 methods and each is taking long time to complete. I want to show the information about execution of each methods to the user like method1 is completed and method2 is started running like this…

protected void Unnamed_Click(object sender, EventArgs e)
    {
        lbl.Text = "Retriving Employee details";
        GetEmplyeeDetails();
        lbl.Text = "Processing Employee details";
        ProcessEmployeDetails();
        lbl.Text = "Generating reports";
        GenerateReports();
        lbl.Text = "Uploading...";
        UploadDetails();
        lbl.Text = "Pushing data to database";
        PushResultToDatabase();

        lbl.Text = "Completed Successfully";
    }

    private void GetEmplyeeDetails()
    {

    }
    private void ProcessEmployeDetails()
    {

    }

    private void GenerateReports()
    {

    }

    private void UploadDetails()
    {

    }

    private void PushResultToDatabase()
    {

    }

In my screen, When I click the button, it shows the last message only but I want to show the information like I have mentioned in the lbl.Text above code

Can anyone please help me to achieve this.

Thanks,
Lenin

问题评论:

1  
aspnet does not work like that. Only the last change of lbl will be send to the client. If you really want something like that you need an ajax solution.
    
Please let me know if know how to do this. Thanks
– user2982630
4 hours ago

原文地址:

https://stackoverflow.com/questions/47749923/want-to-show-the-information-about-execution-of-methods-in-asp-net

Tags:, ,

Add a Comment