I am working on a JavaScript function that looks like this:
<script type="text/javascript">
function doSomething() {
var s = 'some data'
return s; }
</script>
and
@using (Html.BeginForm(new { data_to_send = x))
{
//some form controls that are sent to the controller via model
}
My question is, is it possible and how can I assign the value returned by the doSomething
function to the x
variable in the form?
I don't need x
in my model because it won't be stored in the database. It's just some additional information from the user on how to manipulate the data in the model before saving it to the database.
Edit: The controller action is:
public actionresult MyController(string data_to_Send, model) {}