无法在LoginView LoggedIn模板中找到控件 [英] Could not find control inside LoginView LoggedIn template
本文介绍了无法在LoginView LoggedIn模板中找到控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在LoginView的LoggedInTemplate中有一个Hyper Link控件。我该如何访问它?我尝试过以下方法: -
I have a Hyper Link control inside the LoginView''s LoggedInTemplate. How do I access it ? I''ve tried the following:-
HyperLink hlkUsrProfile = (HyperLink)HeadLoginView.FindControl("hlkUsrProfile");
HeadLoginView是LoginView的id和HyperLink的hlkUsrProfile id
当我找到它时,它给出了对象引用的错误。无论如何我可以访问HyperLink吗?
Ashok Luhach
HeadLoginView is id of LoginView and hlkUsrProfile id of HyperLink
When i find it it give me error for object reference. Is there anyway in which I can access the HyperLink?
Ashok Luhach
推荐答案
Hey Ashok,
你试试这段代码它可以解决你的问题..
Hey Ashok,
You try this code it may solve your problem..
string txt = ((HyperLink)this.FindControl("HyperLink1")).Text;
Goodluck
Goodluck
这篇关于无法在LoginView LoggedIn模板中找到控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文