ASP.NET C# AutoPostback Error

I have a form with levels of check boxes.  Level 1 selection enables level 2 checkboxes.  If I click level 1 and wait a long period, then click level 2 boxes I am fine or if I have stops I am fine BUT if I click too quickly then I get an page cannot be displayed.
- What is the code to determine when an autopostback is finished processing?
OR
-should I  just move the user onto the next page?
Thank you for your assistance


<asp:RadioButton ID="rdoExist"  CssClass="radio" runat="server" 
     style='left:14px; top:216px; width:181px;'  OnCheckedChanged="SetGrpZ"
            GroupName="GROUP_1" Text="Existing Business" AutoPostBack="True" />
 
public void SetGrpZ(object sender, EventArgs e)
        {
            string myCtl = ((Control)sender).ID;
 
            switch (myCtl)
            {
                case "rdoExist":
                 {
                
                chkC.Enabled = false;
                chkR.Enabled = false;
                chkA.Enabled = true;
                 break;
                 }

Open in new window

JanzerAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
rendaduiyanConnect With a Mentor Commented:
how about remove SetGrpZ from chkA as a eventhandler; just a private member function instead.
In a word, call SetGrpZ in your Page_load.
0
 
ajollyCommented:
how can you click on the second level of check boxes if they are not even enabled yet.

Please post the full html code, it will help to analyze.
0
 
rendaduiyanCommented:
It looks like your handler is called when Page is posted.
However, your AutoPostBack is set.
need more details.
0
 
JanzerAuthor Commented:
Level 1 -  User makes a radio selection of rdoNew or rdoExist which fires -Page_load & SetGrpZ
SetGrpZ disables radio New and Existing and enables checkbox chkA
If clicking chkA immediately after radio click results in:
Error 1:  chkA shows no check mark until second click
Error 2:  shows Page Cannot Be Displayed
Works fine IF - 1.  Extended period between radio click and checkbox click OR 2. Code break on SetGrpZ
0
 
JanzerAuthor Commented:
You took me in another direction which ended up doing javascript and input buttons.  It is working great now.  Function was the clue.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.