如何設置WebHyperLink控制項在主視窗打開頁面,而不是新視窗?
將WebHyperLink的UseClientClick屬性設成False,為WebHyperLink增加Click事件,這樣就能在主視窗中打開事件
protected void WebHyperLink_Click(object sender, EventArgs e)
{
WebHyperLink hlink = sender as WebHyperLink;
this.Response.Redirect(hlink.HyperLinkURL+ "?WebHyperLinkText=" + hlink.ColumnText.Replace("'", "\\'") + "&itemparam=" + hlink.ItemParam.Replace("'", "\\'"));
}