我有一个1.aspx.cs文件 代码 protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack)
{
//string fhqdbh = Request.Params["fhqdh"].ToString();
string cmd1 = "select fhqdh from fcqk where fhqdh='10020101023002 '";
DataSet ds = sqlHelper.GetDataSet(cmd1); if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0][0].ToString()))
{
string fhqdbh = ds.Tables[0].Rows[0][0].ToString();
} }
}
我现在想把fhqdh 放到aspx中来 要怎么引用
{
if (IsPostBack)
{
//string fhqdbh = Request.Params["fhqdh"].ToString();
string cmd1 = "select fhqdh from fcqk where fhqdh='10020101023002 '";
DataSet ds = sqlHelper.GetDataSet(cmd1); if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0][0].ToString()))
{
string fhqdbh = ds.Tables[0].Rows[0][0].ToString();
} }
}
我现在想把fhqdh 放到aspx中来 要怎么引用
用Eval???
不行么?貌似变量可以直接绑定的,我也不清楚了,我才刚刚学这个....
<%=fhqdbh%>
<%=fhqdbh%>恩 用全局变量是可以 但是 我在1.aspx.cs中如何接收这个参数(从Ext客户端传值过来的)
客户端代码
text:"预览(O)",
id:"printpre",
minwidth:70,
handler:function()
{
var fhqdh = Ext.getCmp("fhqdh_add").getValue();
Ext.Ajax.request({
url:"URL/Fhxx/fcqd_print.aspx?fhqdh='"+fhqdh+"'",
method:"post",
success:function(response){接收代码 :
SQLHelper sqlHelper = new SQLHelper(); public string fhqdbh = ""; protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack)
{
string fhqdh = Request.Params["fhqdh"].ToString();
fhqdbh = fhqdh;
}
}
谁给看看 怎么把发车单号显示到前端来
例子:
<script runat="server" language="C#">
private void Page_Load(object sender, System.EventArgs e)
{
if (!IsPostBack)
{ WebEditor1.Text = "<a href=http://www.aspxcn.com.cn><img src='system_dntb/skin/xp/img/logo.gif' alt='DotNet中华网版权所有' width=260 height=60 border=0></a>";
}
} private void Button1_OnClick(object sender, System.EventArgs e)
{
label1.Text = "<hr><b>以下是DotNetTextBox控件提交的内容</b>:<br>" + WebEditor1.Text;
} private void Button2_OnClick(object sender, System.EventArgs e)
{
WebEditor1.Text = "";
} private void ChangedMenu(object sender, System.EventArgs e)
{
WebEditor1.MenuConfig = menu.SelectedItem.Value;
WebEditor1.Width = 640;
WebEditor1.LeftAreaWidth ="45%";
WebEditor1.RightAreaWidth = "55%";
}
</script>
给<span>标签赋值
string fhqdbh = ds.Tables[0].Rows[0][0].ToString();
sp1.InnerText=fhqdbh;
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack)
{
string cmd1 = "select fhqdh from fcqk where fhqdh='10020101023002 '";
DataSet ds = sqlHelper.GetDataSet(cmd1); if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0][0].ToString()))
{
fhqdbh = ds.Tables[0].Rows[0][0].ToString();
} }
}