Calendar control (WEB)

  • Thread starter Thread starter slawek xxxxx
  • Start date Start date
S

slawek xxxxx

Hello everyone,

I have a terrible with Calendar control and I hope someone of you can
help me. The problem is following. I have to display a calendar to
select date. I have prepared page with calendar control I and open it
when user click a button. The problem is that I need this “Calendar
page” to be modal, so I use window.showModalDialog function. If I open
my page in that way then the calendar control (where every day is a link
with javascript:SetDate(…) ) open new window with address
“javascript:SetDate(…)” . I have changed the construction of this “day
links” in that way that now href=”#” but onclick event calls SetData
function. It works fine. But the problem is that there are two links to
navigate between months which I cant access from my code (I mean I don’t
know how to do it). These links still has href= javascript:SetDate(…)
and open new page. Do you have any idea how to access these links
(override some methods or ssthng like that). Thanks for any help.

Best Regards
Slawek
 
Hi, Slawek,

To prevent opening a new window add

<base target="_self">

in the <head></head> part of the page that opens in the modal dialog.

I'm afraid I don't understand the rest of your problems.

Hope this helps
Martin
 
Hi,
I'll try to explain it better.
When you open the page with calendar control every day of the control is
a link build in the following way:
<a href="javascript:__doPostBack('Calendar1','V1492')". Of course if you
want to use if on client side only you have to change this link to
somthing like this:
<a href="javascript:SetDate('..and here is a date..')"></a> where
SetDate is your function witch for example sets the selected date in
textbox on the form.
In this case link should execute SetDate but this construction -
"javascript:...FunctionName" does not work properly when you open such
page as modaldialog. It open a new window with
"javascript:...FunctionName" as an address of the page (it works fine
when you open this with 'window.open' method but as mentioned I need
modal dialog). I can change this 'href' in DayRender method to:
<a href="#" onclick="javascript:SetDate('..and here is a date..')"></a>
and in that case it works fine. But there are also links to navigate
between months (in the header) and I cant access them to change it in
the same way. So my question is: Is there any way to access controls of
the page after there are created(on the server site)??
Thanks for any further help
Regards
Slawek
 
Hi, Slawek,

If you don't need any of the functionalities of the Calendar control why
don't you create your own control?

It is designed to post-back, to keep its state, to be accessible on the page
class etc. and you don't use any of these features.

Greetings
Martin
 
Back
Top