First I was changing HyperLink.NavigateUrl
in code-behind on Page_Load()
.
But after I decided to do it in design using Eval()
method.
<asp:HyperLink runat="server"
NavigateUrl='<%# String.Format("~/Refuse.aspx?type={0}&id={1}", Eval("type"), Eval("id")) %>' Text="Refuse" />
or
<asp:HyperLink ID="urlRefuse" runat="server"
NavigateUrl='<%# String.Format("~/Refuse.aspx?type={0}&id={1}", Request["type"], Request["id"]) %>' Text="Refuse" />
where id
and type
- are variables from Request
.
But it doesn't work. Only raw text 'Refuse' is shown. Where is my mistake? Thanks in advance.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…