Passing Multiple Parameters in NavigateURL Property of Hyperlink
2004-07-21 09:36
429 查看
One of the frequently asked questions in newsgroups is, how do I pass multiple parameters in the hyperlinkcolumn of a datagrid. If you need to pass multiple parameters then convert that column to itemtemplate hyperlink column and then pass multiple parameters using navigateURL property. Consider an example in which you need to pass two parameters to Navigate URL,
<asp:datagrid id="Datagrid3" runat="server" AutoGenerateColumns="False" BorderColor="black"
HeaderStyle-CssClass="tableHeader" ItemStyle-CssClass= "tableItem">
<Columns>
<asp:TemplateColumn HeaderText="Order">
<ItemTemplate>
<asp:Hyperlink runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"Name")%'
NavigateUrl='<%# "page.aspx?Name=" + DataBinder.Eval (Container.DataItem,"Name") +
"&ProductID="+ DataBinder.Eval(Container.DataItem,"ProductID")%>' ID="ProductName"/>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid>
This is how you can pass two paramaters to NavigateURL property of Hyperlink column in DataGrid.
<asp:datagrid id="Datagrid3" runat="server" AutoGenerateColumns="False" BorderColor="black"
HeaderStyle-CssClass="tableHeader" ItemStyle-CssClass= "tableItem">
<Columns>
<asp:TemplateColumn HeaderText="Order">
<ItemTemplate>
<asp:Hyperlink runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"Name")%'
NavigateUrl='<%# "page.aspx?Name=" + DataBinder.Eval (Container.DataItem,"Name") +
"&ProductID="+ DataBinder.Eval(Container.DataItem,"ProductID")%>' ID="ProductName"/>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid>
This is how you can pass two paramaters to NavigateURL property of Hyperlink column in DataGrid.
相关文章推荐
- 反病毒引擎设计之实时监控篇
- PHP、Apache的安装和配置
- Linux安装历险记
- 开发wap网站,还是碰到不少问题
- Donews Blog惨遭不测
- document.body.scrollTop总是零的原因
- 模板网站
- Hibernate经典网站收集
- ant 中文手册--介绍
- 探讨把工作视窗转换到Linux上的可行性
- Ant实战之Jar文件数字签名的制作(原创)
- 请教:linux3的telnet问题
- 漫谈网站开发规范
- regshell
- 7/19日志
- 推荐2个Flash交互应用网站
- 充分利用 .NET 框架的 PropertyGrid 控件
- 在安装期间将应用程序重定向到不同的 XML Web services
- 深入浅出ShellExecute
- (收藏)架构,构件,组件,框架,中间件之间有什么区别