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

Updating label

2 Answers 39 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
steve
Top achievements
Rank 1
steve asked on 30 Oct 2008, 01:46 PM
Hi,

Is it possible to update a label that is wrapped in a RadAjaxPanel with code behind?  I.e.:

ASP.NET:

<

telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" height="200px" width="300px"> <asp:Label ID="Connections" runat="server" Text="0"></asp:Label> </telerik:RadAjaxPanel>

C# code :

Connections.text = "100";

I can't get this to work unless I do a postback which is obviously not what I want.
I know this will probably work if I have a timer event and do it in that, but don't want to use one.

Any help is much appreciated.

Regards,
Steve


 

 

 

 

2 Answers, 1 is accepted

Sort by
0
Rosi
Telerik team
answered on 30 Oct 2008, 02:55 PM
Hello steve,

I suggest you remove the Text="0" setting from the aspx definition of the Label. This should helps.

All the best,
Rosi
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
steve
Top achievements
Rank 1
answered on 30 Oct 2008, 03:16 PM

Sorry, but how would this help me to update the text without doing a postback to the server?

I set it to '0' initially as this is how many connections will be connected at the start.  This value is incremented when somebody connects through a socket I have listening, when they connect I want to increase this value and display, but when I increase it and set the text value for it, it doesn't update without doing a postback to the server.

Example, this gets called when somebody connects:

 

int nConn = Convert.ToInt16(this.Connections.Text);
nConn++;
this.Connections.Text = nConn.ToString();

 

Regards,
Steve

Tags
PanelBar
Asked by
steve
Top achievements
Rank 1
Answers by
Rosi
Telerik team
steve
Top achievements
Rank 1
Share this question
or