CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!



Zone: > NEWSGROUP > Asp.Net Forum > windows_hosting.hosting_open_forum Tags:
Item Type: NewsGroup Date Entered: 1/5/2005 7:32:30 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 2 Views: 30 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
3 Items, 1 Pages 1 |< << Go >> >|
shellyk
Asp.Net User
Textbox looses value in code behind1/5/2005 7:32:30 PM

0/0

I'm baffled. I'm writing a web-app with asp.net / vb.net using visual studio.net. there is a text box, say textbox1, and a save button, say button1. When button1 is clicked, the value in textbox1 is supposed to be saved. After clicking button1, I've stepped through the code to see whats happening, and it seems that textbox1.value is being reset.

For example, if I type "some value" into textbox1 and click button1:
On the last line of the page load function (End Sub), the textbox1.value is "some value".
On the first line of the button event handler (function button1_click), the textbox1.value is "".

From what I can tell, there is nothing in between. What am I missing????

Any help is greatly appreciated! Thanks!
MK
danscan
Asp.Net User
Re: Textbox looses value in code behind1/5/2005 8:36:59 PM

0/0

search for all instances of textbox1.text. That should solve your problem.
Else ensure that enableviewstate is set to true. I believe it is in the yellow portion at the top of the page. It could also be in the web.config file.

Other then that I would say just start a new app and see if it happens again.


The difference between genius and madness is success. And I haven't been too successful.
luisluis
Asp.Net User
Re: Textbox looses value in code behind1/7/2005 10:49:21 AM

0/0

I think you use some code in the Sub Page_Load that reset the textbox1.text to "" so you need to use the code

If Not Page.IsPostBack Then

End If


to protect the code that only must be run the first time the page is loaded

Feliz Año Nuevo
Happy New Year
3 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Mastering Visual Basic.NET Authors: Evangelos Petroutsos, Pages: 1153, Published: 2002
ASP.NET 2.0 Cookbook Authors: Michael A. Kittel, Geoffrey T. Leblond, Pages: 989, Published: 2005
Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators Authors: Sue Mosher, Pages: 825, Published: 2007
Beginning Dreamweaver MX Authors: Charles Brown, Imar Spaanjaars, Todd Marks, Pages: 816, Published: 2003
ASP.NET and VB.NET Web Programming Authors: Matt J. Crouch, Pages: 768, Published: 2002
Mastering Web Development with Microsoft Visual Studio 2005 Authors: John Paul Mueller, Pages: 822, Published: 2005
.NET Wireless Programming Authors: Mark Ridgeway, Pages: 564, Published: 2002

Web:
UserControl loses TextBox value when placed inside a MasterPage ... UserControl loses TextBox value when placed inside a MasterPage .... If it is there, then I would check the code behind of the user control ...
htmlTable looses tablerows in codebehind - ASP.NET Forums when saving the table in codebehind the tables is simply empty and ... that i need to access the TextBox with the freshly inserted values, ...
ASP.NET 2.0 TextBox Ready Only losing client side changes, values ... Write of the TextBox value. So, in the code behind, add the following method .... I've noticed that those lose value just like a readonly textbox. ...
Dynamically creating ASP.NET controls from the code behind files ... this code doesnot work as the values dont get displayed in my textboxes. ... get rebuilt and set back to the default values and lose the postback data. ...
ImageUrl lost on postback with dynamic controls, but textboxes ... How to assign a method’s output to a textbox value without code behind · Setting viewstate on postback · Prevent Multi-Line ASP:Textbox from trimming line ...
CodeProject: A Localizable Currency TextBox. Free source code and ... Display the value as currency text, formatted in accordance with the current culture. ..... And code behind (after submitting the form): ...
Atlas ModalPopup PostBack passing text box values workaround or ... May 11, 2006 ... Atlas ModalPopup PostBack passing text box values workaround or ... How to populate DropDownList ASP .net with EntitySpaces in code behind ...
Behind the Scenes: Improvements to Windows Forms Data Binding in ... Download code samples in C# and Visual Basic (23 KB) at the Microsoft Download Center. .... salary text box loses the focus and the value passes validation. ...
ASP:TextBox - .NET ASP Try the attribute "text" instead of "value". The best way to do this is declare an ASP textbox in the code-behind page ...
Password Text Box Cleared On Postback : ASP.Net The problem is that the password text box loses its value. ... Right now the click event for the button is handled in the code behind. ...




Search This Site:










back button in asp.net

composite control regexvalidator on textbox problems

msdn chat - windows 2003 hosting - october 19

custom compositecontrol surrounded by <span> tag

control panel graphics

control not maintaining values on postback

adding user control properties?

collectioneditor for extended panels

pulling image data from sql server 7 to an image control

datagrid web ocntrol

embedded css and webresource attribute (webresource.axd)

events not triggered

skmmenu

invoking property editor from custom designerverb

need a fast uk mysql host

cloning the arraylist

ie back button

server control property is bold in property list

document properties in sql show like outlook.

how do i use viewstate in a server control?

do i have to compile my user control?

help starting my hsp ( hosting service provider).

adding command event arguments to a control

displaying an icon or image in design view?

vs.net custom designer

better webusercontrol wrapping?

writing a client function shared by similar validators

can someone list out the new server controls?

rich text box

advanced adrotator: things you wished adrotator did?!?!

  Privacy | Contact Us
All Times Are GMT