Solved

ASP.NET C# AutoPostback Error

Posted on 2009-05-04
5
335 Views
Last Modified: 2012-05-06
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

0
Comment
Question by:Janzer
  • 2
  • 2
5 Comments
 
LVL 7

Expert Comment

by:ajolly
ID: 24300739
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
 
LVL 5

Expert Comment

by:rendaduiyan
ID: 24301076
It looks like your handler is called when Page is posted.
However, your AutoPostBack is set.
need more details.
0
 

Author Comment

by:Janzer
ID: 24301339
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
 
LVL 5

Accepted Solution

by:
rendaduiyan earned 500 total points
ID: 24310624
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
 

Author Closing Comment

by:Janzer
ID: 31577807
You took me in another direction which ended up doing javascript and input buttons.  It is working great now.  Function was the clue.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now