sách gpt4 ai đã đi

Cách xuất bản một trang từ ASP.NET sang ASP cổ điển

In lại 作者:行者123 更新时间:2023-12-02 14:39:47 28 4
mua khóa gpt4 Nike

我想将一些表单变量发布到经典 ASP 页面中。我不想改变经典的 ASP 页面,因为需要完成大量的工作,以及消耗它们的页面数量。

经典的 ASP 页面需要将表单变量 Username 和 Userpassword 提交给它们。

username = Request.Form("UserName")
userpassword = Request.Form("Userpassword")

然后它执行各种操作并设置 session ,进入 ASP 应用程序。

我想从 ASP.NET 将这些变量提交到页面中,但登录控件嵌套在用户控件和模板中,因此我无法将表单元素的名称设置为“用户名”和“UserPassword”。

Bạn có ý tưởng nào không?

1 Câu trả lời

你不能真正“转发”帖子,就像你想做的那样(在你的OP中)。客户端必须向您的 ASP 页面发起 POST(您的第二篇文章中的代码正在执行此操作)。

<小时>

这是您自己回复中的 self 发布代码,以便您可以按照您的建议标记答案:

public class RemotePost{
private System.Collections.Specialized.NameValueCollection Inputs
= new System.Collections.Specialized.NameValueCollection() ;

public string Url = "" ;
public string Method = "post" ;
public string FormName = "form1" ;

public void Add( string name, string value ){
Inputs.Add(name, value ) ;
}

public void Post(){
System.Web.HttpContext.Current.Response.Clear() ;

System.Web.HttpContext.Current.Response.Write( "" ) ;

System.Web.HttpContext.Current.Response.Write( string .Format( "" ,FormName)) ;

System.Web.HttpContext.Current.Response.Write( string .Format( "
" ,

FormName,Method,Url)) ;
for ( int i = 0 ; i< Inputs.Keys.Count ; i++){
System.Web.HttpContext.Current.Response.Write( string .Format( "" ,Inputs.Keys[i],Inputs[Inputs.Keys[i]])) ;
}
System.Web.HttpContext.Current.Response.Write( "
" ) ;
System.Web.HttpContext.Current.Response.Write( "" ) ;
System.Web.HttpContext.Current.Response.End() ;
}
}

关于asp.net - 如何将页面从 ASP.NET 发布到经典 ASP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/253142/

28 4 0
行者123
Hồ sơ cá nhân

Tôi là một lập trình viên xuất sắc, rất giỏi!

Nhận phiếu giảm giá Didi Taxi miễn phí
Mã giảm giá Didi Taxi
Giấy chứng nhận ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com