Click here to Skip to main content
16,022,417 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a simple View which updates a model:
@model FixPostWeb.Models.PostModel
....
@using (Html.BeginForm("Index", "FixPost",  FormMethod.Post))
{
 ... 
    <div class="update-field">
          @Html.TextAreaFor(model => model.OriginalPost)
    </div> 
    
    <div class="update-field">
          @Html.TextAreaFor(model => model.ConvertedPost)
    </div> 
}

In my controller I have a code:
C#
public ActionResult FixPost(PostModel post)
{
....
    post.OriginalPost = "aaaaaaaaa";
    post.ConvertedPost = "aaaaaaaaa";
    return View(post);
...


But on return page the model.OriginalPost and the model.ConvertedPost show the value from the previous screen. I went through debugger and I am sure that "return View(post)" is executed where post.OriginalPost = "aaaaaaaaa"; and post.ConvertedPost = "aaaaaaaaa"; but instead values "aaaaaaaaa" it shows values from the previous screen.

Any ideas what I did wrong?

Thanks,

zalek
Posted
Comments
SwarupDChavan 5-May-14 8:54am    
Try to assign the value to the textbox after retrieving the the data by making an ajax call in the document.ready just a wild guess that it might help not sure .

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