Stop server side execution until user input and post back that value in server code in C# ASP.Net

I have button called Done with Onclickevent Done().

protected void Done(object sender, EventArgs e)
{ 
  
    if(c.Section.Elements.Any(element.SectionName == "area1"))
    {
      ClientScript.RegisterStartupScript(this.GetType(), "ShowPopup", "showAreaPopup();", true);
      return; //show popup and stop execution until user input is given for area1
    } 
    if(c.Section.Elements.Any(element.SectionName == "area2"))
    {
      ClientScript.RegisterStartupScript(this.GetType(), "ShowPopup", "showAreaPopup();", true);
      return; //show popup and stop execution until user input is given for area2
    }
    int MyArea1 = 0;
    if (int.TryParse(hiddenArea.Value, out Myarea1) && Myarea1> 0)
    {
        c.Details.Add(new Detail() { Name = "area1", Value = MyArea1});
    }

    int MyArea2 = 0;
    if (int.TryParse(hiddenArea.Value, out MyArea2) && MyArea2 > 0)
    {
        c.Details.Add(new Detail() { Name = "area2", Value = MyArea2});
    }
    webservice.Complete(this.CaseId); //this is a web service
  
}
function captureAreaVal() {
            var areaVal = document.getElementById('<%=TxtboxArea.ClientID%>').value;
            if (areaVal && !isNaN(areaVal) && parseInt(areaVal) > 0) {
                document.getElementById('<%=hiddenArea.ClientID %>').value = areaVal;
                closeAreaPopup();
                console.log("in captureAreaVal() ", areaVal);
            }
}

I want to write code such that when sectionName checked is area1/area2 or both, show popup immediately and wait until user input and capture that input in ‘hiddenArea’ and assign it to my Class(with object c) property – Details and then execute the webservice for adding data to database. If none is checked just execute webservice.
Can you please guide on how to postback the area value entered by user in server code. Is my requirement possible, if yes could you please help give/correct my code. Your prompt help is highly appreciated.

Thank you!

I have put flags to achieve my requirement but not helpful. Please help give/correct my code for achieving my requirement.