Use Calendar control without postback to Server?

J

John Kotuby

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 the selected date. Very cool. I am trying
to emulate that behavior with the ASP.NET Calendar control, but it seems to
require a call back to the server (postback) to actually populate a textbox.
I can see how that would take a while for a dial-up connection. Even using
my local IIS server I can see a delay during refresh. Is there anyway to use
an ASP.NET calender in the browser without requiring a postback?

Considering that ASP.NET is much more advanced than "legacy" ASP, I am
guessing there must be a way to do this. Maybe I am trying to use the wrong
control or don't yet understand all it's capabilities.

Does anyone have any input on this or maybe can point me to a resource
describing such a use?

Thanks muchly for any help with this....
 
M

Mark Rae

Considering that ASP.NET is much more advanced than "legacy" ASP,

It certainly is.
I am guessing there must be a way to do this.

Not natively... You can use Ajax / Anthem which will allow you to use the
Maybe I am trying to use the wrong control

You are if you are looking for a completely client-side solution...
point me to a resource describing such a use?

There isn't one...

Begs the question, though, why not continue to use your JavaScript date
picker...?
 
J

John Kotuby

Thanks Mark...

I was hoping that ASP.NET had another solution, but if the J in AJAX refers
to JavaScript then JS is not considered legacy. I was having trouble getting
the call to the DatePicker to work correctly. But you already know that
since you were trying to help me with that....which I appreciate.
Hmm - you might be able to fix it by escaping one of the pairs of quotes
e.g. \'.....\'

Another option, though a bit of a kludge, might be something like:

var objCreateDate =
document.getElementById('<%=txtCreateDate.ClientID%>');
href="show_calendar(objCreateDate)";

I had since discovered a way to get the Calendar control to "pop up" over
the other controls using CSS
Style="visibility:hidden; position:absolute; top:40%; left:30%" and then
changing the visibility attribute upon click of the anchor element. A
discovery for me since I have been programming almost excusively in VB6 and
SQL 2000 for the last 5 years. Lot's of new disciplines to learn for web
applications.

But if I'm even going to consider asynchonous call backs or get proficient
at what used to be called DHTML, then I had better get my JS skills in gear.

Your dedication to this newsgroup is impressive. I tried answering someone
else's question with a code example of my own and found out what type of
effort that takes. Especially when deadlines loom.

OK, back to the drawing board...

Have a good evening,
 
M

Mark Rae

I was hoping that ASP.NET had another solution, but if the J in AJAX
refers to JavaScript then JS is not considered legacy.

Indeed not... Powerful though ASP.NET is, its main function remains the
creation and output of markup to be streamed to a client browser, and
JavaScript is still an extremely important part of that... And the 'J' in
AJAX does indeed refer to JavaScript... :)
But if I'm even going to consider asynchonous call backs or get proficient
at what used to be called DHTML, then I had better get my JS skills in
gear.

Absolutely!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top