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

Textbox clears on postback.

Please help anyone.

I have 2 aspx pages that need to "chat" to each other. The first page
is one where 2 or more dates needs to be selected from a date picker,
which is a custom form with a datepicker on that has been customised to
display public holidays. When a date is selected / the datepicker's
selected date changes I register a script block that passes the
selected date to the "window.opener.<controlname>.value".

Code:
strScript = "<script language=""javascript"">" & _
"window.opener.document.form1." &
Trim(Request.QueryString("ControlName").ToString.T rim) & ".value = '" &
Trim(Calendar1.SelectedDate.ToString("dd MMM yyyy")) & "';" & vbCrLf &
_
"window.close();" & vbCrLf & _
"</script>"

If Not IsClientScriptBlockRegistered("sendData") Then
RegisterClientScriptBlock("sendData", strScript)
End If

This works perfectly, until the next date gets selected, then the first
date gets cleared out of the textbox which was put into.

Is there any way to prevent this from happening? I assume that once the
page does a postback it resets the controls to default values?

This problem only started occuring once the project was converted from
Visual Studio 2003 to Visual Studio 2005.

Any help or suggestions will be appreciated.

TIA.

Dawie Lombaard.

Oct 23 '06 #1
0 830

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...
3
by: musosdev | last post by:
Hi I want to have a textbox on my webpage that shows 'Type here' in gray. When you click on the textbox, that text disappears and you can type your search, rather than having to select it and...
1
by: Greg Smith | last post by:
How do you hold the data in a password TextBox on a PostBack? My users don't like it if enter data into the password and password confirm Textbox and another control's PostBack clears it out. ...
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...
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: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.