I am trying to use ViewBag inside quotes in ASP.NET like so:
@using (Html.BeginForm("Index?community=" + @ViewBag.community + "&lot=" + @ViewBag.lot + "",
"UploadFile",
FormMethod.Post,
new { enctype = "multipart/form-data" }))
{
<label for="file">Upload File:</label>
<input type="file" name="file" id="file" /><br><br>
<input type="submit" value="Upload File" />
<br><br>
@ViewBag.Message
}
I have also tried the following:
@using (Html.BeginForm("Index?community=@ViewBag.community&lot=@ViewBag.lot",
"UploadFile",
FormMethod.Post,
new { enctype = "multipart/form-data" }))
{
<label for="file">Upload File:</label>
<input type="file" name="file" id="file" /><br><br>
<input type="submit" value="Upload File" />
<br><br>
@ViewBag.Message
}
Is it possible to use @ViewBag inside quotes ?