ASP.NET Question regarding onchange not firing the subroutine in code behind

  • Thread starter Thread starter FordIT
  • Start date Start date
F

FordIT

Guest
Body of index.cshtml looks like the following.

<body>
@*<form enctype="multipart/form-data" method="POST" > @*action="/upload">*@
<div class="content px-4">
<h1>QLS 5 Day Late File Upload</h1>
<table style="width:100%">
<tr>
<td style="width:25%"></td>
<td style="width:50%" align="left">
<p>
1) Run the report below in QLS.<br />
2) Save the file to a directory, noting file name and directory.<br />
3) Upload file to server.<br />
</p>
</td>
<td style="width:25%"></td>
</tr>
</table>
<div>
@*<input type="file" name="qlsFile" id="qlsFile" OnChange="SubmitFile" />*@
<label for="qlsFile">Select 5 Day Late File</label>
<input type="file" name="nFile" id="qlsFile" accept=".csv,.txt" onchange="SubmitFile()" />
<input type="submit" id="btnUpload" text="Upload" runat="server"/>



<br /><br />
</div>

<embed src="pdf/Steps.pdf" width="100%" height="1100px" />
</div>
@* </form>*@
</body>

Code Behind index.cshtml.cs looks like this.

public void SubmitFile()
{
System.Diagnostics.Debug.WriteLine("submitFile");
}
Is there a reason that after selecting the file in never calls the code behind? I have tried Razor, Blazor, ASP.NET, visual Studio professional, vscode (currently trying vscode). I have done numerous examples from youtube but none seem to work. Really confused...thanks!






FordIT

Continue reading...
 
Back
Top