开发者

Access problem to Hyperlink

I have two nested master page.I add a hyperlink in second master page and I want to change forecolor of hyperlink from a asp 开发者_如何转开发page that is connected to it.But,I can't access to hyperlink.

HyperLink hpl2 = (HyperLink)Master.FindControl("hplD") as HyperLink;
hpl2.ForeColor = Renk2;

After it works upper code,I got the following error.

Object reference not set to an instance of an object.


This error may happen either the Master property is null or because the find control didn't found the control so the hpl2 object is null. Can you tell which of them is correct ?!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜