如何通过c#使用http URLRequest [英] how use http URLRequest by c#

查看:70
本文介绍了如何通过c#使用http URLRequest的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 ASP.Net 项目中工作,有时我们使用此代码发送数据。

 Javascript 
{
var TrxId = window document .getElementById(' hdnContractID')。value;

window .open(' ../ TemplateViewer.aspx?ContractId =' + TrxId + ' & intSubModuleId = 1'' new'' width = 585,height = 489,top = 190,left = 300,status = yes,scrollbars = yes' ' true');

}





我们读这个值按 VB.Net

 VB 
{
dim x as string
x = Request( ContractId
}





当我在Request()中单击F12时

>>>>>>> to

Request()As System.Web.HttpRequest



System.Web.UI.Page.Request





如何读取c#中的值?

 TemplateViewer.aspx?ContractId = 5 





VB 请。

解决方案

嘿那里,



尝试, Request.QueryString [ContractId] 请求[ContractId]





Azee ......


string ContractId = Request.QueryString [0] .toString();



string intSubModuleId = Request.QueryString [1] .toString();

I am working in ASP.Net Project and sometimes we are using this code to send data.

Javascript
{
    var TrxId = window.document.getElementById('hdnContractID').value ;
    
    window.open('../TemplateViewer.aspx?ContractId='+TrxId + '&intSubModuleId=1', 'new','width=585,height=489,top=190,left=300,status=yes,scrollbars=yes','true');

}



We read this value By VB.Net

VB
{
    dim x as string 
    x=Request("ContractId")
}



When I clicked F12 in Request()
>>>>>>> to
Request() As System.Web.HttpRequest

System.Web.UI.Page.Request


How can I read value in c#?

TemplateViewer.aspx?ContractId=5



As VB please.

解决方案

Hey there,

Try, Request.QueryString["ContractId"] or Request["ContractId"]


Azee...


string ContractId=Request.QueryString[0].toString();

string intSubModuleId=Request.QueryString[1].toString();


这篇关于如何通过c#使用http URLRequest的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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