MVC3: What's the meaning of the htmlAttributes in this line?

Posted on 2011-10-22
Last Modified: 2012-05-12
The fourth parameter of this call to BeginForm is "object htmlAttributes".

 @using (Html.BeginForm("StructureCheck", "Samples", new { id = Model.SubmissionID }, FormMethod.Post, new { id = "selectProduct" }))

In this case, the value being passed is:
new { id = "selectProduct" }

What does this do exectly?
Question by:newbieweb
    LVL 74

    Accepted Solution

    According to , it should be adding those attributes to the <form> tag that is generated by the BeginForm function. So for your example, your resulting page should show:

    <form id="selectProduct">

    Open in new window


    Author Comment

    I don't get what you mean by "adding those attributes". It's a parameter in the BeginForm call, which then contains the entire form.

    Please explain further, if you could.


    Author Closing Comment

    Thanks. I do get it.

    Thank you.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now