如何发布表格 [英] How to Post a Form

查看:54
本文介绍了如何发布表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用带有代码的ASP.NET将表单发布到指定的URL?

使用传统的ASP我以前只能使用:

action =" https://www.domain.com/process.asp"


谢谢,贾斯汀。

How do I post a form to a specified url using an ASP.NET with a code behind?
With traditional ASP I used to be able to simply use:
action="https://www.domain.com/process.asp"

Thanks, Justin.

推荐答案

ASP.NET中的表单回发到渲染它们的同一页面,这样你就可以利用对象模型来获得
。当您回发所有服务器端时

控件被重新创建并重新填充后返回到页面的值为
。这提供了更高级别的编程模型,因此
因此使您成为开发人员的工作效率更高。


现在,如果您真的想要发布到第二页,你可以。但是那时你就回到了[旧] ASP风格的Request.Forms编程。


顺便说一句,在ASP.NET v2.0中你可以做一个跨页回发而不牺牲ASP.NET对象模型的
。关于它的一些注意事项在这里:

http://staff.develop.com/ballen/blog...c-d3b8b4f29eaf


但是如果你需要的话发布到一个完全不同的应用程序,那么它的价格与以前没有什么不同。


-Brock

DevelopMentor
http://staff.develop.com/ballen
Forms in ASP.NET postback to the same page that rendered them so you can
take advantage of the object model. When you postback all of the server side
controls are recreated and repopulated with the values that are posted back
to the page. This provides for a much higher level programming model, and
therefore makes you as the developer more productive.

Now, if you really want to post to a second page, you can. But then you''re
back to [old] ASP style Request.Forms programming.

As an aside, in ASP.NET v2.0 you can do a cross page postback without sacrificing

the ASP.NET object model. Some notes on that are here:

http://staff.develop.com/ballen/blog...c-d3b8b4f29eaf

But if you need to post to a completely different application, then it''s
not different than before.

-Brock
DevelopMentor
http://staff.develop.com/ballen
如何使用带有代码
的ASP.NET将表单发布到指定的URL?使用传统的ASP,我以前只能使用:
action =" https://www.domain.com/process.asp"

谢谢,Justin。
How do I post a form to a specified url using an ASP.NET with a code
behind? With traditional ASP I used to be able to simply use:
action="https://www.domain.com/process.asp"

Thanks, Justin.






我注意到Action和Method选项仍可用于

ASP.NET表单。如果我设置动作和

方法选项,后期数据会发生什么。


" Brock Allen"写道:
I noticed that the Action and Method options are still available for use with
ASP.NET forms. What will happen to the post back data if I set the action and
method options.

"Brock Allen" wrote:
ASP.NET中的表单回发到渲染它们的同一页面,以便您可以利用对象模型。当您回发所有服务器端时,
控件将重新创建并重新填充,并将回传的值重新填充到页面中。这提供了更高级别的编程模型,因此使您作为开发人员的工作效率更高。

现在,如果您真的想要发布到第二页,您可以。但是那时你又回到了[旧] ASP风格的Request.Forms编程。

顺便说一下,在ASP.NET v2.0中你可以做一个跨页回发而不会牺牲

ASP.NET对象模型。关于它的一些注意事项在这里:

http://staff.develop.com/ballen/blog...c-d3b8b4f29eaf

但是如果你需要发布到完全不同的应用程序,那么它与之前没有什么不同。

-Brock
DevelopMentor
http://staff.develop.com/ballen
Forms in ASP.NET postback to the same page that rendered them so you can
take advantage of the object model. When you postback all of the server side
controls are recreated and repopulated with the values that are posted back
to the page. This provides for a much higher level programming model, and
therefore makes you as the developer more productive.

Now, if you really want to post to a second page, you can. But then you''re
back to [old] ASP style Request.Forms programming.

As an aside, in ASP.NET v2.0 you can do a cross page postback without sacrificing

the ASP.NET object model. Some notes on that are here:

http://staff.develop.com/ballen/blog...c-d3b8b4f29eaf

But if you need to post to a completely different application, then it''s
not different than before.

-Brock
DevelopMentor
http://staff.develop.com/ballen
如何将表单发布到指定的URL使用带有代码的ASP.NET后面?使用传统的ASP,我以前只能使用:
action =" https://www.domain.com/process.asp"

谢谢,Justin。
How do I post a form to a specified url using an ASP.NET with a code
behind? With traditional ASP I used to be able to simply use:
action="https://www.domain.com/process.asp"

Thanks, Justin.




将根据您设置这两个选项的方式发布。到任何URL

以及您指定的任何方法。


您有问题吗?你究竟想做什么?或者你只是想要解决问题吗? :)


-Brock

DevelopMentor
http://staff.develop.com/ballen
It will be posted based upon how you set these two options. To whatever URL
and via whichever method you specify.

Are you having a problem? What exactly are you trying to do? Or are you just
figuring things out? :)

-Brock
DevelopMentor
http://staff.develop.com/ballen
我注意到Action和Method选项仍可用于
与ASP.NET表单一起使用。如果我设置动作和方法选项,后期数据会发生什么。

Brock Allen写道:
I noticed that the Action and Method options are still available for
use with ASP.NET forms. What will happen to the post back data if I
set the action and method options.

"Brock Allen" wrote:
ASP.NET中的表单回发到呈现它们的同一页面,因此您可以利用对象模型。当您回发所有服务器端控件时,将重新创建并重新填充回发到页面的值
。这提供了更高级别的编程模型,因此使您成为开发人员更高效。

现在,如果您真的想要发布到第二页,那么能够。但是后来你又回到了[旧] ASP风格的Request.Forms编程。

顺便说一句,在ASP.NET v2.0中你可以做一个跨页回发而不用<牺牲

ASP.NET对象模型。关于它的一些注释在这里:

http://staff.develop.com/ballen/blog...d=483742fd-01a
2-4975-b76c-d3b8b4f29eaf

但是如果你需要发布到一个完全不同的应用程序,那么它与以前没有什么不同。

-Brock
DevelopMentor
http://staff.develop.com/ballen
Forms in ASP.NET postback to the same page that rendered them so you
can take advantage of the object model. When you postback all of the
server side controls are recreated and repopulated with the values
that are posted back to the page. This provides for a much higher
level programming model, and therefore makes you as the developer
more productive.

Now, if you really want to post to a second page, you can. But then
you''re back to [old] ASP style Request.Forms programming.

As an aside, in ASP.NET v2.0 you can do a cross page postback without
sacrificing

the ASP.NET object model. Some notes on that are here:

http://staff.develop.com/ballen/blog...d=483742fd-01a
2-4975-b76c-d3b8b4f29eaf

But if you need to post to a completely different application, then
it''s not different than before.

-Brock
DevelopMentor
http://staff.develop.com/ballen
我如何发布一个使用带有
代码的ASP.NET将表单转换为指定的URL?使用传统的ASP,我以前只能使用:
action =" https://www.domain.com/process.asp"

谢谢,Justin。
How do I post a form to a specified url using an ASP.NET with a
code behind? With traditional ASP I used to be able to simply use:
action="https://www.domain.com/process.asp"

Thanks, Justin.






这篇关于如何发布表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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