In my project, on a particular view I am having various ajax calls and during the access to the database and displaying the data, it`s taking a long time. I want to have something like a progress image pops up, that would be displaying till the data are displayed and making the view where the data would be displayed as a modal, such that the user can no more click on anything on that page. Can I have an idea or guide how can I achieve that? Is there the possiblilty of progress bar in MVC or any suggestion is welcomed, any example please.
It may be overkill if you've not already got jQuery and jQuery-UI on your site, it can be done by creating a modal dialog: http://jqueryui.com/demos/dialog/#modal
that contains a progress bar: http://jqueryui.com/demos/progressbar/
You can then poll the server for the progress and update the appearance of the progress bar.
Related
I was reading several articles on how to add a progress bar, but did not get any example to help.
I have a controller that makes a data import from a csv (over 10000) file, and how to make the implementation for the progress bar on the screen.
The only thing missing is to implement the progress bar, I have no idea how to do.
Web Progress bars can be a bit tricky to get to work properly. I see two options that you can do:
The easyiest way is to have a progressbar that only shows a animation that indicate to the user that something is still working, but actually it doesn't show you the progress of your long running task, it only animates.
The harder way is of course to show a realtime report on how far the progress has come.
In this case you will have to use the setTimeout() method in javascript to call a function every 2 or 3 second or so, and in that function do a ajax call to a MVC Controller method that can retreive the currently reported progress from your long running task, and then display it in some way in your GUI.
I either case I think you can use the jQueryUI ProgressBar component.
Looked many things up, but never posted before. Here's my situation. Any help would be most appreciated.
I've got a wizard with numerous screens with an associated navigation bar made using CSS. As users click from screen to screen, the navigation reflects the current wizard page the user is on. Each screen has different inputs to be collected. Database reads and writes are required during the render and submission of each page.
Here's the catch. Not every page is required. Only required pages are displayed in the navigation and the required information is stored in the database.
My goal is to reduce the number of database queries by dividing the navigation and remaining input into two separate partials. This way I don't have to render the navigation between each screen eliminating the single query every time between screens.
How would I submit the form of the current screen, render the partial view of the next screen, and yet update the query string to reflect the current partial view as well? This way if the user refreshes the page, they get the current screen.
Sounds like pre-optimization. How do you know you're going to have a problem with your navigation because of the database?
Why not separate out your navigation and output cache it?
If you bound determined to change the url without changing the content you need to use History API and if you need a fall back for browsers that don't support that you can use history.js.
Let's say I have two tabs tabA and tabB. When I click on tabA the first page of that section appears, call it tabA1. If I click on a link on that page then page tabA1 is replaced with tabA2. If I then click on another tab, say tabB, and then go and click on tabA again I get an image of tabA2 lingering for a bit.
How can I make it so that clicking tabA will always show tabA1 straight away? Is it saving it in the cookies for fast access?
Before switching additionally try setting the content in the tab (or equivalent wrapper) to display : none.
This is happened to me and that's how I fixed it. Although I know it fixes the symptoms and not the exact problem.
I have a ASP.net MVC application. On one page I have a button and when user clicks on it I need to display some information on a pop up window. How can I do that in ASP.NET MVC? What do I use and where do I write the code for pop window? In the controller? Some java script?
Thank you!!
You can display messages with javascript. The content of the message can be set in the markup or by your Controller as a Model property. You have a few display options:
Use the alert() function, which will display a native browser dialog
Display a styled modal dialog (E.g. jQuery UI dialog)
Display a styled div (E.g. jQuery UI Message - shameless plug, this one of my open source projects)
The alert function isn't very pretty, but it's the simplest. I typically go with a modal dialog or a styled div, depending on the UI requirements.
If the information you want to display in a pop up is dynamic (i.e you need some c# logic to run) then I'd suggest putting that logic in a controller and have the corresponding view be the pop up itself. You can stick some JavaScript at the top of the view to launch the popup on load.
The page with the button trigger can call that controller and pass any data needed. To make it smooth maybe make the trigger use Ajax.
My app is a holiday search app. Once the user touch 'search' button it will do a web query and gather results from various providers such as BING, YAHOO, ETC... I want to show these results tabbed according to the provider. I want to use a table to show the list of results of one provider and a tabbar on the bottom of the screen to switch providers.
The number of providers is dynamic means it can ONLY be known once the web query is done. So number of tabs required/view controllers required is NOT known prior to the web request.
Any idea how to implement this ???. Since i'm bit new to IOS dev, I would be delighted if you can provide a detailed description. Thank you. Feel free to ask any question if you do not get my problem.
You add ViewControllers to a tab bar and it will display a tab for that view controller - so you would have to put each result set into a view controller and add them to the tab bar.
be aware a tab bar can only display 5 tabs before it switches to 4 tabs and a moreā¦ controller.
A possibly better way would be to have a button that brings up a UIPickerView which has a list of the result sources. that way you can have as many result sources as you like!