473,795 Members | 3,279 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

losing attributes on postback

JP
I have a .NET Dropdown list control that get populated with several ITEMS
from a database. In addition, each of those items get populated with
additional attributes via this syntax: (assume that items[0] exist)

dropAliasNames. Items[0].Attributes.Add ("FN",123);
dropAliasNames. Items[0].Attributes.Add ("LN",482);

The issue is that on a post back, the items are in the list of course but
all attributes added before the post back are gone, Why? I can understand if
the attributes were added via JavaScript after the page was rendered, but
these were added in C# in the Page_Load.

They should be there on postback

--
JP
..NET Software Developer

Nov 1 '06 #1
0 1130

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

Similar topics

4
2408
by: Keith-Earl | last post by:
I have been writing ASP.NET apps since the RTM build and have never seen this. I built a simple app that uses session variables on my DEV laptop. All runs well. I have a simple toggle routine that checks the status of a Session variable. I keep losing the value of the variable. When I trace the page it is there, but it is gone next postback. Also, I use three tier objects and store my DataManager object in a session variable. It is...
1
2712
by: Matthew Curiale | last post by:
I have a ddl that is populated in my If Not IsPostBack block in the Page_load event. A repeater is also populated at this time, showing different domains for a website. The ddl contains different price plans that can be selected. My problem is that the user has a choice of being able to update information, or update and create a new domain. In doing either, if the user changes the index of the ddl, I lose all data in the ddl, and my...
0
1590
by: fwirtanen | last post by:
I am building a custom composite control consisting of two drop downs, with parent/child dependancy. The child dropdownlist is updated through client callback when the parent index changes. An 'All' list item is added to the child dropdown during the CreateControlHeirarchy(bool useDataSource) method. Somewhere between the CreateControlHeirarchy method executing and the
6
1939
by: et | last post by:
In a procedure where a user creates a password, among other things, the password textbox returns to blank whenever a user selects other fields that cause a postback, even though they are not done saving the record.. How can I retain what the user has entered in the password field even on postback? And why does it only happen to the password field; all other fields are retained.
1
6833
by: LG | last post by:
I want to add attributes to a custom dropdownlist and I found some code on Internet that doesn't work after post back. First time the control has the attributes, but after postback the attributes are lost. It must be a bug in the code bellow. Can anyone help? Thanks, LG using System;
0
1126
by: ruca | last post by:
Hi, Can anyone tell me how can I preserve the values of Attributes of a DataGrid with postback. I have a javascript function that change some attributes of some cells of a DataGrid. Then I have a button to confirm this changes. By clicking in this button postback event fires and attributes values losted. Can anyone help me and where can I get more information about this?
1
4232
by: jqheller | last post by:
Folks I am losing my mind trying to work with the TemplatedWizardStep. I have created a multistep user registration form that collects plenty of user information including a password. At the end of the process I am finding that the value of my password control is blank. When I set the textmode of my textbox to singleline, the value is preserved. It is just when the textbox is set to password that I lose the value. I am casting to the...
0
1831
by: Mel | last post by:
On Oct 23, 8:30 am, bruce barker <nos...@nospam.comwrote: Huh? Did you mean Listbox not DropDownList? The drop-down is working fine, it's the Listbox data that gets cleared after the drop-down list causes the postback.
3
1792
by: David C | last post by:
I have an aspx page that has HyperLink controls that have NavigateURL set to the current page. I was assuming that would postback but it comes back like the first time in the page and I am losing values in one of my TextBox controls. It is there when I first load the page from another page but gets lost as soon as I click the HyperLink. What am I missing? Thanks. David
0
9519
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10435
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10163
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10000
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9037
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4113
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 we have to send another system
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.