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 6187487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:04:01+00:00 2026-05-24T02:04:01+00:00

In Html.Editor (technically EditorExtensions.Editor ) there is an overload with the signature of public

  • 0

In Html.Editor (technically EditorExtensions.Editor) there is an overload with the signature of

public static MvcHtmlString Editor(
    this HtmlHelper html,
    string expression,
    Object additionalViewData
)

How exactly are you supposed to use additionalViewData? The MSDN documentation is not clear at all.

My first thoughts were along the lines of:

@Html.Editor("quijibo", new { quijibo = "homer simpson" })

However this doesn’t work so I’m at a loss at this point.

Edit: Revised question to be How do you directly load a value from Object additionalViewData in Html.Editor? I want a value I place in additionalViewData to be used as the data value of that editor.

  • 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-24T02:04:02+00:00Added an answer on May 24, 2026 at 2:04 am

    The answer to my question is that it is impossible with the built in classes.

    The code structure of them overwrites anything you would stuff into

    htmlAttributes: new { value = "x" }.

    I found this to be very inconvenient. I created methods to parallel the internal workings of the MVC methods that are all similar to:

    private static TagBuilder CreateHiddenTag(string inputName, object value, 
            object htmlAttributes)
    {
        var tagBuilder = new TagBuilder("input");
    
        tagBuilder.MergeAttribute("type", "hidden");
        tagBuilder.MergeAttribute("name", inputName);
    
        tagBuilder.GenerateId(inputName);
    
        if (value != null)
            tagBuilder.MergeAttribute("value", value.ToString());
    
        if (htmlAttributes != null)
            tagBuilder.MergeAttributes(
                HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes), 
                replaceExisting: true);
    
        return tagBuilder;
    }
    

    The major difference is that I ordered calls such that tagBuilder.MergeAttributes is last so that you can always override ANYTHING using the object htmlAttributes. The MVC source code goes the opposite way and applies the attributes first, thereby making their solution substantially less flexible.

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

Sidebar

Related Questions

Is there a web (i.e. html) text editor with autocomplete? Let's say I want
Value Loss in my HTML editor and fileupload ctrl This is my sample code
I want a WYSIWYG html editor to create a static web page. After some
CKEditor is a word like html editor. There is a option like saving file
I am using an User Control/Html Editor in which there is an Iframe, since
I'm creating an HTML editor, similar to this one I'm typing in right now
i'm creating a simple html editor with jquery. say i have this html: <div
Using a WYSIWYG HTML editor in one of my sites there is an ahref
I am using Dmxzones Advanced HTML Editor 3 which inserts the following code: <textarea
I'm looking for a HTML editor that kinda supports templated editing or live snippets

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.