动态地为gridview中的超链接添加资源
问题描述:
我想将"Default.aspx"页面添加为gridview中动态加载的超链接的资源...
这些超链接也会动态加载到gridview中.
I want to add the "Default.aspx" page as the resource for the dynamically loaded hyperlink in the gridview...
The hyperlinks are also loaded in the gridview dynamically.
答
您需要使用GridView的RowCreated事件处理程序,并在处理程序中设置NavigateUrl:
Hi,
You need to use RowCreated event handler of your GridView and in the handler set the NavigateUrl:
void RowCreated...
{
((HyperLink)e.Row.FindControl("HyperLindName")).NavigateUrl = "~/Default.aspx"
}
希望对您有所帮助,
干杯.
I hope it will help,
Cheers.