I assign a value to input
by jquery
in document ready
$(document).ready(function () {
$("#input_1").val(“valor de prueba”);
});
In the body, there is the input
and attempt to send its value by url.action
<body>
<input id=" id=”input_1" runat="server" type="text" value="" />
<a href="<%:Url.Action("Enviar","Test", new { format = "xls",dato_input = input_1.Value})%>">
<img src="<%:Url.Content("~/Images/iconos/export_btn.png")%>" /></a>
</body>
And in the controller, I receive the data:
public void Enviar (string format, String dato_input)
{
}
But when I get to the controller, I realize that dato_input comes null , so on screen, the input
has value.
I would like to know how to send data from a input
as a parameter to a controller method, I do not know why it does not work the way I do it