dongnong3019 2012-04-18 00:48
浏览 178
已采纳

澄清__VIEWSTATE __EVENTVALIDATION __EVENTTARGET,__ EVENTARGUMENT需要

I am trying to achieve a successful POST to an ASPX (ASP.NET) page (an external site) using cURL.

Since I don't care much for the looks of the page (it is all done on the server side), I am not sending ANY the arguments __VIEWSTATE, __EVENTVALIDATION, __EVENTTARGET, and __EVENTARGUMENT, not even empty, but I do send the real data.

How crucial is it to POST these arguments to the ASP.NET server?

I am not an ASP.NET programmer, but I might suspect that __EVENTVALIDATION might give me some hard time here(?). Or is this something between the browser and the server that I don't need to care much for?

If this is crucial, how can I imitate these variables so the server accepts POSTS?

  • 写回答

2条回答 默认 最新

  • dongyuqie4322 2012-04-18 01:22
    关注

    In general, you can not eliminate these values.

    The ViewState and the EventValidation are critical - unless the other side has disabled them. If the other side use them and do not find them on postback, a throw error appears, and it depends on the program how it handles it.

    The ViewState contains information that the page needs to use after the postback.

    The EventValidation contains a key that validates the postback controls to be sure that you do not try to trigger any command that does not have permission, or send any argument that does not have permission to run.

    Let's gives you an example: Let's say that I have a control that send a number, 43, and a button that trigger the postback, and I ask the information for id 43. The EventValidation takes care that you can not make a script and ask for all the numbers with any id and get any result that you may think.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 metadata提取的PDF元数据,如何转换为一个Excel
  • ¥15 关于arduino编程toCharArray()函数的使用
  • ¥100 vc++混合CEF采用CLR方式编译报错
  • ¥15 coze 的插件输入飞书多维表格 app_token 后一直显示错误,如何解决?
  • ¥15 vite+vue3+plyr播放本地public文件夹下视频无法加载
  • ¥15 c#逐行读取txt文本,但是每一行里面数据之间空格数量不同
  • ¥50 如何openEuler 22.03上安装配置drbd
  • ¥20 ING91680C BLE5.3 芯片怎么实现串口收发数据
  • ¥15 无线连接树莓派,无法执行update,如何解决?(相关搜索:软件下载)
  • ¥15 Windows11, backspace, enter, space键失灵