Bruno LSB

Bruno LSB

  • NA
  • 212
  • 2.2k

MVC c# @Html.TextBoxFor and @value = "@Session["Tel"]"

Feb 1 2021 5:37 PM
Hello,
 
In a form I manage to run the following code with this line:
 
<input id="Tel1" name="Tel" type="text" value="@Session["Tel"]@Request.Form["Tel"]" class="form-control" />
 
How to replace this line with this one:
 
@Html.TextBoxFor(model => model.Tel, new { @value = "@Session["Tel"]@Request.Form["Tel"]", @class = "form-control" })
@ Html.TextBoxFor does not accept value ("@Session["Tel"]@Request.Form["Tel"]") !
 
how to escape # ?
thank you

Answers (2)