Showing posts with label sample. Show all posts
Showing posts with label sample. Show all posts

Monday, March 26, 2012

Call webmethod in page possible

I thought it was possible to call a public method with the attribute [WebMethod()] above it. But when I try out the sample of the AutoCompleteExtender it works perfectly when I put the code in a webservice (.asmx). Unfortunately when I put the same code in my default.aspx page it doesn't work.

I changed the ServicePath to ="Default.aspx" but that doesn't seem to do the trick.

So does anyone have a clue here what I'm doing wrong?Hi,

at the moment the auto complete stuff works only with a web service. Page methods are not supported.
However, do a search in this forum since a user (I can't remember the name, sorry) has coded a custom version that supports page methods.

Jay Kimble is your man.

http://david.codebetter.com/blogs/jay.kimble/archive/2006/07/17/147436.aspx


The auto complete extender in my library also supports this.

Wednesday, March 21, 2012

CalendarExtender wont display the calendar.

Hello,

I have been trying to get the CalendarExtender control to work in one of my pages work several days now. I used the sample website in the toolkit as a guide. The Calendar.aspx page in the sample website works fine if I add it to my project but when I try to use the extender on one of my pages I get a Javascript error when I click on the textbox that I have attached to the extender. The error reads:

Line: 548

Char: 13

Error: 'this._popupBehavior' is null or is not an object

If anyone out there cares, I found the problem. It would seem that a different datepicker control that I was using had a conflict with the CalendarExtender. I had been using Basic Date Picker Lite because it was the best FREE control that acted like I wanted it to. Once I removed the other control the CalendarExtender worked like a champ. The CalendarExtender even offers me more flexibility than BDPLite. Anyway, I hope that my suffering means that someone else won't have to.

CalendarExtender with ImageButton

Hi,

today i play around the sample of the CalendarExtender from the live demo page,

the third example is using the CalendarExtender with the imageButton,

when i click on the imageButton at the first time, the calendar is popup, then i simple select the date, click on it, the date was selected, fine.

but, when i trying to open the calendar popup, and choose nothing but click again on the imageButton,

the page was fully postback and my previous selected date on the textbox was gone.

at the end i got to solve this with no using the image button but normal image tag.

is that consider a bug?

or i missed something?

I have also discovered that the second click on the image button will force a postback.

I fixed it in the CalendarBehavior.js file like this:

In the _button_onclick function there is an 'if' statment thus

if (!this._isOpen) {
e.preventDefault();
e.stopPropagation();
if (this._enabled)
this.show();
} else {
this.hide();
}

I moved the event function invocations out of the 'if' statement like this:


e.preventDefault();
e.stopPropagation();

if (!this._isOpen) {
if (this._enabled)
this.show();
} else {
this.hide();
}

This seems to work for me on both IE and Firefox. Note that I haven't tested it fully though.