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

posted @ Wednesday, March 08, 2006 2:33 PM

Print

Comments on this entry:

No comments posted yet.

Your comment:



 (will not be displayed)


 
 
 
Please add 3 and 4 and type the answer here:
 

Live Comment Preview:

 
«December»
SunMonTueWedThuFriSat
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910