Click here to Skip to main content
15,899,126 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi

I have crated a View in which I am calling two partial views.

Partial View 1

It contains a form with multiple textbox and dropdown.
When a user clicks on submit button the data gets saved in database and simultaniously it is displayed in Partial View 2.

Partial View 2

In this partial view I have an edit button. When the user click on the edit button corresponding values should be filled in the form. How can I do this. I am not using Entity Framework. Without it how can I achieve this?



Thanx.
Posted

1 solution

You must call the partialview of edit for with the selected model.
C#
// returning partial
public ActionResult Edit(int idtoedit)
{
    //get row to edit and place it in viewdata
    
    return PartialView(editformpartialview, viewdata);
}
 
Share this answer
 
v2
Comments
mayank.bhuvnesh 18-Sep-15 14:46pm    
Sorry buddy but can u give an example...ss I tried but was unable to do this....:(
I dont know what I missed.....

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900