<%using (Html.BeginForm("Upload", "Photos", new { id = Model.Gallery.GalleryID }, FormMethod.Post, new { @enctype = "multipart/form-data" }))
{%>
<p>
<span class="bold block">Photo 1:</span>
<input type="file" name="File1" class="block" />
<span class="bold block">File Name:</span>
<input type="text" class="txt-base width50" id="txtFile1" />
<span class="bold block">Description</span>
<input type="text" class="txt-base width80" id="txtCaption1" />
</p>
<p>
<input type="submit" class="btn-admin cursorPointer" value="Upload" />
</p>
<%}%>
Мне нужно получить значения txtFile (i) и txtCaption (i) ...
for (int i = 0; i < Request.Files.Count ; i++)
{
var hpf = Request.Files[i];
var strFileName = Request.Form["txtFile" + (i + 1)];
var strCaption = Request.Form["txtCaption" + (i + 1)];
...
...
Но поскольку метод является "FormMethod.Post", я не могу получить значения с помощью Request.Form ["txtFile1"];
Как я могу получить значения формы, пока ее метод отправляется?
Заранее спасибо