Let's Offer 2 approaches shown with easy examples:
The quickest way is to send it through query String. like this:
public ActionResult Index()
{
TempData["message"] = "Hi";
return View();
}
[HttpGet]
public ActionResult About(string str1, string str2) { . . . }
then, in your index view:
@{
string str = TempData["message"].ToString();
@Html.ActionLink("Go to About View", "About", new { str1 = @str, str2="some text"})
}
On the other hand, you can Post you data to controller, rather than sending via query string;
Let's imagine we have a simple view model here:
public class DoubleStr_ViewModel
{
public string str1 { get; set; }
public string str2 { get; set; }
}
then inside the controller:
public ActionResult About()
{
TempData["message"] = "Hi";
return View(new DoubliStr_ViewModel());
}
[HttpPost]
public ActionResult About(DoubleStr_ViewModel input)
{
return View();
}
And now, inside the About View:
@using Your.Path.To.ViewModels
@model DoubleStr_ViewModel
<input type="hidden" value="@TempData["message"].ToString()" id="tmpHidden" />
<form method="post">
@Html.HiddenFor(x => x.str1)
@Html.TextBoxFor(x => x.str2)
<button type="submit">SUBMIT</button>
</form>
@section scripts{
<script>
$('form').submit(function () {
$('input#str1').val($('input#tmpHidden').val());
});
</script>
}
In your case, to trigger form submit, you'll have:
$('#btnContinue').click(function () {
// first, fill the hidden value(s) into your model
$('input#str1').val($('input#tmpHidden').val());
var createFormName = $("#createFormName");
createFormName.submit();
}
Hope, this helps.