1

I'm new to MVC and want to get the value and text from a dropdown from the view to the controller.

I can get the value like this

[HttpPost]
public ActionResult Create(Appointment appointment)
{                
    var site = Request["siteSelect"];
}

But how do I get the Text?

2
  • could you please post the code of your corresponding View? thanks Commented May 6, 2014 at 14:34
  • possible duplicate of Returning Text From A DropDown MVC Commented May 22, 2014 at 12:07

1 Answer 1

2

You can't, the text from the dropdown will not be sent when the form is posted to the server.

Check this post: Returning Text From A DropDown MVC

Sign up to request clarification or add additional context in comments.

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.