|
Rank: Newbie Groups: Member
Joined: 6/15/2007 Posts: 4
|
Hi, sorry, I'm trying to add java script to Calendar.ClientSideOnClick. I want to select a date for deleting files. Calendar ist a nested control in my menu. If end user clicks on a day a msgbox should appear ("Are you sure....") and only if he confirms the question, the page is posted back to run some server side code. I try to use the ClientSideOnClick event but nothing happens.
Code: HTML/ASPX
<eo:CustomItem ID="mci1" runat="server">
<eo:Calendar ID="cal1" runat="server" ControlSkinID="None" CssBlock="" CssFile="~/App_Themes/cx/cx.css" DayHeaderFormat="FirstLetter" DisabledDates="" DisableWeekendDays="True" SelectedDates="" TitleLeftArrowHoverImageUrl="00040205" TitleLeftArrowImageUrl="00040204" TitleRightArrowHoverImageUrl="00040207" TitleRightArrowImageUrl="00040206" VisibleDate="2008-09-01" Width="80px" AutoPostbackOnSelect="True" ClientSideOnSelect="MyCode()">
<CalendarStyle CssClass="dtp1" />
<DayHeaderStyle CssClass="dtp2" />
<DayStyle CssClass="dtp3" />
<DayHoverStyle CssClass="dtp5" />
<TodayStyle CssClass="dtp5"/>
<DisabledDayStyle CssClass="dtp6" />
<OtherMonthDayStyle CssClass="dtp6" />
<MonthStyle CssClass="dtp7" />
<SelectedDayStyle CssClass="dtp8" />
<TitleArrowStyle CssClass="dtp9" />
<TitleStyle CssClass="dtp10" />
</eo:Calendar>
</eo:CustomItem>
Thanks a lot Christian Schweda
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
You would do:
ClientSideOnSelect="MyCode"
Instead of:
ClientSideOnSelect="MyCode()"
Thanks
|
|
Rank: Newbie Groups: Member
Joined: 6/15/2007 Posts: 4
|
Hello,
thanks, this works with ClientSideOnChange event only. How can I prevent a postback if end user doesn't confirm the question?
Regards Christian Schweda
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
I do not think there is an easy way for you to prevent a post back with ClientSideOnSelect when AutoPostBackOnSelect is on. If you wish to do that, you will have to have AutoPostBackOnSelect set to false and then do postback in your script code if necessary.
All our client side JavaScript event takes the form of ClientSideOnXXX="function_name". Only the name of the function, not a call to the function is used.
Thanks
|
|
Rank: Newbie Groups: Member
Joined: 6/15/2007 Posts: 4
|
ok, thanks. Now I have a solution with java script.
|
|