在.net 4.5.2与.net 4.0下的Request.form处理 [英] Request.form processing under .net 4.5.2 vs .net 4.0

查看:106
本文介绍了在.net 4.5.2与.net 4.0下的Request.form处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用.net 4.0在visual studio 2010中开发的应用程序。  该应用程序允许用户填写包含要上载的文件的表单。  表单将提交给cgi-pgm可执行文件。  传递给可执行文件的
字段之一是可执行文件将提交结果表单的URL。  生成的表单中包含html代码。  我的代码包含  validateRequest =" false"在页面声明中,我有< httpRuntime
  requestValidationMode =" 2.0" />在我的web.config文件中。  当应用程序运行时,我能够检索生成的表单,解析它并提取所需的信息。 


我正在尝试将此应用程序转换为.net 4.5。 2在visual studio 2015中。我复制了2页的代码和后面的代码。  但是,当应用程序运行时,返回的表单包含"Nothing"。


我认为表单处理在.net 4.5.2下的处理方式不同于4.0。


这是我初始页面的HTML代码,我向用户索取信息:

<%@页面语言=" vb" AutoEventWireup = QUOT假QUOT;代码隐藏= QUOT; payroll_1.aspx.vb"继承= QUOT; AccuRecordDirect.payroll_1" %GT; 

<!DOCTYPE html>

< html xmlns =" http://www.w3.org/1999/xhtml">
< head runat =" server">
< title>< / title>
< / head>
< body>
< form id =" form1" RUNAT = QUOT;服务器">
< div class =" accountInfo75">
< fieldset class =" login">
< legend>提交工资单 - 第1步,共2步< / legend>
< p>
< asp:Label ID =" lblUserNameLabel" RUNAT = QUOT;服务器"文本= QUOT;">< / ASP:标签>
< asp:表ID ="表1" RUNAT = QUOT;服务器">
< asp:TableRow>
< asp:TableCell>
< asp:Label ID =" Label1" RUNAT = QUOT;服务器"文本= QUOT *文件&安培; NBSP;至&安培; NBSP;上传">< / ASP:标签>
< / asp:TableCell>
< asp:TableCell>
< asp:FileUpload ID =" uploadfile" RUNAT = QUOT;服务器"的ClientIDMode = QUOT;静态" />
< asp:PlaceHolder ID =" PlaceHolder1" RUNAT = QUOT;服务器">
< input id =" ct100 $ MainContent $ plantype"类型= QUOT;隐藏" value ='8622'name =" ct100 $ MainContent $ plantype" />
< input id =" ct100 $ MainContent $ CompName"类型= QUOT;隐藏" value ='测试计划名称'name =" ct100 $ MainContent $ CompName" />
< input id =" ct100 $ MainContent $ Client"类型= QUOT;隐藏" value ='A'name =" ct100 $ MainContent $ Client" />
< input id =" ct100 $ MainContent $ BetaPayroll"类型= QUOT;隐藏" value ='1'name =" ct100 $ MainContent $ BetaPayroll" />
< input id =" ct100 $ MainContent $ UserID"类型= QUOT;隐藏" value ='jrs'name =" ct100 $ MainContent $ UserID" />
< input id =" ct100 $ MainContent $ hPartner"类型= QUOT;隐藏" value ='<%Response.Write(Session(" hPartner")))%>'name =" ct100 $ MainContent $ hPartner" />
< / asp:PlaceHolder>
< / asp:TableCell>
< asp:TableCell>
& nbsp;
< / asp:TableCell>
< / asp:TableRow>
< asp:TableRow>
< asp:TableCell>
< asp:Label ID =" Label2" RUNAT = QUOT;服务器"文本= QUOT;表&安培; NBSP;名称:">< / ASP:标签>
< / asp:TableCell>
< asp:TableCell>
< asp:TextBox ID =" Sheet" RUNAT = QUOT;服务器"宽度= QUOT; 200" ClientIDMode =" Static">< / asp:TextBox>< br />
< asp:Label ID =" Label3" RUNAT = QUOT;服务器" Text ="< I>如果未提供工作表名称,则假定文件中的第一个工作表。< / I>"的CssClass = QUOT; smallTextOnLable">< / ASP:标签>
< / asp:TableCell>
< asp:TableCell>
< asp:Label ID =" Label4" RUNAT = QUOT;服务器" Text ="如果您的电子表格包含多个工作表名称,则只在此处输入值。& nbsp;& nbsp;如果您不确定,请将此字段留空。">< / asp:Label>
< / asp:TableCell>
< / asp:TableRow>
< asp:TableRow>
< asp:TableCell>
< asp:Label ID =" Label5" RUNAT = QUOT;服务器"文本= QUOT *联系与安培; NBSP;名称:">< / ASP:标签>
< / asp:TableCell>
< asp:TableCell>
< asp:TextBox ID ="联系人" RUNAT = QUOT;服务器"的MaxLength = QUOT; 40"宽度= QUOT; 200" ClientIDMode =" Static">< / asp:TextBox>< br />
< asp:RequiredFieldValidator ID =" RequiredFieldValidator2" RUNAT = QUOT;服务器" ErrorMessage ="联系人姓名是必填字段。"的ControlToValidate = QUOT;联系与QUOT;的CssClass = QUOT; failureNotificationSmall">< / ASP:RequiredFieldValidator的>
< / asp:TableCell>
< asp:TableCell>
< asp:Label ID =" Label7" RUNAT = QUOT;服务器" Text ="工资单提交问题时的联系人姓名。">< / asp:Label>
< / asp:TableCell>
< / asp:TableRow>
< asp:TableRow>
< asp:TableCell>
< asp:Label ID =" Label6" RUNAT = QUOT;服务器"文本= QUOT *电子邮件&安培; NBSP;地址:">< / ASP:标签>
< / asp:TableCell>
< asp:TableCell>
< asp:TextBox ID =" EMail" RUNAT = QUOT;服务器"宽度= QUOT; 200"的MaxLength = QUOT; 50" ClientIDMode =" Static">< / asp:TextBox>< br />
< asp:CustomValidator runat =" server" ID = QUOT; CustomValidator1"
ControlToValidate =" EMail"
OnServerValidate =" validateEMail"
cssClass =" failureNotificationSmall"
ErrorMessage ="输入的电子邮件地址无效。" />
< / asp:TableCell>< asp:TableCell>
< asp:Label ID =" Label8" RUNAT = QUOT;服务器" Text ="在工资单提交问题的情况下联系人的电子邮件地址。">< / asp:Label>
< / asp:TableCell>< / asp:TableRow>< asp:TableRow>
< asp:TableCell>
< asp:Label ID =" Label9" RUNAT = QUOT;服务器"文本= QUOT *电话及安培; NBSP;数:">< / ASP:标签>
< / asp:TableCell>< asp:TableCell>
< asp:TextBox ID =" Phone" RUNAT = QUOT;服务器"的MaxLength = QUOT; 12英寸宽度= QUOT; 200" ClientIDMode =" Static">< / asp:TextBox>< br />
< asp:CustomValidator runat =" server" ID = QUOT; CustomValidator2"
ControlToValidate ="电话"
OnServerValidate =" validatePhone"
cssClass =" failureNotificationSmall"
ErrorMessage ="输入的电话号码无效。" />
< / asp:TableCell>< asp:TableCell>
< asp:Label ID =" Label10" RUNAT = QUOT;服务器" Text =" xxx-xxx-xxxx格式的联系人电话号码。">< / asp:标签>
< / asp:TableCell>< / asp:TableRow>< asp:TableRow>
< asp:TableCell>
< asp:Label ID =" Label11" RUNAT = QUOT;服务器"文本= QUOT *薪资&安培; NBSP;结束&安培; NBSP;日期:">< / ASP:标签>
< / asp:TableCell>< asp:TableCell>
< asp:TextBox ID =" PayDate" RUNAT = QUOT;服务器"的MaxLength = QUOT; 10"宽度= QUOT; 200"的ClientIDMode = QUOT;静态" />< br />
< asp:CompareValidator ID =" CompareValidatorPEDate" RUNAT = QUOT;服务器"的ControlToValidate = QUOT; PayDate"操作者= QUOT; DataTypeCheck"类型="日期"的CssClass = QUOT; failureNotificationSmall" ErrorMessage ="期间结束日期是必需的。" SetFocusOnError = QUOT;真">< / ASP:CompareValidator>
< / asp:TableCell>< asp:TableCell>
< asp:Label ID =" Label12" RUNAT = QUOT;服务器"文本= QUOT;">< / ASP:标签>
< / asp:TableCell>< / asp:TableRow>< asp:TableRow>
< asp:TableCell>
< asp:Label ID =" Label13" RUNAT = QUOT;服务器"文本= QUOT *总计&安培; NBSP;美元&安培; NBSP;金额:">< / ASP:标签>
< / asp:TableCell>< asp:TableCell>
< asp:TextBox ID =" DolAmt" RUNAT = QUOT;服务器"的MaxLength = QUOT; 20"宽度= QUOT; 200" ClientIDMode =" Static">< / asp:TextBox>< br />
< asp:RequiredFieldValidator ID =" RequiredFieldValidator5" RUNAT = QUOT;服务器" ErrorMessage ="美元金额是必填字段。"的ControlToValidate = QUOT; DolAmt"的CssClass = QUOT; failureNotificationSmall">< / ASP:RequiredFieldValidator的>
< / asp:TableCell>< asp:TableCell>
< asp:Label ID =" Label14" RUNAT = QUOT;服务器" Text ="工资总额,包括所有供款和贷款还款。">< / asp:Label>
< / asp:TableCell>< / asp:TableRow>< asp:TableRow ID =" tblRowDepAmt">
< asp:TableCell>
< asp:Label ID =" Label15" RUNAT = QUOT;服务器"文本= QUOT *存款&安培; NBSP;金额:">< / ASP:标签>
< / asp:TableCell>< asp:TableCell>
< asp:TextBox ID =" DepAmt" RUNAT = QUOT;服务器"的MaxLength = QUOT; 20"宽度= QUOT; 200" ClientIDMode =" Static">< / asp:TextBox>< br />
< asp:RequiredFieldValidator ID =" RequiredFieldValidator6" RUNAT = QUOT;服务器" ErrorMessage ="存款金额是必填字段。"的ControlToValidate = QUOT; DepAmt"的CssClass = QUOT; failureNotificationSmall">< / ASP:RequiredFieldValidator的>
< / asp:TableCell>< asp:TableCell>
< asp:Label ID =" Label16" RUNAT = QUOT;服务器" Text ="存款金额加上从Forfeitures使用的金额(如果有)的总和必须等于Total Dollar Amount。">< / asp:Label>
< / asp:TableCell>< / asp:TableRow>< asp:TableRow ID =" tblRowForfAmt">
< asp:TableCell>
< asp:Label ID =" Label17" RUNAT = QUOT;服务器"文本= QUOT *金额&安培; NBSP;至&安培; NBSP;使用&安培; NBSP;从&安培; NBSP;没收:">< / ASP:标签>
< / asp:TableCell>< asp:TableCell>
< asp:TextBox ID =" ForfAmt" RUNAT = QUOT;服务器"的MaxLength = QUOT; 20"宽度= QUOT; 200" ClientIDMode =" Static">< / asp:TextBox>< br />
< asp:RequiredFieldValidator ID =" RequiredFieldValidator7" RUNAT = QUOT;服务器" ErrorMessage ="没收金额是必填字段。的ControlToValidate = QUOT; ForfAmt"的CssClass = QUOT; failureNotificationSmall">< / ASP:RequiredFieldValidator的>
< / asp:TableCell>< asp:TableCell>
< asp:Label ID =" lblForf" RUNAT = QUOT;服务器"文本= QUOT;">< / ASP:标签>
< / asp:TableCell>
< / asp:TableRow>
< asp:TableRow ID =" tblRowDepositMethod">
< asp:TableCell>
< asp:Label ID =" Label19" RUNAT = QUOT;服务器"文本= QUOT *存款&安培; NBSP;方法:">< / ASP:标签>
< / asp:TableCell>
< asp:TableCell>
< asp:DropDownList ID =" DepMeth" RUNAT = QUOT;服务器"的ClientIDMode = QUOT;静态">
< / asp:DropDownList>< br />
< asp:CustomValidator runat =" server" ID = QUOT; custValidateDepositMethod"
ControlToValidate =" DepMeth"
OnServerValidate =" validateDepositMethod"
ErrorMessage ="选择了无效的存款方式。" />
< / asp:TableCell>
< asp:TableCell>
& nbsp;
< / asp:TableCell>
< / asp:TableRow>
< asp:TableRow ID =" tblRowACH"可见= QUOT假QUOT;>
< asp:TableCell>
< asp:Label ID =" Label20" RUNAT = QUOT;服务器"文本= QUOT;选择&安培; NBSP一(an)安培; NBSP; ACH&安培; NBSP;位置:">< / ASP:标签>
< / asp:TableCell>< asp:TableCell>
< asp:DropDownList ID =" achaccounts" RUNAT = QUOT;服务器"的ClientIDMode = QUOT;静态">
< asp:ListItem Text =" Select one""值= QUOT; -1 QUOT;>< / ASP:的ListItem>
< asp:ListItem Text =" ------------------"值=" - 1’ >< / ASP:的ListItem>
< / asp:DropDownList>< br />
< asp:CustomValidator runat =" server" ID = QUOT; cusValidatorACHLocation"
ControlToValidate =" achaccounts"
OnServerValidate =" validateACHLocation"
ErrorMessage ="选择了无效的ACH位置。 />
< / asp:TableCell>< asp:TableCell>
& nbsp;
< / asp:TableCell>< / asp:TableRow>< asp:TableRow ID =" tblRowLocation"可见= QUOT假QUOT;>
< asp:TableCell>
< asp:Label ID =" Label21" RUNAT = QUOT;服务器"文本= QUOT;选择&安培; NBSP; A和NBSP;位置:">< / ASP:标签>
< / asp:TableCell>< asp:TableCell>
< asp:DropDownList ID =" LocationCode" RUNAT = QUOT;服务器"的ClientIDMode = QUOT;静态">
< asp:ListItem Text =" Select one""值= QUOT; -1 QUOT;>< / ASP:的ListItem>
< asp:ListItem Text =" ------------------"值=" - 1’ >< / ASP:的ListItem>
< / asp:DropDownList>< br />
< asp:CustomValidator runat =" server" ID = QUOT; cusValidatorLocation"
ControlToValidate =" LocationCode"
OnServerValidate =" validateLocation"
ErrorMessage ="选择了无效的位置。 />
< / asp:TableCell>< asp:TableCell>
& nbsp;
< / asp:TableCell>< / asp:TableRow>< / asp:Table>< / p>< p class =" submitButton">
< asp:Label ID =" lblConfirm" RUNAT = QUOT;服务器"边框= QUOT;无" Visible =" False">< / asp:Label>< br />
< asp:Button ID =" btnSubmit" RUNAT = QUOT;服务器"文本= [提交" />
< / p>
< / fieldset>
< / div>
< / form>
< / body>
< / html>

这是背后的代码:

公共类payroll_1 
继承系统.Web.UI.Page

受保护的子Page_Load(ByVal sender As Object,ByVal e As System.EventArgs)Handles Me.Load

Dim passed_data As String ="" ;

'btnSubmit.PostBackUrl =" https://www.accurecord-direct.com/cgi-pgms/displayresults.exe"
btnSubmit.PostBackUrl =" https://www.accurecord-direct.com/cgi-pgms/xlsrdr.exe"

如果不是IsPostBack那么

lblUserNameLabel.Text ="输入下面的工资单信息。< br /> * =必填字段。"


Dim sponsor_UserID As String = Session(" sponsor_UserID")
Dim sponsor_Password As String = Session(" sponsor_Password")
Session(" portNumber" )=" http:// localhost:53341"
Session(" hPartner")= Session(" portNumber")& " /Sponsor/payroll/payroll_2.aspx"

Contact.Text =" Jonathan Small"
EMail.Text =" jonathan@testemail.com"
Phone.Text =" 555-555-1212"
PayDate.Text =" 12/01 / 2015"
DolAmt.Text =" 1.00"
DepAmt.Text =" 1.00"

Dim ach_loc_lit As String =""
Dim ach_num_lit As String =""
Dim nbr_of_ach_account As Integer = 0

Dim ach_accounts(20)As String
Dim ach_index(20)As String

tblRowACH.Visible ="假"


Dim forf_value As Double = 0.0

ForfAmt.Text =" 0.00"
ForfAmt.Enabled = False
lblForf.Text ="您没有可用的没收金额。"

DepMeth.Items.Add(New ListItem(" Select one"," -1"))
DepMeth.Items.Add(New ListItem(" ----) --------------"," -1"))
DepMeth.Items.Add(New ListItem(" ACH Payment / Wire"," WIRE")) )
DepMeth.Items.Add(New ListItem(" Check"," CHECK"))

End if

End Sub
EmailAddressCheck(ByVal emailAddress As String)As Boolean

Dim pattern As String =" ^ [a-zA-Z] [\\\\ .-] * [a-zA-Z0-9 ] @ [A-ZA-Z0-9] [\w\ .-] * [A-ZA-Z0-9] \。[A-ZA-Z] [A-ZA-Z\。] * [A-ZA-Z] $"
Dim emailAddressMatch As Match = Regex.Match(emailAddress,pattern)
If emailAddressMatch.Success Then
EmailAddressCheck = True
Else
EmailAddressCheck = False
End如果

结束函数
Sub validateDepositMethod(ByVal sender As Object,ByVal args As ServerValidateEventArgs)

如果DepAmt.Visible =" False"然后
args.IsValid = True
Else

Dim deposit_method As String = DepMeth.SelectedValue

如果deposit_method =" -1"然后
args.IsValid = False
退出Sub
结束如果

args.IsValid = True

结束如果
结束Sub
Sub validateACHLocation(ByVal sender As Object,ByVal args As ServerValidateEventArgs)

如果achaccounts.Visible =" False"那么
args.IsValid = True
Else

Dim ach_location As String = achaccounts.SelectedValue

如果ach_location =" -1"然后
args.IsValid = False
退出Sub
结束如果

args.IsValid = True

结束如果
结束Sub
Sub validateLocation(ByVal sender As Object,ByVal args As ServerValidateEventArgs)

If LocationCode.Visible =" False"然后
args.IsValid = True
Else

Dim location As String = LocationCode.SelectedValue

如果location =" -1"然后
args.IsValid = False
退出Sub
结束如果

args.IsValid = True

结束如果
结束Sub
Sub validateEMail(ByVal sender As Object,ByVal args As ServerValidateEventArgs)

If EmailAddressCheck(Trim(EMail.Text))Then
args.IsValid = True
否则
args.IsValid = False
End if

End Sub
Sub validatePhone(ByVal sender As Object,ByVal args As ServerValidateEventArgs)

Dim hold_phone As String = Trim(Phone.Text)
如果Len(hold_phone)= 12则
args.IsValid = True
否则
args.IsValid = False
CustomValidator2.ErrorMessage ="电话号码必须为xxx-xxx-xxxx格式。"
结束如果

结束次级

结束等级




这是可执行文件将其表单返回到的页面代码:

<%@ Page Language =" VB" validateRequest = QUOT假QUOT; AutoEventWireup = QUOT假QUOT;代码隐藏= QUOT; payroll_2.aspx.vb"继承= QUOT; AccuRecordDirect.payroll_2" %GT; 

<!DOCTYPE html>

< html xmlns =" http://www.w3.org/1999/xhtml">
< head runat =" server">
< title>< / title>
< / head>
< body>
< form id =" form1" RUNAT = QUOT;服务器">
< div>

< / div>
< / form>
< / body>
< / html>




这是背后的代码:

 Public Class payroll_2 
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object,ByVal e As System.EventArgs)Handles Me.Load
Dim returned_from_from_xlsrdr As String = Request.Form(" results")

Dim passed_data As String = Replace(Request.Form(" results")," " ;,"",-1)
Dim string_len As Integer = 0
Dim found_string As Integer = 0
End Sub

End Class

这是我web.config的内容:

<?xml version =" 1.0"编码= QUOT; UTF-8英寸;?> 
<! -
有关如何配置ASP.NET应用程序的更多信息,请访问
http://go.microsoft.com/fwlink/?LinkId=169433
- >
< configuration>
< configSections>
<! - 有关Entity Framework配置的更多信息,请访问http://go.microsoft.com/fwlink/?LinkID=237468 - >
< section name =" entityFramework"
type =" System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection,EntityFramework,Version = 6.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089"
requirePermission =" false" />
< / configSections>
< connectionStrings>
< add name =" DefaultConnection" connectionString =" Data Source =(LocalDb)\ MSSQLLocalDB; AttachDbFilename = | DataDirectory | \ aspnet-AccuRecordDirect-20160108100447.mdf; Initial Catalog = aspnet-AccuRecordDirect-20160108100447; Integrated Security = True"
providerName =" System.Data.SqlClient" />
< / connectionStrings>
< system.web>
< authentication mode =" None" />
< compilation debug =" true"严格= QUOT假QUOT;明确= QUOT;真" targetFramework = QUOT; 4.5.2" />
< httpRuntime targetFramework =" 4.5.2" requestValidationMode = QUOT; 2.0" />
< pages>
< namespaces>
< add namespace =" System.Web.Optimization" />
< / namespaces>
< controls>
< add assembly =" Microsoft.AspNet.Web.Optimization.WebForms"命名空间= QUOT; Microsoft.AspNet.Web.Optimization.WebForms"的TagPrefix = QUOT; webopt" />
< / controls>
< / pages>
< membership>
< providers>
<! -
此模板中禁用了ASP.NET成员资格。请访问以下链接http://go.microsoft.com/fwlink/?LinkId=301889,了解此模板中的ASP.NET成员资格支持
- >
< clear />
< / providers>
< / membership>
< profile>
< providers>
<! -
此模板中禁用了ASP.NET成员资格。请访问以下链接http://go.microsoft.com/fwlink/?LinkId=301889,了解此模板中的ASP.NET成员资格支持
- >
< clear />
< / providers>
< / profile>
< roleManager>
<! -
此模板中禁用ASP.NET成员身份角色。请访问以下链接http://go.microsoft.com/fwlink/?LinkId=301889,了解此模板中的ASP.NET成员资格支持
- >
< providers>
< clear />
< / providers>
< / roleManager>
<! -
如果要部署到具有多个Web服务器实例的云环境,
,您应该从"InProc"更改会话状态模式。到"自定义"。另外,
更改名为"DefaultConnection"的连接字符串。连接到SQL Server的实例
(包括SQL Azure和SQL Compact)而不是SQL Server Express。
- >
< sessionState mode =" InProc" customProvider = QUOT; DefaultSessionProvider">
< providers>
< add name =" DefaultSessionProvider"
type =" System.Web.Providers.DefaultSessionStateProvider,System.Web.Providers,Version = 2.0.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35"
connectionStringName =" DefaultConnection" />
< / providers>
< / sessionState>
< /system.web>
< system.webServer>
< modules>
< remove name =" FormsAuthentication" />
< / modules>
< /system.webServer>
< runtime>
< assemblyBinding xmlns =" urn:schemas-microsoft-com:asm.v1">
< dependentAssembly>
< assemblyIdentity name =" Newtonsoft.Json"培养= QUOT;中性"公钥=" 30ad4fe6b2a6aeed" />
< bindingRedirect oldVersion =" 0.0.0.0-6.0.0.0" NEWVERSION = QUOT; 6.0.0.0" />
< / dependentAssembly>
< dependentAssembly>
< assemblyIdentity name =" WebGrease"培养= QUOT;中性"公钥=" 31bf3856ad364e35" />
< bindingRedirect oldVersion =" 0.0.0.0-1.5.2.14234" NEWVERSION = QUOT; 1.5.2.14234" />
< / dependentAssembly>
< dependentAssembly>
< assemblyIdentity name =" EntityFramework"公钥=" b77a5c561934e089" />
< bindingRedirect oldVersion =" 0.0.0.0-6.0.0.0" NEWVERSION = QUOT; 6.0.0.0" />
< / dependentAssembly>
< dependentAssembly>
< assemblyIdentity name =" Microsoft.Owin"培养= QUOT;中性"公钥=" 31bf3856ad364e35" />
< bindingRedirect oldVersion =" 0.0.0.0-3.0.1.0" NEWVERSION = QUOT; 3.0.1.0" />
< / dependentAssembly>
< dependentAssembly>
< assemblyIdentity name =" Microsoft.Owin.Security.OAuth"培养= QUOT;中性"公钥=" 31bf3856ad364e35" />
< bindingRedirect oldVersion =" 0.0.0.0-3.0.1.0" NEWVERSION = QUOT; 3.0.1.0" />
< / dependentAssembly>
< dependentAssembly>
< assemblyIdentity name =" Microsoft.Owin.Security.Cookies"培养= QUOT;中性"公钥=" 31bf3856ad364e35" />
< bindingRedirect oldVersion =" 0.0.0.0-3.0.1.0" NEWVERSION = QUOT; 3.0.1.0" />
< / dependentAssembly>
< dependentAssembly>
< assemblyIdentity name =" Microsoft.Owin.Security"培养= QUOT;中性"公钥=" 31bf3856ad364e35" />
< bindingRedirect oldVersion =" 0.0.0.0-3.0.1.0" NEWVERSION = QUOT; 3.0.1.0" />
< / dependentAssembly>
< / assemblyBinding>
< / runtime>
< entityFramework>
< defaultConnectionFactory type =" System.Data.Entity.Infrastructure.LocalDbConnectionFactory,EntityFramework">
< parameters>
< parameter value =" mssqllocaldb" />
< / parameters>
< / defaultConnectionFactory>
< providers>
< provider invariantName =" System.Data.SqlClient" type =" System.Data.Entity.SqlServer.SqlProviderServices,EntityFramework.SqlServer" />
< / providers>
< / entityFramework>
< system.codedom>
< compilers>
< compiler language =" c#; cs; csharp"延长="&的.cs QUOT;
type =" Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider,Microsoft.CodeDom.Providers.DotNetCompilerPlatform,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35"
warningLevel =" 4" compilerOptions =" / langversion:6 / nowarn:1659; 1699; 1701" />
< compiler language =" vb; vbs; visualbasic; vbscript"延长="&的.vb QUOT;
type =" Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider,Microsoft.CodeDom.Providers.DotNetCompilerPlatform,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35"
warningLevel =" 4" compilerOptions =" / langversion:14 / nowarn:41008 / define:_MYTYPE = \& quot; Web \& quot; / optionInfer + QUOT; />
< / compilers>
< /system.codedom>
< / configuration>

我上传的文件内容在这个过程中是这样的:


计划ID,SSN,第一个名字,最后一个名字,中等初始,PAYROLL结束日期,MBK Cont, ROTH Cont,EBK Cont


8461,000-00-0001,Joe,Cool ,, 10/31 / 2010,27.77,,6.94


8461,000-00-0002,Charlie,Brown,10 / 31/2010


8461,000-00-0003,Lucy,VanPelt,10/31 / 2010,354.17, ,88.54


8461,000-00-0004,Linus,VanPelt,10/31/2010



此数据应位于.xls文件中。


当我运行此应用程序时,我设置了一个断点,即Dim pass_data As String = Replace(Request.Form(") ;结果")," ",""," - 1"行。  当应用程序停止时,我会查询return_from_from_xlsrdr
字段。   Visual Studio 2015报告的值为"Nothing"。



我们将非常感谢您对此的任何见解。



Jonathan




解决方案

您需要将您的问题发布到其中一个ASP.NET论坛:


https://forums.asp.net/



I have an application that was developed in visual studio 2010 using .net 4.0.  The application allows the user to fill out a form including a file to be uploaded.  The form gets submitted to a cgi-pgm executable.  One of the fields that gets passed to the executable is the url that the executable will submit a resulting form to.  The resulting form contains html code in it.  My code contains a validateRequest="false" in the page declaration and I have <httpRuntime  requestValidationMode="2.0"/> in my web.config file.  When the application runs, I am able to retrieve the resulting form, parse it, and extract the required information. 

I am attempting to convert this application to .net 4.5.2 in visual studio 2015.  I copied the code code from the 2 pages, along with the code behind.  However, when the application runs, the returned form contains "Nothing".

I am of the opinion that form processing is handled differently under .net 4.5.2 than it was under 4.0.

This is the HTML code of my initial page where I solicit information from the user:

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="payroll_1.aspx.vb" Inherits="AccuRecordDirect.payroll_1" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
<div class="accountInfo75">
        <fieldset class="login">
            <legend>Submit Payroll - Step 1 of 2</legend>
            <p>
                <asp:Label ID="lblUserNameLabel" runat="server" Text=""></asp:Label>
                <asp:Table ID="Table1" runat="server">
                    <asp:TableRow>
                        <asp:TableCell>
                            <asp:Label ID="Label1" runat="server" Text="*File&nbsp;to&nbsp;upload"></asp:Label>
                        </asp:TableCell>
                        <asp:TableCell>
                            <asp:FileUpload ID="uploadfile" runat="server" ClientIDMode="Static" />
                            <asp:PlaceHolder ID="PlaceHolder1" runat="server">
                                <input id="ct100$MainContent$plantype" type="hidden" value='8622' name="ct100$MainContent$plantype" />
                                <input id="ct100$MainContent$CompName" type="hidden" value='test plan name' name="ct100$MainContent$CompName" />
                                <input id="ct100$MainContent$Client" type="hidden" value='A' name="ct100$MainContent$Client" />
                                <input id="ct100$MainContent$BetaPayroll" type="hidden" value='1' name="ct100$MainContent$BetaPayroll" />
                                <input id="ct100$MainContent$UserID" type="hidden" value='jrs' name="ct100$MainContent$UserID" />
                                <input id="ct100$MainContent$hPartner" type="hidden" value='<%Response.Write(Session("hPartner"))%>' name="ct100$MainContent$hPartner" />
                            </asp:PlaceHolder>
                        </asp:TableCell>
                        <asp:TableCell>
                            &nbsp;
                        </asp:TableCell>
                    </asp:TableRow>
                    <asp:TableRow>
                        <asp:TableCell>
                            <asp:Label ID="Label2" runat="server" Text="Sheet&nbsp;Name:"></asp:Label>
                        </asp:TableCell>
                        <asp:TableCell>
                            <asp:TextBox ID="Sheet" runat="server" Width="200"  ClientIDMode="Static"></asp:TextBox><br />
                            <asp:Label ID="Label3" runat="server" Text="<I>If Sheet Name is not supplied, the first sheet in the file is assumed.</I>" CssClass="smallTextOnLable"></asp:Label>
                        </asp:TableCell>
                        <asp:TableCell>
                            <asp:Label ID="Label4" runat="server" Text="Only enter a value here if your spreadsheet contains multiple sheet names.&nbsp;&nbsp;If you are not sure, please leave this field blank."></asp:Label>
                        </asp:TableCell>
                    </asp:TableRow>
                    <asp:TableRow>
                        <asp:TableCell>
                            <asp:Label ID="Label5" runat="server" Text="*Contact&nbsp;Name:"></asp:Label>
                        </asp:TableCell>
                        <asp:TableCell>
                            <asp:TextBox ID="Contact" runat="server" MaxLength="40" Width="200" ClientIDMode="Static"></asp:TextBox><br />
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="Contact name is a required field." ControlToValidate="Contact" CssClass="failureNotificationSmall"></asp:RequiredFieldValidator>
                        </asp:TableCell>
                        <asp:TableCell>
                            <asp:Label ID="Label7" runat="server" Text="Name of contact person in case of payroll submission problems."></asp:Label>
                        </asp:TableCell>
                    </asp:TableRow>
                    <asp:TableRow>
                        <asp:TableCell>
                            <asp:Label ID="Label6" runat="server" Text="*email&nbsp;Address:"></asp:Label>
                        </asp:TableCell>
                        <asp:TableCell>
                            <asp:TextBox ID="EMail" runat="server" Width="200" MaxLength="50" ClientIDMode="Static"></asp:TextBox><br />
                            <asp:CustomValidator runat="server" id="CustomValidator1"
                            ControlToValidate="EMail"
                            OnServerValidate="validateEMail"
                            cssClass="failureNotificationSmall"
                            ErrorMessage="Invalid email address entered." />                            
                        </asp:TableCell><asp:TableCell>
                            <asp:Label ID="Label8" runat="server" Text="eMail address of contact person in case of payroll submission problems."></asp:Label>
                        </asp:TableCell></asp:TableRow><asp:TableRow>
                        <asp:TableCell>
                            <asp:Label ID="Label9" runat="server" Text="*Phone&nbsp;Number:"></asp:Label>
                        </asp:TableCell><asp:TableCell>
                            <asp:TextBox ID="Phone" runat="server" MaxLength="12" Width="200" ClientIDMode="Static"></asp:TextBox><br />
                            <asp:CustomValidator runat="server" id="CustomValidator2"
                            ControlToValidate="Phone"
                            OnServerValidate="validatePhone"
                            cssClass="failureNotificationSmall"
                            ErrorMessage="Invalid phone number entered." /> 
                        </asp:TableCell><asp:TableCell>
                            <asp:Label ID="Label10" runat="server" Text="Phone number of contact person in xxx-xxx-xxxx format."></asp:Label>
                        </asp:TableCell></asp:TableRow><asp:TableRow>
                        <asp:TableCell>
                            <asp:Label ID="Label11" runat="server" Text="*Payroll&nbsp;Ending&nbsp;Date:"></asp:Label>
                        </asp:TableCell><asp:TableCell>
                            <asp:TextBox ID="PayDate" runat="server" MaxLength="10" Width="200" ClientIDMode="Static" /><br />
                            <asp:CompareValidator ID="CompareValidatorPEDate" runat="server" ControlToValidate="PayDate" Operator="DataTypeCheck" Type="Date" CssClass="failureNotificationSmall" ErrorMessage="Period Ending date is required." SetFocusOnError="True"></asp:CompareValidator>
                        </asp:TableCell><asp:TableCell>
                            <asp:Label ID="Label12" runat="server" Text=""></asp:Label>
                        </asp:TableCell></asp:TableRow><asp:TableRow>
                        <asp:TableCell>
                            <asp:Label ID="Label13" runat="server" Text="*Total&nbsp;Dollar&nbsp;Amount:"></asp:Label>
                        </asp:TableCell><asp:TableCell>
                            <asp:TextBox ID="DolAmt" runat="server" MaxLength="20" Width="200" ClientIDMode="Static"></asp:TextBox><br />
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ErrorMessage="Dollar amount is a required field." ControlToValidate="DolAmt" CssClass="failureNotificationSmall"></asp:RequiredFieldValidator>
                        </asp:TableCell><asp:TableCell>
                            <asp:Label ID="Label14" runat="server" Text="Total dollar amount of payroll including all contributions and loan repayments."></asp:Label>
                        </asp:TableCell></asp:TableRow><asp:TableRow ID="tblRowDepAmt">
                        <asp:TableCell>
                            <asp:Label ID="Label15" runat="server" Text="*Deposit&nbsp;Amount:"></asp:Label>
                        </asp:TableCell><asp:TableCell>
                            <asp:TextBox ID="DepAmt" runat="server" MaxLength="20" Width="200" ClientIDMode="Static"></asp:TextBox><br />
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ErrorMessage="Deposit amount is a required field." ControlToValidate="DepAmt" CssClass="failureNotificationSmall"></asp:RequiredFieldValidator>
                        </asp:TableCell><asp:TableCell>
                            <asp:Label ID="Label16" runat="server" Text="The sum of the Deposit Amount plus the Amount Used From Forfeitures (if any) must equal the Total Dollar Amount."></asp:Label>
                        </asp:TableCell></asp:TableRow><asp:TableRow ID="tblRowForfAmt">
                        <asp:TableCell>
                            <asp:Label ID="Label17" runat="server" Text="*Amount&nbsp;to&nbsp;use&nbsp;from&nbsp;Forfeitures:"></asp:Label>
                        </asp:TableCell><asp:TableCell>
                            <asp:TextBox ID="ForfAmt" runat="server" MaxLength="20" Width="200" ClientIDMode="Static"></asp:TextBox><br />
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ErrorMessage="Forfeiture amount is a required field." ControlToValidate="ForfAmt" CssClass="failureNotificationSmall"></asp:RequiredFieldValidator>
                        </asp:TableCell><asp:TableCell>
                            <asp:Label ID="lblForf" runat="server" Text=""></asp:Label>
                        </asp:TableCell>
                    </asp:TableRow>
                    <asp:TableRow ID="tblRowDepositMethod">
                        <asp:TableCell>
                            <asp:Label ID="Label19" runat="server" Text="*Deposit&nbsp;Method:"></asp:Label>
                        </asp:TableCell>
                        <asp:TableCell>
                            <asp:DropDownList ID="DepMeth" runat="server" ClientIDMode="Static">
                            </asp:DropDownList><br />
                            <asp:CustomValidator runat="server" id="custValidateDepositMethod"
                            ControlToValidate="DepMeth"
                            OnServerValidate="validateDepositMethod"
                            ErrorMessage="Invalid deposit method selected." />
                        </asp:TableCell>
                        <asp:TableCell>
                            &nbsp;
                        </asp:TableCell>
                    </asp:TableRow>
                    <asp:TableRow ID="tblRowACH" Visible="False">
                        <asp:TableCell>
                            <asp:Label ID="Label20" runat="server" Text="Select&nbsp;an&nbsp;ACH&nbsp;Location:"></asp:Label>
                        </asp:TableCell><asp:TableCell>
                            <asp:DropDownList ID="achaccounts" runat="server" ClientIDMode="Static">
                                <asp:ListItem Text="Select one        " Value="-1"></asp:ListItem>
                                <asp:ListItem Text="------------------" Value='-1'></asp:ListItem>
                            </asp:DropDownList><br />
                            <asp:CustomValidator runat="server" id="cusValidatorACHLocation"
                            ControlToValidate="achaccounts"
                            OnServerValidate="validateACHLocation"
                            ErrorMessage="Invalid ACH location selected." />
                        </asp:TableCell><asp:TableCell>
                            &nbsp;
                        </asp:TableCell></asp:TableRow><asp:TableRow ID="tblRowLocation" Visible="False">
                        <asp:TableCell>
                            <asp:Label ID="Label21" runat="server" Text="Select&nbsp;a&nbsp;Location:"></asp:Label>
                        </asp:TableCell><asp:TableCell>
                            <asp:DropDownList ID="LocationCode" runat="server" ClientIDMode="Static">
                                <asp:ListItem Text="Select one        " Value="-1"></asp:ListItem>
                                <asp:ListItem Text="------------------" Value='-1'></asp:ListItem>
                            </asp:DropDownList><br />
                            <asp:CustomValidator runat="server" id="cusValidatorLocation"
                            ControlToValidate="LocationCode"
                            OnServerValidate="validateLocation"
                            ErrorMessage="Invalid location selected." />
                        </asp:TableCell><asp:TableCell>
                            &nbsp;
                        </asp:TableCell></asp:TableRow></asp:Table></p><p class="submitButton">
                <asp:Label ID="lblConfirm" runat="server" BorderStyle="None" Visible="False"></asp:Label><br />
                <asp:Button ID="btnSubmit" runat="server" Text="Submit" />
            </p>
        </fieldset> 
     </div>
    </form>
</body>
</html>

And this is the code behind:

Public Class payroll_1
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Dim passed_data As String = ""

        'btnSubmit.PostBackUrl = "https://www.accurecord-direct.com/cgi-pgms/displayresults.exe"
        btnSubmit.PostBackUrl = "https://www.accurecord-direct.com/cgi-pgms/xlsrdr.exe"

        If Not IsPostBack Then

            lblUserNameLabel.Text = "Enter the payroll information below.<br />* = Required Field."


            Dim sponsor_UserID As String = Session("sponsor_UserID")
            Dim sponsor_Password As String = Session("sponsor_Password")
            Session("portNumber") = "http://localhost:53341"
            Session("hPartner") = Session("portNumber") & "/Sponsor/payroll/payroll_2.aspx"

            Contact.Text = "Jonathan Small"
            EMail.Text = "jonathan@testemail.com"
            Phone.Text = "555-555-1212"
            PayDate.Text = "12/01/2015"
            DolAmt.Text = "1.00"
            DepAmt.Text = "1.00"

            Dim ach_loc_lit As String = ""
            Dim ach_num_lit As String = ""
            Dim nbr_of_ach_account As Integer = 0

            Dim ach_accounts(20) As String
            Dim ach_index(20) As String

            tblRowACH.Visible = "False"


            Dim forf_value As Double = 0.0

            ForfAmt.Text = "0.00"
            ForfAmt.Enabled = False
            lblForf.Text = "Your have no available forfeiture amount."

            DepMeth.Items.Add(New ListItem("Select one        ", "-1"))
            DepMeth.Items.Add(New ListItem("------------------", "-1"))
            DepMeth.Items.Add(New ListItem("ACH Payment / Wire", "WIRE"))
            DepMeth.Items.Add(New ListItem("Check", "CHECK"))

        End If

    End Sub
    Function EmailAddressCheck(ByVal emailAddress As String) As Boolean

        Dim pattern As String = "^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$"
        Dim emailAddressMatch As Match = Regex.Match(emailAddress, pattern)
        If emailAddressMatch.Success Then
            EmailAddressCheck = True
        Else
            EmailAddressCheck = False
        End If

    End Function
    Sub validateDepositMethod(ByVal sender As Object, ByVal args As ServerValidateEventArgs)

        If DepAmt.Visible = "False" Then
            args.IsValid = True
        Else

            Dim deposit_method As String = DepMeth.SelectedValue

            If deposit_method = "-1" Then
                args.IsValid = False
                Exit Sub
            End If

            args.IsValid = True

        End If
    End Sub
    Sub validateACHLocation(ByVal sender As Object, ByVal args As ServerValidateEventArgs)

        If achaccounts.Visible = "False" Then
            args.IsValid = True
        Else

            Dim ach_location As String = achaccounts.SelectedValue

            If ach_location = "-1" Then
                args.IsValid = False
                Exit Sub
            End If

            args.IsValid = True

        End If
    End Sub
    Sub validateLocation(ByVal sender As Object, ByVal args As ServerValidateEventArgs)

        If LocationCode.Visible = "False" Then
            args.IsValid = True
        Else

            Dim location As String = LocationCode.SelectedValue

            If location = "-1" Then
                args.IsValid = False
                Exit Sub
            End If

            args.IsValid = True

        End If
    End Sub
    Sub validateEMail(ByVal sender As Object, ByVal args As ServerValidateEventArgs)

        If EmailAddressCheck(Trim(EMail.Text)) Then
            args.IsValid = True
        Else
            args.IsValid = False
        End If

    End Sub
    Sub validatePhone(ByVal sender As Object, ByVal args As ServerValidateEventArgs)

        Dim hold_phone As String = Trim(Phone.Text)
        If Len(hold_phone) = 12 Then
            args.IsValid = True
        Else
            args.IsValid = False
            CustomValidator2.ErrorMessage = "Phone number must be in xxx-xxx-xxxx format."
        End If

    End Sub

End Class


This is the code of the page that the executable will return its form to:

<%@ Page Language="vb" validateRequest="false" AutoEventWireup="false" CodeBehind="payroll_2.aspx.vb" Inherits="AccuRecordDirect.payroll_2" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
    </div>
    </form>
</body>
</html>


And this is the code behind:

Public Class payroll_2
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim returned_from_from_xlsrdr As String = Request.Form("results")

        Dim passed_data As String = Replace(Request.Form("results"), "�", " ", , -1)
        Dim string_len As Integer = 0
        Dim found_string As Integer = 0
    End Sub

End Class

This is the contents of my web.config:

<?xml version="1.0" encoding="utf-8"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework"
      type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
      requirePermission="false"/>
  </configSections>
  <connectionStrings>
    <add name="DefaultConnection" connectionString="Data Source=(LocalDb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\aspnet-AccuRecordDirect-20160108100447.mdf;Initial Catalog=aspnet-AccuRecordDirect-20160108100447;Integrated Security=True"
      providerName="System.Data.SqlClient" />
  </connectionStrings>
  <system.web>
    <authentication mode="None"/>
    <compilation debug="true" strict="false" explicit="true" targetFramework="4.5.2"/>
    <httpRuntime targetFramework="4.5.2" requestValidationMode="2.0"/>
    <pages>
      <namespaces>
        <add namespace="System.Web.Optimization"/>
      </namespaces>
      <controls>
        <add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt"/>
      </controls>
    </pages>
    <membership>
      <providers>
        <!--
	      ASP.NET Membership is disabled in this template. Please visit the following link http://go.microsoft.com/fwlink/?LinkId=301889 to learn about the ASP.NET Membership support in this template
        -->
        <clear/>
      </providers>
    </membership>
    <profile>
      <providers>
        <!--
	      ASP.NET Membership Profile is disabled in this template. Please visit the following link http://go.microsoft.com/fwlink/?LinkId=301889 to learn about the ASP.NET Membership support in this template
        -->
        <clear/>
      </providers>
    </profile>
    <roleManager>
      <!--
	        ASP.NET Membership Role is disabled in this template. Please visit the following link http://go.microsoft.com/fwlink/?LinkId=301889 to learn about the ASP.NET Membership support in this template
        -->
      <providers>
        <clear/>
      </providers>
    </roleManager>
    <!--
            If you are deploying to a cloud environment that has multiple web server instances,
            you should change session state mode from "InProc" to "Custom". In addition,
            change the connection string named "DefaultConnection" to connect to an instance
            of SQL Server (including SQL Azure and SQL  Compact) instead of to SQL Server Express.
      -->
    <sessionState mode="InProc" customProvider="DefaultSessionProvider">
      <providers>
        <add name="DefaultSessionProvider"
          type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
          connectionStringName="DefaultConnection"/>
      </providers>
    </sessionState>
  </system.web>
  <system.webServer>
    <modules>
      <remove name="FormsAuthentication"/>
    </modules>
  </system.webServer>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed"/>
        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="WebGrease" culture="neutral" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089"/>
        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Owin" culture="neutral" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Owin.Security.OAuth" culture="neutral" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Owin.Security.Cookies" culture="neutral" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Owin.Security" culture="neutral" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
      <parameters>
        <parameter value="mssqllocaldb"/>
      </parameters>
    </defaultConnectionFactory>
    <providers>
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"/>
    </providers>
  </entityFramework>
  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs"
        type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701"/>
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
        type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+"/>
    </compilers>
  </system.codedom>
</configuration>

The contents of the file that I upload in this process is this:

PLAN ID,SSN,FIRST NAME,LAST NAME,MIDDLE INITIAL,PAYROLL END DATE, MBK Cont , ROTH Cont , EBK Cont

8461,000-00-0001,Joe,Cool,,10/31/2010,27.77,,6.94

8461,000-00-0002,Charlie ,Brown,,10/31/2010

8461,000-00-0003,Lucy,VanPelt,,10/31/2010,354.17,,88.54

8461,000-00-0004,Linus,VanPelt,,10/31/2010

This data should be in an .xls file.

When I run this application, I have a breakpoint set ont the Dim passed_data As String = Replace(Request.Form("results"), "�", " ", , -1) line.  When the application halts, I interrogate the returned_from_from_xlsrdr field.  Visual studio 2015 reports a value of "Nothing".

Any insight into this would be greatly appreciated.

Jonathan

解决方案

You need to post your question to one of the ASP.NET forums:

https://forums.asp.net/


这篇关于在.net 4.5.2与.net 4.0下的Request.form处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆