473,473 Members | 2,163 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

<asp:label> reverting to initial value

Why oh why does my <asp:labelrevert to its initial value, having been
changed programmatically, when I click a button in a user control I
have added dynamically to the page? It's EnableViewState is set to
true.

Mark

Aug 1 '06 #1
4 1348
<ma**********@gmail.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
Why oh why does my <asp:labelrevert to its initial value, having been
changed programmatically, when I click a button in a user control I
have added dynamically to the page? It's EnableViewState is set to
true.
How is it being populated initially...?
Aug 1 '06 #2
Did you forget to use IsPostBack to avoid re-initialization?

OR

If the control is dynamically added control, then add the control on
Page PreInit, such that view state will be populated for the control.
Controls view state will be populated on subsequent TrackViewState
call.

Hth,
Ramu

ma**********@gmail.com wrote:
Why oh why does my <asp:labelrevert to its initial value, having been
changed programmatically, when I click a button in a user control I
have added dynamically to the page? It's EnableViewState is set to
true.

Mark
Aug 1 '06 #3
It is being populated on the .aspx page directly, using the Text
attribute of the Label class. I'm not setting its initial value in
code.

Mark

Mark Rae wrote:
<ma**********@gmail.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
Why oh why does my <asp:labelrevert to its initial value, having been
changed programmatically, when I click a button in a user control I
have added dynamically to the page? It's EnableViewState is set to
true.

How is it being populated initially...?
Aug 15 '06 #4
Neither of those applies, since it's initial value is not set it code,
and it is not dynamically added.

Mark

Ramu wrote:
Did you forget to use IsPostBack to avoid re-initialization?

OR

If the control is dynamically added control, then add the control on
Page PreInit, such that view state will be populated for the control.
Controls view state will be populated on subsequent TrackViewState
call.

Hth,
Ramu

ma**********@gmail.com wrote:
Why oh why does my <asp:labelrevert to its initial value, having been
changed programmatically, when I click a button in a user control I
have added dynamically to the page? It's EnableViewState is set to
true.

Mark
Aug 15 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: RSB | last post by:
Hi Every one, Having tuff time to make this work .. i want to have a button and on my form say Delete button. So once i click on it i want to confirm "Are you sure?" on the Client Side and if...
1
by: John Smith | last post by:
I created a dataTable that returns a value from a stored procedure. How would I bind that results of a query to an <asp:label>? Thank you!
6
by: Andreas Klemt | last post by:
Hello, when I use <asp:label font-size="16px" text="Hello World" runat="server" /> and run FireFox Browser the output of "Hello World" is not in Size 16px. The size will be ignored and I can...
5
by: Johnb41 | last post by:
I want an "order number" to be displayed more than once on my page. <script language="vb" runat="server"> ... dim ordernumber as string = "123456" page.databind() ... </script>
3
by: nick | last post by:
Is possible for server side code to access the text of <asp:label> changed by client side javascript code?
4
by: Satya | last post by:
Hi all, The following code is throwing a run time error "The server tag is not well formed. " <ItemTemplate> <asp:HyperLink Runat="server" ID="lnkFile"...
2
by: John Smith | last post by:
I have this DataGrid: <asp:datagrid id="dg1" runat="server" AutoGenerateColumns="False"> <Columns> <asp:TemplateColumn HeaderText="SM"> <ItemTemplate> <asp:Label id="Label2" runat="server"...
8
by: gelligokul | last post by:
Hello frens i want to retrieve <asp:label> value from the code behind in c# can any one help me...
3
by: Homer J. Simpson | last post by:
I have the following stored procedure: ALTER PROCEDURE . AS BEGIN SET NOCOUNT ON; SELECT COUNT(*) FROM QUICKNOTES END ....and the following data source in my .aspx file:
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.