Frage

I hope that someone can help me with issue.

In a DNN custom module that I'm creating, I have a RadButton that doesn't show the Text value from the resource file. Other controls do read the values from the resource file.

I tried from the ascx and from the code behind. Another strange thing is that when debugging the application from the code behind I see the Text attribute.

the control definition is:

<dnn:dnnRadButton ID="CntUsSubmit" runat="server" OnClick="ProcessSendMail" resourcekey="CntUsSend" 
   SingleClick="true" SingleClickText="Submitting..." Style="clear: both; float: left; margin: 10px 0;" ></dnn:dnnRadButton>

inse Page_Load I make the localization (too):

CntUsSubmit.Text = Localization.GetString( "CntUsSend.Text", LocalResourceFile );

the page is rendered as:

<span id="dnn_ctr474_View_CntUsSubmit" class="RadButton RadButton_Default rbSkinnedButton" 
   style="clear: both; float: left; margin: 10px 0;">
  <input class="rbDecorated" type="button" name="dnn$ctr474$View$CntUsSubmit_input" 
     id="dnn_ctr474_View_CntUsSubmit_input" value="" />
  <input id="dnn_ctr474_View_CntUsSubmit_ClientState" 
     name="dnn_ctr474_View_CntUsSubmit_ClientState" type="hidden" />
 </span>

the Sys.Application.add_init function shows:

Sys.Application.add_init(function() {
      $create(Telerik.Web.UI.RadButton, {"_accessKey":"","_postBackReference":"WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions('dnn$ctr474$View$CntUsSubmit', '', true, '', '', false, true))","clientStateFieldID":"dnn_ctr474_View_CntUsSubmit_ClientState","iconData":{},"imageData":{},"singleClick":true,"singleClickText":"שולח...","toggleStatesData":[],"uniqueGroupName":"","uniqueID":"dnn$ctr474$View$CntUsSubmit","value":"שלח"}, null, null, $get("dnn_ctr474_View_CntUsSubmit"));
});

I understand the control knows the Text from the add_init, but the rendered button doesn't get the it. Can someone help me how to solve this?

I'm using DNN 7.0.2, VS 2012, for Framework 4.0

War es hilfreich?

Lösung 2

In the end I gave up with RadButton, instad I used Encosia's Postback Ritalin which made the trick nice and smoothly.

Andere Tipps

That's odd. You could try the following in its OnClientLoad event:

        function OnClientLoad(sender, args)
    {
        sender.set_text(sender.get_text());
    }

Try alerting the get_text() first to see if it retursn what you need. If so, you can put this in a global JS file and add the event handler through a Theme.

If this doesn't help try putting the desired text in a hidden field (e.g. with a unique class) and again use the set_text() method.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top