Can't assign text to DotNetNuke LabelControl in Page_Load event.

I wanted to assign text of the LabelControl , so in the user control Page_Load  function I've added code like this:

If Page.IsPostBack = False Then

If  bSetCaptionInCode Then

   Me.plUsername.Text = "Your User NAME:“

end if

End If

Unfortunutely, it didn't work and the label was not changed.

After some research I found , that LabelControl's text is populated  from resources during LabelControl's Load event , which is later than container UserControl Load event.

So if I want to overwrite text from resources , I have to do it in PreRender event.

I think that it should be possible(?) to assign Resources strings in LabelControl during Init, not Load event.

There should NOT be If Page.IsPostBack = False Then condition, because LabelControl reloads GetLocalizedText on each call

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati
posted @ Wednesday, March 08, 2006 2:33 PM
Print

Comments on this entry:

No comments posted yet.

Your comment:



(not displayed)


 
 
 
 
 

Live Comment Preview:

 
«February»
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910