0

having an issue in asp.net mvc, browser is displaying complete model as part of query string.

I have first method which gives list of employees

   [HttpGet]
    public ActionResult GetEmployees()
    {
          model.employees = GetEmployeeList()
      return View(model);
    }

   [HttpPost]
   public ActionResult DisplayEmployee(Guid id)
   {
    model.emp=GetEmployeeDetails(id);
     return View("GetEmployees",model);
   }

I am getting the complete query string as following

StakeWorking=ColloSys.DataLayer.Domain.StkhWorking&StkHolder=ColloSys.DataLayer.Domain.Stakeholders&StkhPaymentP=ColloSys.DataLayer.Domain.StkhPayment&StakeAddress=ColloSys.DataLayer.Domain.GAddress&StakeAddressDetails=ColloSys.UserInterface.Models.StakeAddressDetails&StkhWorkingDetails=ColloSys.UserInterface.Models.StakeWorkingDetails&ListOfRegion=System.Collections.Generic.List%601%5BSystem.String%5D&ListOfProduct=System.Collections.Generic.List%601%5BSystem.String%5D
3
  • 2
    What does your view looks like? Without the code for the View it is impossible to say why it outputs the given string. Commented Jun 19, 2013 at 5:52
  • 1
    Can you shared the code of your View? Commented Jun 19, 2013 at 5:53
  • Can you share the code for your Form tag in view? Commented Jun 19, 2013 at 11:15

2 Answers 2

1

The problem is solved. Actually problem in the post method of DisplayEmployee action i tried this and problem is solved

   [HttpPost]
   public ActionResult DisplayEmployee(Guid id)
   {
    model.emp=GetEmployeeDetails(id);
     return View("GetEmployees");
   }
Sign up to request clarification or add additional context in comments.

Comments

0

You can check your view for model binding is done correctly.

Take look here.. a similar issue

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.