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

  • SEARCH
  • Home
  • 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 3807770
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T15:02:37+00:00 2026-05-19T15:02:37+00:00

I have a problem in mvc3. Im not sure this is specifically mvc3 but,

  • 0

I have a problem in mvc3. Im not sure this is specifically mvc3 but, Im currently using that with razor engine. Anyway, the problem that I am facing is, I have a form, I use the TextBoxFor, CheckBoxFor, etc. to render it. The rendering is working flawless, except, when I try to post the data, I basically post an empty form with null values.

Here is my model:

public class SendReplyPmForm : PM
{
    public new string Text { get; set; }

    public bool IsOriginalDelete { get; set; }

    public int ReplyNr { get; set; }

    public string ReceiverName { get; set; }
}

I have an extra viewmodel layer between the view and the model and it contains an extra paramater regarding this model

public class IndexViewModel
{
     public SendReplyPmForm SendReplyPmForm { get; set; }
      ...

here is my view

@using (Html.BeginForm("SendReply", "Pm", FormMethod.Post, new { id = "formSendMsg" }))
{
            @Html.TextBoxFor(model => model.SendReplyPmForm.ReceiverName, new { id = "ReceiverName" })
            <span id="spanChkText">Delete Original Message: @Html.CheckBoxFor(model => model.SendReplyPmForm.IsOriginalDelete, new { id = "chkIsOriginalDelete", value = 1 })</span>

    @{Html.RenderPartial("~/Areas/Forums/Views/Shared/Toolbar.cshtml");}

        <span class="spanLabel">Message</span>
            @Html.TextAreaFor(model => model.SendReplyPmForm.Text, new { id = "Text", rows = "10", cols = "65" })

    @{Html.RenderPartial("temp.cshtml");}

    @Html.HiddenFor(model => model.SendReplyPmForm.ReplyNr, new { id = "inputReplyNr", value = 0 })

        <input  type="submit" value="Send" />

}

and here i have the controller

[HttpPost]
    public ActionResult SendReply(SendReplyPmForm SendReplyForm) {
       var ViewModel = new IndexViewModel();
       .
       .
       .

        return View("Index", ViewModel);
    }

The strange thing is, if I use pure HTML instead of the Html helpers, then the post is going smoothly without any problem.

I read this article (ASP.NET MVC’s Html Helpers Render the Wrong Value!) before I post this, but im not quite sure, that I have the same issue. (f.e.: I dont have action in my controller, that has the same name), but the fact that is also working with pure Html that makes me think.

Do you guys have any idea, how can I use this form with the Html helpers?

  • 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-19T15:02:38+00:00Added an answer on May 19, 2026 at 3:02 pm

    I believe your problem is the same as here, so you need to add a prefix:

    [HttpPost]
    public ActionResult SendReply([Bind(Prefix="SendReplyPmForm")]SendReplyPmForm SendReplyForm)
    {
      ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using MVC3 with EF (version 4, but not sure if 4.0,4.1,etc). I've been
I'm writing a site in MVC3, using Entity (linked to Postgres, but not sure
I have problem using annotated validation in spring 3 mvc. I´m not sure if
I am sure this has been asked already, but I have been trying all
I am using JQuery and MVC3 razor on a project and I have a
I cannot find a solution with this problem. I have to join TWO MVC3
I'm confused about this one. I'm using razor with MVC 3 and I have
i have a problem with the asp.net MVC3. when i create a new project
I have problem creating new instance of excel 2007 using VBA (from Access 2002).
I have problem with fancybox. I want to write a function that will run

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.