0

I currently have a Web Forms application which I'd like to use the MVC Html helpers for. Ex, I'd like to use Html.SelectList instead of the asp:DropDownList control due to the nature of not being able to specify a name property for that control if it's within a master page.

Would I need to import some Nuget packages to get to the Mvc Html helpers and the SelectList class?

1

1 Answer 1

1

The link posted to your comment just said it is possible.

My answer is not worth it.

Mainly, ASP.Net Web Form is event based model. You cannot access it easily in code behind, even if you can render Select html like MVC Helper.

ASP.Net Web Form doesn't have model binder like MVC. So when post back, only way you can access that html selector is to search in Form directly - var mySelector = Request.Form["MySelector"];

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

1 Comment

You win the answer contest by default, sir. SO wouldn't let me post a "Trivial" answer and forced it as a comment.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.