Where does entery saved for View and Controller - asp.net-mvc-2

I am not able to find the file where the entry get saved that which controller is for which view.
i am facing a issue that i have created a controller and then right clicked on it and generated a .ascx user control. but it generates it in HOME directory but when i move that .ascx to shared folder its not link with controller.
plez tell me how to create a user control in shared folder and set its controller.
Thanks

You don't set a controller to a view. It works by convention. The controller action will first look at the ~/Views/ControllerName folder for the view and then in ~/Views/Shared. If the view is in some non-standard location you could specify its location when returning it:
return PartialView("~/Views/SomeLocation/SomeView.ascx");

Related

How to merge two project in iphone

I am new to i phone programming.I want add one project into another project.In one project i have used root view controller and another project is view controller.In root view controller its displaying table view in starting after that if i click on the cell its will display the private document folder images,its working fine in root view controller project when i add this project to view controller i have made some changes in app delegate here after that when i run project first displaying view controller in that if click one button means its displaying table view but if click any cell in table view means its not working it.That root view controller project is https://github.com/kirbyt/KTPhotoBrowser
Here if click on that cell its will all document images in thumbnails its not working can please help me what to do now.
Thanks
I have tried this but did not get success yet. I think it's not possible. The other way is to merge the methods of the other project yourself into the other project so that you can get the functionality of the other project.

How to display transparent view to show the Upload successful message on current view and then go back to root view controller

In my current view controller i m uploading the content to server and i want to show the user that the upload was successful and then take him to the root view controller to perform another action.
Is there a way i can do it.
Thanks,
Check out MBProgressHUD

viewDidLoad nor init are being called at application start iphone

This is a novice error for sure. In Xcode 4 i have created a Window Based application in which i put a TabBarController as the root controller. When the application starts, the first tab of the tabbar is selected and thus the view corresponding to that tab is shown. The problem is that the View Controller that corresponds to that view in the first tab is not being read, i put some logs in the init, viewWillLoad, and viewDidLoad methods and none of them are being shown. I have linked the controllers correctly, plus Xcode links them automatic if you select that option when creating a new view controller. Here's how it looks like in my project.
This is how it looks like in the tab controller i have linked to the view.nib:
And this is the view, it is linked to the view controller:
And here's the View Connected to the File's Owner Outlet:
Everything looks fine for me so i don't understand why it's not calling those methods in the view controller when the application starts or when the tab corresponding to that view is being selected.
Thanks in advance for the help.
I fixed it. The problem was that the referencing class was UIViewController intead of the view controller i created for it. The answer was to go to MainWindow.xib then select View Controller - Home then go to Identity Inspector and select the View Controller i created for it in this case the HomeViewController.h

Best Way To Create an "Add" View Controller

I have a table view that contains a list of Project objects. When an item is selected it brings up a detail view. Pretty standard. What is the best way to implement "add" functionality (popup a modal view controller to input new values and save the item)?
Currently I have view controllers for my root view, detail view, and add view. Essentially the detail view and add view are exactly the same except for a save & cancel button in the add view. Is it possible to reuse the detail view in the add view?
Finally, what is the best way to display the list of project properties in a grouped table view separated into sections?
Thank you for your responses.
Most likely, you are already passing your detail view controller a managed object that it is supposed to display when in detail view mode. When the user decides to add a new project, just create a blank object, pass it to the detail controller and display it. (You might want to insert this blank object into another "empty" managed object context in case the user cancels the add process to avoid having to clean up your main managed object context in that case.)
The detail view controller would also need a flag that tells it whether it is in edit or add mode so it can adjust its controls (and possibly delegate messages it sends to its owner) accordingly. You would set the flag to the appropriate value before you display the controller.
It sounds like you're looking for a UINavigationController. The UINavigationController lets you push new view controllers on top of existing ones. It gives you a navigation bar at the top that will allow the user to go back to the root controller. I think it's the kind of controller Apple uses it in the default email application, to give you an example.
Concerning organization: you design your root view controller and a detail/add view controller. In your app delegate, you attach a UINavigationController to the window and you set its root controller to the main controller you want to display. That root controller can then push the add/detail controller onto the stack (and when it does so, it can tell the add/detail controller which types of button to display.)
I can't answer your grouped properties question, but it sounds like a separate question anyway.

How to edit the MainWindow.xib (to change the default view it loads)

Hi I am trying to change the default view MainWindow.xib loads. I am using view based app. I changed the app delegate file, added my new view as a subview to the main window. but in interface builder it still says mainwindow.xib loads from the default view not my newly added view. (BTW I added a new xib file for my new view and that is the one I want to load at startup.)
thanks.
If you want to change from using MyAppViewController.xib to `MyOtherView.xib', you also need to change the class of the view controller in Interface Builder. You can do this by selecting the view controller, going to the Identity tab (the last one) and putting the class name of your new view controller in the "Class" field.
Change the 'Main nib file base name' in the Info.plist of your App too if you have another Main.XIB.