Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3851000
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T17:05:44+00:00 2026-05-19T17:05:44+00:00

When I put a part of my form in a partial view, all form

  • 0

When I put a part of my form in a partial view, all form parts get unobstructive syntax except the form elements in the partial view.

The only way I found how to “apply” the unobstructive syntax, is by starting another form inside the partial view.

View:

@using (Ajax.BeginForm("SubmitHandler", new DefaultAjaxOptions()))
{
    @Html.EditorFor(m => m.Name)
    @Html.Partial("MyPartialView", Model)
}

PartialView:

@Html.TextBoxFor(m => m.SomeContent)

Output:

<input class="text-box single-line" data-val="true" data-val-required="This field is required." id="Name" name="Name" type="text" value="">
<input id="SomeContent" name="SomeContent" type="text" value="0">

So only the input element from the View has the unobstructive syntax and the partial view hasn’t…

Is there a way to apply unobstructive syntax inside a partial view, wich doesn’t require you to begin a new form?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T17:05:45+00:00Added an answer on May 19, 2026 at 5:05 pm

    I actually found a better solution! Went digging a bit in the asp.net mvc code and the MvcForm class creates all the unobstructive validation syntax.

    so if you use:

    @using(new MvcForm(ViewContext))
    {
    }
    

    instead of

    @using(Html.BeginForm())
    {
    }
    

    it will still apply the unobstructive syntax, but won’t create the form html tags 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I put the variables email and password from POST to GET such that Part
As part of a system I am working on we have put a layer
I need to put WCHAR[] to std::cout ... It is a part of PWLAN_CONNECTION_NOTIFICATION_DATA
I want to put an image on a button, but I want part of
Put it another way: what code have you written that cannot fail. I'm interested
Put them all in one separate folder structure or along with classes which implements
We put all of our unit tests in their own projects. We find that
Simply put, is there a way to create a 2D javascript array using similar
I have a form on a page that is for the most part straight
We have a long page that contains a bunch of different form elements. One

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.