473,406 Members | 2,352 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Custom control looses data ASP.NET 2.0

I am working with ASP.NET 2.0
I have user control that has 2 textboxes. On of them is hidden using html
attribute (it is still rendered on the page). The control also has html
button for JavaScript event.
After user clicks on the button browser shows pop up web dialog and allows
user to make select in it. The selection that is displayed in the visible
textbox and key of the selection is stored in hidden text box.

The problem is that after post back and page returns to the browser the
values of the boxes are lost. ( I can read them on server though). I don't
have anything clearing them.

Any ideas? All the EnableViewState set to true (two textbox and the
usercontrol on the page)

Thank you,
Shimon.
Nov 20 '05 #1
3 1216
Found. For some reason if you set a TextBox ReadOnly = true. It doesn't keep
stateview. In 1.1 behavior was different
"Shimon Sim" <sh**********@community.nospam> wrote in message
news:eQ**************@TK2MSFTNGP11.phx.gbl...
I am working with ASP.NET 2.0
I have user control that has 2 textboxes. On of them is hidden using html
attribute (it is still rendered on the page). The control also has html
button for JavaScript event.
After user clicks on the button browser shows pop up web dialog and allows
user to make select in it. The selection that is displayed in the visible
textbox and key of the selection is stored in hidden text box.

The problem is that after post back and page returns to the browser the
values of the boxes are lost. ( I can read them on server though). I don't
have anything clearing them.

Any ideas? All the EnableViewState set to true (two textbox and the
usercontrol on the page)

Thank you,
Shimon.

Nov 20 '05 #2
Thats a shame as I used to use this, have you also tried this on normal
pages ? You could of course work around this by saving the value manually to
viewstate

--
Best Regards

The Inimitable Mr Newbie º¿º
"Shimon Sim" <sh**********@community.nospam> wrote in message
news:Ox*************@TK2MSFTNGP10.phx.gbl...
Found. For some reason if you set a TextBox ReadOnly = true. It doesn't
keep stateview. In 1.1 behavior was different
"Shimon Sim" <sh**********@community.nospam> wrote in message
news:eQ**************@TK2MSFTNGP11.phx.gbl...
I am working with ASP.NET 2.0
I have user control that has 2 textboxes. On of them is hidden using html
attribute (it is still rendered on the page). The control also has html
button for JavaScript event.
After user clicks on the button browser shows pop up web dialog and
allows user to make select in it. The selection that is displayed in the
visible textbox and key of the selection is stored in hidden text box.

The problem is that after post back and page returns to the browser the
values of the boxes are lost. ( I can read them on server though). I
don't have anything clearing them.

Any ideas? All the EnableViewState set to true (two textbox and the
usercontrol on the page)

Thank you,
Shimon.


Nov 20 '05 #3
There is very easy work around.
First of all you make your textbox ReadOnly = false;
but you add
textBox.Attributes.Add("readonly","true");
That is all.

No I didn't try this on regular pages.
Let me know if it works differently on pages.
Shimon.

"Mr Newbie" <he**@now.com> wrote in message
news:OS**************@TK2MSFTNGP09.phx.gbl...
Thats a shame as I used to use this, have you also tried this on normal
pages ? You could of course work around this by saving the value manually
to viewstate

--
Best Regards

The Inimitable Mr Newbie º¿º
"Shimon Sim" <sh**********@community.nospam> wrote in message
news:Ox*************@TK2MSFTNGP10.phx.gbl...
Found. For some reason if you set a TextBox ReadOnly = true. It doesn't
keep stateview. In 1.1 behavior was different
"Shimon Sim" <sh**********@community.nospam> wrote in message
news:eQ**************@TK2MSFTNGP11.phx.gbl...
I am working with ASP.NET 2.0
I have user control that has 2 textboxes. On of them is hidden using
html attribute (it is still rendered on the page). The control also has
html button for JavaScript event.
After user clicks on the button browser shows pop up web dialog and
allows user to make select in it. The selection that is displayed in the
visible textbox and key of the selection is stored in hidden text box.

The problem is that after post back and page returns to the browser the
values of the boxes are lost. ( I can read them on server though). I
don't have anything clearing them.

Any ideas? All the EnableViewState set to true (two textbox and the
usercontrol on the page)

Thank you,
Shimon.



Nov 20 '05 #4

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

Similar topics

21
by: One Handed Man \( OHM - Terry Burns \) | last post by:
When using a custom control. In order to check and see if values have changed one has to implement the IPostBackDataCollection interface. The values returned for the control seem to be simply a...
2
by: Suzanne | last post by:
Hi all, I'm reposting this message as I'm experiencing this problem more and more frequently : I really hope someone out there can help me as I've been tearing my hair out on this one for a...
0
by: steve | last post by:
i've built serveral controls designed for touch-screen use. i have a quirk with one and am not sure how to solve the problem. it is a drop-down style combo box that filters list items as the input...
10
by: Jon | last post by:
I'm investiging multi-threaded GUI applications; specifically the technique used to ensure that controls are only modified under the correct thread. The standard technique is to use ...
2
by: J R M | last post by:
I've developed a custom control (it's basically a drop-down list and then a couple of textboxes to include meta-data for the selection) that I'm embedding into another custom control (the idea is...
14
by: Rolf Welskes | last post by:
Hello, I have an ObjectDataSource which has as business-object a simple array of strings. No problem. I have an own (custom) control to which I give the DataSourceId and in the custom-control...
15
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt...
0
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
2
by: pdickson | last post by:
Hi - I am using custom textboxes and I need to be able to set the Text on txb1 based on the Text of txb2. I have simplied my code to the following: Public Class customtextbox Inherits...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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: 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...
0
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...
0
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,...

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.