Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / December 2007

Tip: Looking for answers? Try searching our database.

Error with ICallbackEventHandler and Firefox

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
timor.super@gmail.com - 19 Dec 2007 13:07 GMT
Hi group,

I'm trying to extend the ImageButton webcontrol to add "Ajax"
functionnality. So, my control implements ICallbackEventHandler and
I'm adding the js callback on onclick event :

       protected override void OnInit(EventArgs e)
       {
           string script = ".........my js script ..........";
           Page.ClientScript.RegisterClientScriptBlock(GetType(),
"myscript", script, true);
           base.OnInit(e);
       }

       protected override void OnLoad(EventArgs e)
       {
           string callbackRef =
Page.ClientScript.GetCallbackEventReference(this, "....my param....",
"ClientCallback", "null", true);
           Attributes["onclick"] = callbackRef;
           base.OnLoad(e);
       }

and a classical implementation for RaiseCallbackEvent and
GetCallbackResult

Everything is ok with IE, but it's not working on Firefox.

When I debug with FF, i can step on RaiseCallbackEvent or
GetCallbackResult, but it seems that the js method is never call

After some googling, i found this post : http://forums.asp.net/t/959825.aspx
where joteke tells us that the field seems to do a postback in FF

the generated html for my control is :

<input type="image" ... onclick="WebForm_DoCallback(....);"
style="border-width:0px;" />

So I can see my control generate an input type image. Is this the
problem ?

What should I do to make it working with FF ?

Do someone have any idea ?

Thanks for your help.

T.
bruce barker - 19 Dec 2007 16:34 GMT
you do not cancel the default image postback. change code to:

    Attributes["onclick"] = callbackRef + ";return false;";

-- bruce (sqlwork.com)

> Hi group,
>
[quoted text clipped - 45 lines]
>
> T.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.