asp.net页面如何知道它的回发? [英] How does asp.net page know it's postback?

查看:55
本文介绍了asp.net页面如何知道它的回发?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我需要使用HttpWebRequest类向一个asp.net页面发出请求

我需要欺骗这个页面以认为它是一个回发并点击了一个

按钮。但该页面没有处理点击事件,尽管我正在使用POST,但是b $ b。方法和发送所有表单字段

(除了__VIEWSTATE,这可能是原因吗?)。


所以问题是:asp在什么基础上.net页面设置ispostback

属性为true还是false?


问候,

-

Rudy

Hi,
I need to make a request to a asp.net page using HttpWebRequest class
and I need to trick this page into thinking it''s a postback and a
button was clicked. But the page doesn''t handle the click event,
despite I''m using "POST" method and sending all the form fields
(except of __VIEWSTATE, may this be the reason ?).

So the question is: on what basis does asp.net page set the ispostback
property to true or false?

Regards,
--
Rudy

推荐答案

" Rudy" < RR ****** @ poczta.onet.pl>在消息中写道

news:8a ************************** @ posting.google.c om ...
"Rudy" <rr******@poczta.onet.pl> wrote in message
news:8a**************************@posting.google.c om...

我需要使用HttpWebRequest类向asp.net页面发出请求
我需要欺骗这个页面以认为它是一个回发和一个<单击了br />按钮。但该页面并没有处理点击事件,尽管我正在使用POST按钮。方法和发送所有表单字段
(__VIEWSTATE除外,可能这是原因吗?)。

所以问题是:asp.net页面设置ispostback的基础是什么? />属性为true还是false?
Hi,
I need to make a request to a asp.net page using HttpWebRequest class
and I need to trick this page into thinking it''s a postback and a
button was clicked. But the page doesn''t handle the click event,
despite I''m using "POST" method and sending all the form fields
(except of __VIEWSTATE, may this be the reason ?).

So the question is: on what basis does asp.net page set the ispostback
property to true or false?




我不知道,但我知道你需要发送ViewState。您需要

假装是浏览器并执行浏览器的操作。


John Saunders



I don''t know, but I do know that you need to send ViewState. You need to
pretend to be a browser and do what a browser would have done.

John Saunders

首先,检查回发属性是否正确...

IMO它更确切地说它使用了你需要填充的隐藏字段

假装点击了一个按钮(__eventargument,__ eventtarget)


这个页面的拥有者可能更清楚/更容易暴露

仅程序化界面(你的代码可能会在

UI更改后中断)。你可能也会遇到一些问题。


Patrice


-


" Rudy" < RR ****** @ poczta.onet.pl> écritdansle message de

news:8a ************************** @ posting.google.c om ...
First, check that the postback property is correct...
IMO it''s rather that it uses hidden fields that you need to fill to be able
to pretend to have clicked a button (__eventargument,__eventtarget)

It would likely cleaner/easier to have the owner of this page exposing a
programmatic only interface (your code could break after a change in the
UI). It''s likely you''ll have also some problems with the viewstate.

Patrice

--

"Rudy" <rr******@poczta.onet.pl> a écrit dans le message de
news:8a**************************@posting.google.c om...

我需要使用HttpWebRequest类向asp.net页面发出请求
我需要欺骗这个页面以认为它是一个回发并单击了一个
按钮。但该页面并没有处理点击事件,尽管我正在使用POST按钮。方法和发送所有表单字段
(__VIEWSTATE除外,可能这是原因吗?)。

所以问题是:asp.net页面设置ispostback的基础是什么? />属性为真还是假?

问候,
-
Rudy
Hi,
I need to make a request to a asp.net page using HttpWebRequest class
and I need to trick this page into thinking it''s a postback and a
button was clicked. But the page doesn''t handle the click event,
despite I''m using "POST" method and sending all the form fields
(except of __VIEWSTATE, may this be the reason ?).

So the question is: on what basis does asp.net page set the ispostback
property to true or false?

Regards,
--
Rudy



基于两个隐藏元素__eventtargent和__eventargument。

-

-Saravana
http://dotnetjunkies.com/WebLog/saravana/
www.ExtremeExperts.com


" Rudy" < RR ****** @ poczta.onet.pl>在消息中写道

news:8a ************************** @ posting.google.c om ...
based on two hidden element __eventtargent and __eventargument.
--
-Saravana
http://dotnetjunkies.com/WebLog/saravana/
www.ExtremeExperts.com

"Rudy" <rr******@poczta.onet.pl> wrote in message
news:8a**************************@posting.google.c om...

我需要使用HttpWebRequest类向asp.net页面发出请求
我需要欺骗这个页面以认为它是一个回发和一个<单击了br />按钮。但该页面并没有处理点击事件,尽管我正在使用POST按钮。方法和发送所有表单字段
(__VIEWSTATE除外,可能这是原因吗?)。

所以问题是:asp.net页面设置ispostback的基础是什么? />属性为真还是假?

问候,
-
鲁迪
Hi,
I need to make a request to a asp.net page using HttpWebRequest class
and I need to trick this page into thinking it''s a postback and a
button was clicked. But the page doesn''t handle the click event,
despite I''m using "POST" method and sending all the form fields
(except of __VIEWSTATE, may this be the reason ?).

So the question is: on what basis does asp.net page set the ispostback
property to true or false?

Regards,
--
Rudy



这篇关于asp.net页面如何知道它的回发?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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