473,326 Members | 2,081 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,326 software developers and data experts.

TextBox postback problem

I have a form that has a listbox on the top that is bound to a header table.
When the page first loads, it paints the adjacent textboxes with data from
the details table. However, when I postback the page with a new selected
from the header table, the textboxes is not loaded with the new details.
During DEBUG, I could actually see the values as it loops through the fields
but it never paints the details into the textboxes after the page is
completely rendered. I then purposely added a label control onto the form,
and the values are always painted correctly after each postback. The
textboxes, has its initial value. I also tried clearing it first.
Nov 18 '05 #1
5 2452
"John Cosmas" <va*****@msn.com> wrote in message
news:ei**************@TK2MSFTNGP09.phx.gbl...
I have a form that has a listbox on the top that is bound to a header table. When the page first loads, it paints the adjacent textboxes with data from
the details table. However, when I postback the page with a new selected
from the header table, the textboxes is not loaded with the new details.
During DEBUG, I could actually see the values as it loops through the fields but it never paints the details into the textboxes after the page is
completely rendered. I then purposely added a label control onto the form, and the values are always painted correctly after each postback. The
textboxes, has its initial value. I also tried clearing it first.


Some code would help us understand your problem better...

Are you setting the TextBoxes in your listbox's SelectedIndexChanged event
handler? That should work.
--
John Saunders
johnwsaundersiii at hotmail
Nov 18 '05 #2
If the label is loaded with the correct information, why is the textbox not
loaded the same?

"John Cosmas" <va*****@msn.com> wrote in message
news:ei**************@TK2MSFTNGP09.phx.gbl...
I have a form that has a listbox on the top that is bound to a header table. When the page first loads, it paints the adjacent textboxes with data from
the details table. However, when I postback the page with a new selected
from the header table, the textboxes is not loaded with the new details.
During DEBUG, I could actually see the values as it loops through the fields but it never paints the details into the textboxes after the page is
completely rendered. I then purposely added a label control onto the form, and the values are always painted correctly after each postback. The
textboxes, has its initial value. I also tried clearing it first.

Nov 18 '05 #3
WJ
Try: ListBox.AutoPostBack=true;

John

"John Cosmas" <va*****@msn.com> wrote in message
news:ei**************@TK2MSFTNGP09.phx.gbl...
I have a form that has a listbox on the top that is bound to a header table. When the page first loads, it paints the adjacent textboxes with data from
the details table. However, when I postback the page with a new selected
from the header table, the textboxes is not loaded with the new details.
During DEBUG, I could actually see the values as it loops through the fields but it never paints the details into the textboxes after the page is
completely rendered. I then purposely added a label control onto the form, and the values are always painted correctly after each postback. The
textboxes, has its initial value. I also tried clearing it first.

Nov 18 '05 #4
Already did. Remember, the problem is with the textbox control. When the
page is posted back, the data is fetched and the test label I included is
painted/refreshed with the data. But, the textboxes retains its old value.

"WJ" <Jo*******@HotMail.Com> wrote in message
news:OI**************@TK2MSFTNGP09.phx.gbl...
Try: ListBox.AutoPostBack=true;

John

"John Cosmas" <va*****@msn.com> wrote in message
news:ei**************@TK2MSFTNGP09.phx.gbl...
I have a form that has a listbox on the top that is bound to a header

table.
When the page first loads, it paints the adjacent textboxes with data from the details table. However, when I postback the page with a new selected from the header table, the textboxes is not loaded with the new details.
During DEBUG, I could actually see the values as it loops through the

fields
but it never paints the details into the textboxes after the page is
completely rendered. I then purposely added a label control onto the

form,
and the values are always painted correctly after each postback. The
textboxes, has its initial value. I also tried clearing it first.


Nov 18 '05 #5
WJ
"John Cosmas" <va*****@msn.com> wrote in message
news:e%***************@TK2MSFTNGP09.phx.gbl...
Already did. Remember, the problem is with the textbox control. When the
page is posted back, the data is fetched and the test label I included is
painted/refreshed with the data. But, the textboxes retains its old value.


I do have applications that do this type of stuffs and they all work this
way. Since "Code behind" is located @your server. Without enabling postback
on the ListBox control, there is noway for the event handler to be invoked
to fill your TextBox control unless you use JS on client side! The only
thing I can think of is how your Page_Load event PostBack your Text control
? Here is what I do on all my applications on the Page_Load event handler:

c#

If(!IsPostBack)
{
TextBox1.text=ListBox.SelectedItem.Value.ToString( );
}

This way, you only initialize your textbox 1st time only.

If this does not help, then your page must be corrupted somewhere, and this
does happen from time-2-time. If so, I would rebuild the page from scratch

John


Nov 18 '05 #6

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

Similar topics

5
by: Steve S | last post by:
Heres what I want to do...User types into a texbox, clicks a button, the button saves that text to a file. The problem is that when I click the submit button, any changes made to the textbox are...
4
by: RTM | last post by:
Can anyone help me with the following issue? I've seen some similar questions here, but none relating to a textbox control.... I have a form with several controls, one of them being a textbox...
2
by: Ashish | last post by:
Hi All, I have a server runnable textbox control. I also have a server side button object but I hook up javascript to it to show a modal dialog. Upon return it places the value in the textbox...
0
by: Dot net work | last post by:
Hi, Make up a very simple project as follows: 1 aspx form 3 web user controls (referred to as A, B, and C) "A" web user control: Put 1 textbox and 1 button on this web user control. (You...
3
by: Henry | last post by:
Hi. I've also posted this at another discussion board and here is the original question. ------------------------- "I have this problem and I don't know what I can do. First of all, I have a...
4
by: Dave | last post by:
Well... with data in the textbox.. This did not work... <asp:TableCell ID="Tablecell1" CssClass="lnk_results" Runat="server" Width="35%" HorizontalAlign="Left" ColumnSpan="5"> <asp:TextBox...
0
by: datakix | last post by:
After 16 hours of frustration, I've managed to solve this problem for a project I'm working on. The 'trick' is set EnableViewState="False" for the asp:textbox inside the Repeater control. The...
9
by: zdrakec | last post by:
Hello all: Clearly, I'm not getting it! Here is the scenario: On a web page, I have two list boxen and a text box. The first listbox is populated at page load time (if it is not a postback)....
2
by: wildman | last post by:
RE: Gridview textbox has data check without postback.. javascript? I have a gridview with a textbox. I can set the textbox to autopostback and check for a value in a prerender event to decide if...
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.