This is a migrated thread and some comments may be shown as answers.

ASP.Net Label Control in Telerick

1 Answer 125 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Amir
Top achievements
Rank 1
Amir asked on 14 Jul 2015, 03:40 PM

I am simply trying to display a value from asp.net label control, the value is setting from the code behind. But I could not find any good example. Either telerik told me that this is not possible or give me a good example. Please note that if I set the text in the markup it works but setting its value from the code behind does not work.

I am opening a popup from jquery to display the label control.

 <telerik:RadWindow ID="RadWindow1" runat="server" Behaviors="Resize, Close"
                                Modal="True" ShowContentDuringLoad="False" VisibleStatusbar="False" AutoSize="False"
                                Width="455" ReloadOnShow="True" Height="260" Title="Opening Balance">
                                <ContentTemplate>

 <asp:Panel ID="Panel​1" runat="server">
                                                                <table class="margin-all-10">
                                                                    <tr>
                                                                        <td class="label">
                                                                            Bank: <asp:Label ID="lblLabel1"  Text="" runat="server"></asp:Label>
                                 .....                                       

 Protected Sub AddBegBalance_Command(ByVal sender As Object, ByVal e As CommandEventArgs)

            lblLabel1.Text = "Some Text"
       
    ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType, "alert1", "Display();", True)

    End Sub​

  <script language="javascript" type="text/javascript">

function ShowModifyAddBalan() {
           
           var _wndwAddOpenBalan = $find("<%= RadWindow1.ClientID %>");
           _wndwAddOpenBalan.show();
       }​

</script>

1 Answer, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 17 Jul 2015, 02:41 PM
Hi Amir,

Can you please provide a little more details on the exact moment in which you want to change the text of the label?
  • Which is the event handled by the AddBegBalance_Command function?
  • Where is the UpdatePanel1 placed?
  • Do you have AjaxManager on the page, or any other update panels?

I am attaching a very simple page demonstrating how the label can be updated on a button click. The page is also containing RadAjaxManager in order to update the text of the label via AJAX, without closing the window. If your scenario is different though, please, send us a runnable sample demonstrating the configuration used by so we will be able to advice you further.


Regards,
Vessy
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Amir
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Share this question
or