Click here to Skip to main content
Click here to Skip to main content

NicsBar Progress (Loading) Control Bar

By , 23 Nov 2004
 

What does the code do?

Displays a loading / progress page for any ASP.NET / C# application.

How do I integrate it with my existing code or how do I use it?

Developers can add this to a tab on the toolbox to drop into a form at anytime!!

  1. Right click, Add tab "MyControls" perhaps.
  2. Right click, Customize Toolbox..
  3. Select ".NET framework Components" tab.
  4. Browse to the location of the MyWebControl assembly and select it.
  5. Select "NicsBar" control, press OK.

Volia!!

If there is a similar article on CodeProject already, then how does this one differ?

This one has been created from several different sources, although none of them seemed to solve the problem I was having with the following:

  • This works for Netscape 4.x+, IE5.
  • It can be customized to support other browsers which have not been supported in its current state.
  • ViewState information is not lost between page loads.
  • Loads before any other data in the application.

Why would someone want to use this version?

For the same reason I wrote it, the reasons above.

Is there some aspect of the code that is of particular interest that perhaps should be covered in the article?

Only the part where it uses the event handling for the ASP.NET page. Although it's simple enough.

Are there any particular environments the code is restricted to? (Windows 2000 or above, .NET SP1 etc)

None, just works for ASP.NET / C#.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Nick4333
Web Developer
United States United States
Member
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
QuestionNot work in Safarimemberemanlee10 Mar '09 - 4:55 
It works in IE7, FireFox, Chrome.
Not work in Safari.
Anyone make it works in Safari ?
Questiongif image is getting hanged wen page load'smemberDennis Kashi27 Oct '08 - 1:39 
my gif image is getting hanged wen page his loading becoz of for loop....
can anybody can help me in solving this problem.... Smile | :)
 
denniskashi

GeneralFonts changememberjohnpaulcastro11 Oct '07 - 12:59 
I am using Master Pages and after the "Loading..." bar gets displayed all my fonts are changed to one size bigger. Any ideas why?
 
I also haven't been able to display the GIF. I have tried the regular img tag and asp:ImageButton but cannot get the GIF to display.
GeneralCool!membermatheu5517 May '07 - 8:00 
Very nice!
GeneralSession ID Problem.memberImparatorvolkan2 Apr '07 - 12:03 
Hi,
 
Let me tell you first that this is a great piece of code. I reaaly like the control, but I get this error message first and when I refresh it disappers. Can you tell me why this happens?
 
Thank you.
 

Server Error in '/SlowPageExample' Application.
--------------------------------------------------------------------------------
 
Session state has created a session id, but cannot save it because the response was already flushed by the application.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
 
Exception Details: System.Web.HttpException: Session state has created a session id, but cannot save it because the response was already flushed by the application.
 
Source Error:
 
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
 
Stack Trace:
 

[HttpException (0x80004005): Session state has created a session id, but cannot save it because the response was already flushed by the application.]
System.Web.SessionState.SessionIDManager.SaveSessionID(HttpContext context, String id, Boolean& redirected, Boolean& cookieAdded) +163
System.Web.SessionState.SessionStateModule.CreateSessionId() +78
System.Web.SessionState.SessionStateModule.DelayedGetSessionId() +97
System.Web.SessionState.SessionStateModule.ReleaseStateGetSessionID() +30
System.Web.SessionState.SessionStateModule.OnReleaseState(Object source, EventArgs eventArgs) +681
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +167
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +117



GeneralRe: Session ID Problem.memberjonelster6 Sep '07 - 3:47 
I'm getting the same issue.. any idea or fix?
thanks!!!!!!!!!
GeneralResponse,Redirect doesn't work :(memberAblomaz21 Mar '07 - 13:13 
Response,Redirect doesn't work Frown | :(
GeneralRe: Response,Redirect doesn't work :(membersankarmca14 Aug '07 - 0:12 
I too faced the same problem. any fix on this?
GeneralSuper!memberguZzy92FS18 Nov '06 - 16:14 
Very nice Smile | :) easy to customize, quick deploy Cheers! Keep up the good work mate!
GeneralWorks PerfectmemberJoebloggs481726 Oct '06 - 0:25 
I have an app with a lot of reports, some taking a while to load.
I dropped in your control and it works perfect!
 
I have a look at your source code and its amazing how little code it takes to work!
good job

GeneralVB Translationmembersarast13 Sep '06 - 11:21 
I'm trying to convert your code to VB.Net. You wouldn't happen to have it in VB.Net already, would you?
 
Great code btw.
GeneralRe: VB TranslationmemberMember 41442081 Oct '10 - 5:24 
convert.telerik.com
QuestionTitle Does not set for first Timemembersachet sharma4 Aug '06 - 20:12 
Hey Nics,
I used this control in one of my pages. Now Whenever the page is loaded for the first time, the constructor of the web control fires up and I don't see the title of my page. but when the same page loads for second time it doesn't fire up and I see my page title. Is there any way to resolve this?
 
Its a great control anyway. Thanks
 
Saceht Sharma
QuestionHow to control the text that is displayedmemberljscottiii24 Feb '06 - 10:22 
This is a great control. Very nice work!
 
I modified the code just a bit so you can change the text being displayed. For instance instead of "Page Loading. Please Wait" One of my pages says "Sending Email Reports..." and another says "Uploading file..."
 
Here is how. From within the control itself:
  Change the Text Property to:
    public string Text {
      get {
      return text;
    }
      set {
        text = value;
      }
    }
 
  Change Init1
    protected void Init1(Object sender, System.EventArgs e) {
      WebControl tmp=sender as WebControl;
      loadHTML2 = loadHTML2.Replace("Page Loading. Please wait...",text);
      loadHTML2=string.Format(loadHTML2,sourceImage);
      tmp.Page.Response.Write(loadHTML1+loadHTML2);
      tmp.Page.Response.Flush();
    }
 
Now recompile the control and copy the dll to your web project. If you had your web project open when you copied the dll, you might need to close it and re-open to see the change of the text property from read-only to read-write.
 
Now when you add the item to your web page, change the text displayed by setting the Text property!
 
This offers a bit more flexibility.
 
Jay Scott
 
-- modified at 16:32 Friday 24th February, 2006
GeneralNice nice code....memberMBetioli17 Feb '06 - 2:56 
Congratulations!!!;)
GeneralNot Understandingmember2bchivalrous3 Aug '05 - 7:11 
I guess I am not as good at this asp.net stuff as you all are. I am looking for a way to have a simple box show up "page loading, please wait..." while my larger pages are loading. That way when new web surfers go to a product page they do not think the browser crashed. I am not the brightest bulb in the box when it comes to code but I do understand a bit.
 
Can anyone take a few moments to hold my hand through this. i just need to know what code to put where. Sorry for the inconvenience. I am just really stuck. The boss man is really riding me to get this done.Sigh | :sigh:
 
valient_effort
GeneralWithin a userControlmemberFrosty1_4me2 Mar '05 - 7:04 
Hi, this progress bar is the closest thing I've found to what I need. But the problem I have is that I'm trying to use it in a single aspx page that is really just a container for multiple user controls which create the functionality for the page. So when I add the progress bar to the control that is the slow loading pain in the butt, instead of just running in the table section that contains the usercontrol, it over rides the entire page, on the page load event.
 
The reason this is a problem for me, is that I have some search criteria in a dropdown list that the user selects. From the selection a different list of criteria is displayed (other dropdowns). So I don't want the user to lose site ot the initial find selection they have chosen, but just have the progress bar run within the userControl that is loading.
 
Is this possible to localize it to just the control that is loading and not the aspx page load event?
 
Thanks in advance for a great control.
GeneralDoesn't seem to work with SmartNav in IEmemberDaveDeath23 Feb '05 - 5:08 
It works for the ititial page load but then on pages that have SmartNav enabled it doesn't happen again for postbacks. In Firefox it works like a treat.
 
Great control btw...
 
Dave
GeneralThis may be exactly what I was looking for...sussMike Schaub17 Dec '04 - 10:02 
Nick, This control looks like just the thing I was looking for but I have had a couple problems with it. If I use it for items on the same page it works fine. I have a couple buttons that go to other pages. If I use the Reponse.Redirect to go to them I get the following error...
Cannot redirect after HTTP headers have been sent.
 
I can work around this by doing Server.Transfers instead. This was working well until I Linked from a page that had your control to another that had it. This caused the Page Loading Please wait to be embedded in the page behind my items. Not sure as to the cause of this or if you had any insight as to how I could fix this.
 
Thanks
 
Mike Schaub
GeneralRe: This may be exactly what I was looking for...memberhorcas30 Dec '04 - 6:39 
You sould do a
 
sRedirect = "<script>the funtion that hides de control()</script>"
Response.Write(sRedirect)
 
before Server.Transfer(...)
QuestionRe: This may be exactly what I was looking for...membermrmp311 Dec '06 - 9:36 
...the funtion that hides de control()
Please explain this!! i have the same error
Thanks
Ariel
GeneralRe: Cant get tool to workmemberNick Hermans24 Nov '04 - 3:23 
I have updated the source download with example projects/solutions.
GeneralGreat controlmemberDotNetDemon23 Nov '04 - 0:17 
Hey Nick,
Great control. Any chance of getting it to work inside a user control?
 
I want to use your loading page in my user controls so that when the control loads only the place holder should display the loading message and not the whole page. This would mean the header, footer and left menu bar are still visible when the loading message is active.
 
I've tried a few things myself, but nothing seems to work! Any ideas?
 
Thanks
 

 
James
GeneralRe: Great controlmemberNick Hermans24 Nov '04 - 3:20 
When i have an hour i'll see what I can come up with for you!
 
Any other features people would like to see leave them in this thread for me to try and update the code with.
 
Thanks all!
GeneralDownload updated sourcememberNick Hermans16 Nov '04 - 7:57 
I will update the download to include a sample solution/project so you can see how it 'hangs' together.
 
Hope it helps! Email me direct if you still get problems and I will ammended as required.
 
Leave comments on this website once you have it working Poke tongue | ;-P

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web03 | 2.6.130516.1 | Last Updated 24 Nov 2004
Article Copyright 2004 by Nick4333
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid