Updating Label on a WebControl

  • Thread starter Christian Filzwieser
  • Start date
C

Christian Filzwieser

Hy
I created a WebControl called StatusBar with a static function

public static void SetText(string text) { MyVariable = Text }

and on Page Load I set MyVariable to the Label in my WebControl.
On my Webform i load data form SqlServer into a grid and i want to set
the Recordcount in the Statusbar.

My Question:
Is there any way to refresh the StatusBar ???
 
G

Guest

Hi Christian,

you should not use a static method to display dynamic contents on a control.
What are you doing with the "MyVariable" in your code?

cu patrick
 
C

Christian Filzwieser

I set LABEL.Text = MyVariable to show the string on the StatusBar !!!

Greez The Filzmeister
 
G

Guest

Hi Christian,

use the same code in your property or method, and you will always have an
up-to-date Label:

public void SetString(string value)
{
if (LABEL != null) // this is not required when you call the method after
Init
LABEL.Text = value;
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top