C# 通过fiddler发布并模拟CommandArgument
按钮通过名为“dopostback”的javascript发送请求,在我的代码中,我有以下函数:C# 通过fiddler发布并模拟CommandArgument,c#,asp.net,asp.net-web-api,fiddler,C#,Asp.net,Asp.net Web Api,Fiddler,按钮通过名为“dopostback”的javascript发送请求,在我的代码中,我有以下函数: private void dlProductDetail_ItemCommand(object source, DataListCommandEventArgs e) { object left = NewLateBinding.LateGet(e.CommandSource, null, "CommandName", new object[0], null, null, null);
private void dlProductDetail_ItemCommand(object source, DataListCommandEventArgs e)
{
object left = NewLateBinding.LateGet(e.CommandSource, null, "CommandName", new object[0], null, null, null);
if (Operators.ConditionalCompareObjectEqual(left, "DocDownload", false))
{
int docID = int.Parse(e.CommandArgument.ToString());
this.ForceDocDownload(docID);
}
else if (Operators.ConditionalCompareObjectEqual(left, "DocPurchased", false))
{
int num2 = int.Parse(e.CommandArgument.ToString());
if (SharedFunctions.DocHasBeenPurchasedByDocID(this.UserId, num2))
{
this.ForceDocDownload(num2);
}
}
else if (Operators.ConditionalCompareObjectEqual(left, "AddToWishList", false))
{
DataListItem item = e.Item;
WishList.AddProduct(this.PortalId, e.CommandArgument.ToString(), this.UserInfo);
this.DoAfterWishListRedirect();
}
else if (Operators.ConditionalCompareObjectEqual(left, "RemoveFromWishList", false))
{
DataListItem item3 = e.Item;
WishList.RemoveProduct(this.PortalId, e.CommandArgument.ToString());
this.DoAfterWishListRedirect();
}
}
当我在fiddler中检查标题数据时,我有以下数据:
------WebKitFormBoundaryLdhbAgPnI7779ZQp
Content-Disposition: form-data; name="StylesheetManager_TSSM"
------WebKitFormBoundaryLdhbAgPnI7779ZQp
Content-Disposition: form-data; name="ScriptManager_TSM"
;;System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35:en:9775081d-3cde-400d-a4e8-b9cd8cdf4a51:ea597d4b:b25378d2
------WebKitFormBoundaryLdhbAgPnI7779ZQp
Content-Disposition: form-data; name="__EVENTTARGET"
dnn$ctr494$ProductList$dlProductDetail$ctl00$docpurchasedlink1
------WebKitFormBoundaryLdhbAgPnI7779ZQp
Content-Disposition: form-data; name="__EVENTARGUMENT"
------WebKitFormBoundaryLdhbAgPnI7779ZQp
Content-Disposition: form-data; name="__VIEWSTATE"
------WebKitFormBoundaryLdhbAgPnI7779ZQp
Content-Disposition: form-data; name="__VIEWSTATEGENERATOR"
CA0B0334
------WebKitFormBoundaryLdhbAgPnI7779ZQp
Content-Disposition: form-data; name="__VIEWSTATEENCRYPTED"
------WebKitFormBoundaryLdhbAgPnI7779ZQp
Content-Disposition: form-data; name="__EVENTVALIDATION"
fOIVD+nn+c54Ze/oTm31Q2zD15ye7T+OVXI9vjSGQIjAB1JhcMfiQNAYx/+RekdK1ikFDIGcBGPVUIJnv6+Rc/TrrIKWfy3Y3kOgCeI7ty52kPfTKfwv7Ks8F+fjFeez3lG0ZPeY08WtaoG9MTwaRDrRsYeNVysKfkT5bf7lVNL3mnlRYJQY1F2bvsV50EeeuoWO48Om96gix8MVtsXGI1WgWqEpaGbDZJaZV3Ovzbd5uPGg4oEgfAjTow6hiVmM1k1zQY9Pi2WsLZun
------WebKitFormBoundaryLdhbAgPnI7779ZQp
Content-Disposition: form-data; name="dnn$dnnSearch$txtSearch"
------WebKitFormBoundaryLdhbAgPnI7779ZQp
Content-Disposition: form-data; name="dnn$ctr494$ProductList$dlProductDetail$ctl00$hfModel"
84
------WebKitFormBoundaryLdhbAgPnI7779ZQp
Content-Disposition: form-data; name="ScrollTop"
800
------WebKitFormBoundaryLdhbAgPnI7779ZQp
Content-Disposition: form-data; name="__dnnVariable"
`{`__scdoff`:`1`,`sf_siteRoot`:`/`,`sf_tabId`:`98`}
------WebKitFormBoundaryLdhbAgPnI7779ZQp
Content-Disposition: form-data; name="__RequestVerificationToken"
S8dMajopXeSPMN4yZOK3AD6WSx5wEwjG35vmuQ0gaYwml_tLG640bw97PiPiXd98WAfiM-A0SWreh5Bb0
------WebKitFormBoundaryLdhbAgPnI7779ZQp--
当我篡改内容处理时:表单数据;name=dnn$ctr494$ProductList$dlProductDetail$ctl00$hfModel1
value我的表单数据中没有任何更改。其中int.Parse(例如CommandArgument.ToString())代码>从表单post数据获取值?正如您所看到的内容配置:表单数据;name=\u EVENTARGUMENT
为空!asp.net怎么知道CommandArgument