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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:30:26+00:00 2026-06-08T18:30:26+00:00

this is my view: @using (Html.BeginForm()) { foreach (Mvc3Intranet.Models.Dispatcher item in ViewBag.DispatcherList) { <div>

  • 0

this is my view:

@using (Html.BeginForm())
{
    foreach (Mvc3Intranet.Models.Dispatcher item in ViewBag.DispatcherList)
    {
    <div>
        <input type="text" value="@(item.Fullname)" name="txtName@(item.Id)" data-tmp="@(item.Tmp)" /></div>
    }
    <input type="submit" name="test" value="Save" />
}

this is the HTML:

<form action="/" method="post">    
    <div>
        <input type="text" value="Ray1" name="txtName1" data-tmp="AAA" /></div>
    <div>
        <input type="text" value="Ray2" name="txtName2" data-tmp="BBB" /></div>
    <div>
        <input type="text" value="Ray3" name="txtName3" data-tmp="CCC" /></div>
    <div>
        <input type="text" value="Ray4" name="txtName4" data-tmp="DDD" /></div>
    <input type="submit" name="test" value="Save" />
</form>

after form postback, how do i access to data-tmp values in the controller?

[HttpPost]
public ActionResult Index(string test)
{
}

Request["txtName1"] returns the valid of textbox but not the data-tmp attribute value. Since this can be done in asp.net web form, i assume the same in asp.net mvc also, or not?

  • 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-06-08T18:30:28+00:00Added an answer on June 8, 2026 at 6:30 pm

    Attributes aren’t included in the Request.Forms dictionary. You would have to post your additional data as a hidden field or to the query string

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

Sidebar

Related Questions

I have this view @model IEnumerable<ViewModelRound2> ... <snip> ... @{ using (Html.BeginForm(new { round1Ring3Bids
My SearchUsers View looks as such : <% using (Html.BeginForm()) {%> <fieldset> <legend>Fields</legend> <div
I have a PaartialView declared like this: @model IEnumerable<mvc1.Models.ProjectDetailModel> @using (Html.BeginForm()) <form method=get action=EditProject
I want to manipulate HTML using a custom view engine like this: protected override
I have a mvc2 application with a view like this <% using (Ajax.BeginForm(UserApprove, new
I have this view: @model MatchGaming.Models.ProfileQuery @{ ViewBag.Title = Index; } <h2>Index</h2> <script src=@Url.Content(~/Scripts/jquery.validate.min.js)
This is my View. How to use CheckboxFor(): @using eMCViewModels; @model eMCViewModels.RolesViewModel @{ ViewBag.Title
I have this this View for rendering form @using ExpertApplication.ViewModels @model IEnumerable<QuestionViewModel> @{ ViewBag.Title
I wanted to generate a list view using below code. But after running this
I am using EF4 to read data from a view .This is a summary

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.