473,320 Members | 1,957 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.

Calendar input value overwritten on postback

I am using javascript to dynamically create a date picker input control on a
..Net webform. On postback, the selected value gets overwritten by the default
value generated by the javascript. What can I do?
Oct 14 '08 #1
1 1134
On Oct 14, 11:18*pm, Kelly <Ke...@discussions.microsoft.comwrote:
I am using javascript to dynamically create a date picker input control on a
.Net webform. On postback, the selected value gets overwritten by the default
value generated by the javascript. What can I do?
Hi Kelly

it will depend on how it is implemented. I think you can try to use a
hidden variable which would change its value after postback. The value
must be checked in the javascript after that. You can also inject the
javascript code on a postback, for example

<script>
var default_value=<%=cal_value%>
</script>

in the code-behind

if (Page.IsPostBack)
cal_value = ...
else
cal_value = ...

Hope this helps
Oct 15 '08 #2

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

Similar topics

10
by: vinu | last post by:
I have a javascript file named select.js. This is a file which is use to pop up a calendar, when clicked on a calendar icon in an ASP file. have a close button in the calendar. When i click on the...
1
by: C. Stadther | last post by:
Why is it all controls with an Autopostback feature report their values in the Page Load, but the calendar control's selecteddate value doesn't change till it hits the Selection_Changed Event. Is...
0
by: Wyatt70 | last post by:
I'm attempting to implement a javascript popup calendar in a DataGrid. The calendar will be used to insert a date into a textbox. I keep getting a "System.NullReferenceException: Object reference...
1
by: warrengo | last post by:
I have a 2.0 asp app and i'm trying to implement a pop-up calendar. I can get the calendar to pop-up and select a value, but can not get the value to pass back to the calling page. Here is the...
0
by: GV | last post by:
Hi all, New to developing in VS 2005 ASP 2.0 Trying to have a easy pop calender for a button on a web page. I keep getting a error message in IE6 that says: Line 69 Char 3 Error:...
6
by: caine | last post by:
I have a clickable calendar, which user can select the day that they want to view the news linking to. My calendar has the clickable event day, but once the user click it, the day selected could...
3
by: John Kotuby | last post by:
Hi all, Just wondering. I am converting an ASP application to ASP.NET 2.0. The ASP version used a JavaScript Calendar that would pop up on the client side and populate various text fields with...
0
by: mathewgk80 | last post by:
HI all, I am having popup calendar Javascript code. But i dont know how it is connecting to asp.net code.. I am using asp.net,c#.net and also using 3tier architecture with master page.... I...
4
by: gubbachchi | last post by:
Hi all, Please anybody help me solve this problem. I am stuck up with this from past 2 weeks. I am developing an application where, when the user selects date from javascript datepicker and enters...
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...
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...
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)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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.