0

I need to show in the Comment text area the id of the property about it are consulting, I took it from the view Details where have a button "Consult".

In the Details view:

<a class="btn btn-primary" href="@Url.Action("Contact", "Home", new {PropertyId = @Model.PropertyModel.Property.PropertyId})#consult">
<i class="icon-envelope">
</i>
@Resources.Property.Details.Consulta
</a>

In HomeController:

public ActionResult Contact(string PropertyId)
{
    UserRepository userRepository = new UserRepository();
    User user = userRepository.GetUserByEmail(User.Identity.Name);
    ContactModel model = new ContactModel(user);
    model.Comment = PropertyId;
    return View(model);
}

In ContactModel:

[Required]
[Display(Name = "Comment", ResourceType = typeof(Resources.Entities.Names))]
public string Comment { get; set; }

In Contact.cshtml:

<div class="control-group">
    @Html.LabelFor(m => m.Comment, new { @class = "control-label" })
    <div class="controls">
        @Html.TextAreaFor(m => m.Comment, new {@rows = "6", @style="width:80%;"})
        @Html.ValidationMessageFor(m => m.Comment) 
    </div>
</div>

Do you know how to make it work?

ekad
  • 14,436
  • 26
  • 44
  • 46
vicky_864
  • 57
  • 8
  • 1
    The first step to making it work is to know what the problem is. The second step is to tell us what the problem is so that we can help you with the first step. – John Saunders Jun 15 '15 at 18:44

1 Answers1

0

Thanks for answering! The problem is that doesnt appear the id info (wich i give to the controller with url action) in the text área called comment. I dont see what is wrong un the way that im doing it.

vicky_864
  • 57
  • 8