【发布时间】:2017-02-23 18:44:52
【问题描述】:
我正在尝试将客户编号字段值传递给 href url
"http://abc.yyy/id=12&custnum="
在我的页面后面的代码中,我有我的字段值
string custnum=txtcustnum.Text;
现在如何在masterpage.aspx 中将此custnum 传递给href 链接
【问题讨论】:
-
你是如何形成/创建这个 URL 的?
我正在尝试将客户编号字段值传递给 href url
"http://abc.yyy/id=12&custnum="
在我的页面后面的代码中,我有我的字段值
string custnum=txtcustnum.Text;
现在如何在masterpage.aspx 中将此custnum 传递给href 链接
【问题讨论】:
在您的母版页中创建如下超链接
<asp:HyperLink id="myLink" Text="Click Here" runat="server"/>
然后在你的内容页面代码后面访问这个 Master Page 超链接并设置它的 url
HyperLink hyperLinkMasterPage = this.Master.FindControl("myLink") as HyperLink;
string custnum=txtcustnum.Text;
hyperLinkMasterPage.NavigateUrl = @"http://abc.yyy/id=12&custnum=" + custnum;
【讨论】: