473,387 Members | 1,705 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,387 software developers and data experts.

Textbox in Custom Server Control not retaining data after postback

I am currently building a custom combobox server control. I have
followed pretty much any example, yet my textbox does not retain the
data after postback. my LoadPostData function being fired off, and as
far as I can tell, it works fine. But by the time it is run, the value
in the textbox is gone, so it updates my property with a blank.

I have tried both WebControl.TextBox as well as
HtmlControl.HtmlInputText.

any ideas would be appreciated.

Thanks

Dec 14 '06 #1
4 2560
"Jeremy Jones" <jo***********@gmail.comwrote in message
news:11**********************@79g2000cws.googlegro ups.com...
>I am currently building a custom combobox server control. I have
followed pretty much any example, yet my textbox does not retain the
data after postback. my LoadPostData function being fired off, and as
far as I can tell, it works fine. But by the time it is run, the value
in the textbox is gone, so it updates my property with a blank.

I have tried both WebControl.TextBox as well as
HtmlControl.HtmlInputText.

any ideas would be appreciated.
Have you set the EnableViewState property to false...?
Dec 14 '06 #2
No, but when I tried it, it didn't make any difference

On Dec 14, 2:53 pm, "Mark Rae" <m...@markNOSPAMrae.comwrote:
"Jeremy Jones" <jones.jere...@gmail.comwrote in messagenews:11**********************@79g2000cws.go oglegroups.com...
I am currently building a custom combobox server control. I have
followed pretty much any example, yet my textbox does not retain the
data after postback. my LoadPostData function being fired off, and as
far as I can tell, it works fine. But by the time it is run, the value
in the textbox is gone, so it updates my property with a blank.
I have tried both WebControl.TextBox as well as
HtmlControl.HtmlInputText.
any ideas would be appreciated.Have you set the EnableViewState property to false...?
Dec 14 '06 #3
the point of the loadpostbackdata event, is for your code to move the
postback value(s) to your control. your code should set the value of the
textbox when this event fires. no viewstate is required, unless you want
to fire the changed event (you can store the previuos value in viewstate).

-- bruce (sqlwork.com)

Jeremy Jones wrote:
I am currently building a custom combobox server control. I have
followed pretty much any example, yet my textbox does not retain the
data after postback. my LoadPostData function being fired off, and as
far as I can tell, it works fine. But by the time it is run, the value
in the textbox is gone, so it updates my property with a blank.

I have tried both WebControl.TextBox as well as
HtmlControl.HtmlInputText.

any ideas would be appreciated.

Thanks
Dec 14 '06 #4
I got it working. Thanks!!!

On Dec 14, 3:34 pm, bruce barker <nos...@nospam.comwrote:
the point of the loadpostbackdata event, is for your code to move the
postback value(s) to your control. your code should set the value of the
textbox when this event fires. no viewstate is required, unless you want
to fire the changed event (you can store the previuos value in viewstate).

-- bruce (sqlwork.com)

Jeremy Jones wrote:
I am currently building a custom combobox server control. I have
followed pretty much any example, yet my textbox does not retain the
data after postback. my LoadPostData function being fired off, and as
far as I can tell, it works fine. But by the time it is run, the value
in the textbox is gone, so it updates my property with a blank.
I have tried both WebControl.TextBox as well as
HtmlControl.HtmlInputText.
any ideas would be appreciated.
Thanks- Hide quoted text -- Show quoted text -
Dec 14 '06 #5

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

Similar topics

2
by: Hazzard | last post by:
I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the client side, I lose the new value of the textbox when...
2
by: Jay Walker | last post by:
I created a custom DataGridColumn based on Marcie Robillard's MSDN Article: Creating Custom Columns for the ASP.NET Datagrid...
2
by: CsaaGuy | last post by:
Hi, I created a class in ap.net using vb.net that inherits from Textbox. I added a few of my own properties and methods, set it up to appear in the toolbox. And have used it. My properties that...
0
by: jason | last post by:
Hello everyone. I am trying to write some custom command events into a DataGrid. The command that is currently giving me trouble is an "Add" custom command in the footer of a template column. ...
2
by: fabrice | last post by:
Hi, I have a trouble with my TextBox Control and it's ViewState in my form... The property for it, is FALSE as following : <form id="frmSearchBre4" runat="Server"> <asp:textbox id="myID"...
5
by: Stuart Shay | last post by:
Hello All I am working on ASP.NET 1.1 Custom Pager that allows a User to Enter a Number in a TextBox and go to the page selected. Since the OnClick Event does not work in ASP.NET 1.1 for a...
1
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...
6
by: HockeyFan | last post by:
I'd like to have an AJAX textbox that after the user fills in, will auto-fill another textbox on the page without having a postback occur. It doesn't have to do any filtering or any other thing...
7
by: adiel_g | last post by:
Hello Everyone, I created a custom control. On the CreateChildControls, I added a textbox to the control as follows: // TextBox TextBox txtValue = new TextBox(); txtValue.ID = "txtValue"; ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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,...

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.