Display partial view as POPUP in mvc2? - asp.net-mvc-2

I want to show result ( as list ) with fade effect in mvc2 .
Current it shows on same page and main form is displaying below result. How to display partial view results with fade effect popup in mvc2.
Suggest something.

Create a action method in your controller which returns a partialview
from you main page. write a js/jquery code to open a popup. you can use the fade effect from http://jqueryui.com/effect/
call you action method to load your partial view

Related

Swift 4: Click button to next View Controller but the new page's animation is "cover vertically" instead of "shifting" to next page

I am newbie of Swift 4 and I am trying to simply click a button and go to next page.
So I add a button in the first page and another view controller. Then I drag the button to the next page to create the "transaction". However, the animation of the transaction to pop up the next page from bottom, as shown in the image below. What I expect is to shift horizontally from current page to next page. Where did I do wrong? How can I achieve this?
Select the first view controller and choose Editor > Embed In > Navigation Controller. Make sure your segue is Show (Push).

Updating Modal with controller model

I am trying to use dynamic content inside my modal using angular controller model.
My codepen: codepen.io/anon/pen/dpJxa1
I am trying to increment $scope.count whenever user clicks Create contact button inside the modal. This count will be used to populate first name in the modal.
Even though the count is increasing which is shown in alert, it is not reflecting the modal. How can I listen for the changes in my model and show it in modal.
Thanks in advance.
Call the .show() method on your modal again, after each time you want the modal to update content. So add something like $scope.myModal.show(); to your increment function.

Add an animated top bar to UIWebView

I have a UIWebView controller that loads a web page and I would like to add some kind of a bar at the top of the page with refresh and close buttons.
The bar should hide when the page loaded and should show again if the user taps the top part of the page.
Does anyone know how to approach it? Is there any simple way to do that?
UPDATE:
I think I wasn't clear enough with the question, so here are some clarifications:
1. The applications is a standard application that one of the flows opens UIWebView that loads a web page
2. What I'm looking for is a bar that will slide down on top of the web page (loaded in UIWebView) and should help the user overcome a scenario where the web page is not loaded for some reason
3. The bar should hold the back (just close the UIWebView) and refresh (reload UIWebView) operations.
Hope it helped.
Thanks,
Shimix
I'm working on something like this right now and so far, here's what I've come up with. Some of this may be obvious, but important:
Your address bar should be the left navigationItem.
The search bar is the rign navigationItem.
You should animate a cancel button in/out when beginning/ending editing in the URL box.
Safari Mobile uses the Prompt property of the navigationBar to display webpage titles.
To animate the widths of the search/URL bars, use UIView animation when the bar is selected.
It's pretty simple to add a UIToolbar above the webview with UIBarButtonItems that call the webview's refresh, back, and forward methods. You can also add the webviewdelegate methods to your view controller to detect when the page has finished loading and hide/show the toolbar that way.
If you want the refresh and navigation controls to be displayed as part of the html content of the webview itself, that's a littler tricker, but not impossible. You can use the webview's shouldLoadRequest delegate method to detect that those buttons have been tapped, and then take the appropriate action within your viewcontroller. Hiding and showing the nav bar would have to be handled in javascript.
Unless I'm missing a library/project doing this, I don't think there is a simple way to do this.
I have already coded something similar to Safari mobile address bar, and from memory, it involved using private apis and/or playing with the "not so private but use at your own risks" UIWebView subviews hierarchy...

How to access the element of second page in UI automation (iPhone)?

My app has a main screen where i have button to go to login screen. On pressing login button it goes to second screen which is login screen.
In the login screen i have a submit button which is inside a table view.
I want to tap this Submit.
What approach i should use. Or more precisely in same java script hot to access the elements of second scree.
First you have to ensure that the button is accessable. Either set the Accessability property in Interface Builder (Identity Inspector - last Tab) and give the button an appropriate Accessability Label. If you don't use Interface Builder you can set the property on the button programaticaly.
Now in the script you can call
mainWindow.buttons()["name of the accessability label"].tap();
mainwindow is:
var target = UIATarget.localTarget();
var application = target.frontMostApp();
var mainWindow = application.mainWindow();
Make also sure that the button is visible. The button has to be the deepest element in the view hierarchie which is marked accessable. If the view containing the button is enabled as accessable, it would hide the accessability of the button (which is a subview).
You can log all visible elements in the screen by
mainwindow.logElementTree();
Moreover, you always can use one single script. The mainWindow.elements() references the view which is shown at a certain moment.
Get the tableView object of the window, then get the cells of that tableView. Now grab the buttons array of the cell with the submit button and tap the button. Something like that:
var submit = window.tableViews()[0].cells()[2].buttons()[0];
submit.tap();

iphone - how to mentain the state of UIWebView?

i am having a UIWebView showing and HTML page that has some checkboxes, radio buttons. My Application has tabbar controller that switches b/w two controllers. How i can maintain the current state of UIWebView. ( e.g. i have selected a checkbox and i change the tab and go to other ViewController and again come back to UIWebView. the WebView resets itself and goes to the start... i want to maintain the state of UIWebView ( all the checkboxes clicked) .. how i will do that ??
any idea ??
thanks in advance
It sounds like you're loading your web view in viewDidAppear:, or some other method that gets called each time you switch to the tab. If you load your web view in viewDidLoad:, it will only get loaded once, and will retain its state when you switch tabs.
EDIT: When I wrote this answer back in 2009, I apparently didn't understand the view controller life cycle as well as I thought I did. Corey Floyd was right. The viewDidLoad: method can also get called multiple times, because UIViewController will unload its view in low memory situations if the view isn't being displayed. When the user switches back to the view, viewDidLoad gets called again to reconstruct the view.
How embarrassing.
I have an idea that might help:
to get the status from your app to the webpage, give the variables' values as request parameters with the called URL and let the webpage handle them and view the form elements accordingly.
to get the status from the webpage back to your app, let the webpage be refreshed each time any of its element is updated, and with the new URL give the new values of the changed elements. Back to your app, you can implement the UIWebViewDelegate and inside the method WebViewDidFinishLoad (or WebViewDidStartLoad as you prefer) use the webView.request.URL to parse the GET parameters and update your app accordingly.
hope this will help.