The partial view just needs a form around the submit button etc whose action points to the action that generated the parent view and whose method is post. Submitting the form then posts the data to that action which will process it and return the view as normal.
This is all incredibly basic MVC stuff, you'd be best going through a book on MVC to learn the basics and how to do these things will become clear.
Hi..Im Beginner in asp.net mvc4..pls can you help me ..im trying to learn AutoMapper using EF..can you provide me your valueable guidance ..how to code AutoMapper..
im getting the error.. Missing type map configuration or unsupported mapping.
All the new features of MVC can be implemented by using ASP.Net (it may be tedious way / we may need to write lengthy code to achieve it) then why we need MVC?
e.g.- DAL is there is MVC and ASP.net both
Code behind can be reused by creating Modular coding.
We can return results as per customer need in ASP.Net / WCF.
Viewstate is bulky but we can disable it.
then Why MVC?
You have to create 2 or 3 MVC projects to really appreciate it. I thought the same thing until project 3 of mine, now I'm not going back to web forms. One of my questions was why use Razor, it's stupid. Now I use Razor as much as I can.
There's just too many reasons why to list here.
For me, I can write windows apps that can access an MVC websites data, read and write.
I've done it in Web Forms, but MVC was way faster to write for me.
And I really like the DAL, Model, Controller part of MVC. For me the View is just another way to output from the controller.
When you say asp.net you mean webforms, as MVC is still asp.net.
One of the main advantages of MVC is something that people don't really take advantage of, but more of your code is unit-testable as the layers have a greater separation. With webforms your code-behind isn't really testable, but with MVC it is. It also makes your code easier to use\share with ajax calls as the concept of returning html in partialviews is easier to leverage than getting your user controls to return html.
It's just a different presentation paradigm really, and it has its "downsides" too, namely that the page elements out of the box are limited to html elements whereas webforms comes with all manner of rich controls. It also requires a better understanding of html and http which webforms hides from you so people going from webforms to MVC can struggle with that too. A lot of people go from webforms to MVC and their first question is essentially how to use a gridview that has adding\updating\deleting features etc, and people who ask questions like that should just stick to webforms.
I am working on a MVC project and I am having few issues with textbox lost focus event.
First I have a form there are four textboxes field, on first text box we need to pass name of the employee but we have called this textbox lost focus event to populate all records of Employee if it is already in the database but I am having problem when I pass name in the textbox and clicking "save" button then first textbox event called to check if record exist in the database or not then I need to reclick button once again to save my records if not exist.
So in that case I have to click button twice.
Please help with your thoughts I do not want user to click twice.