Home All Groups Group Topic Archive Search About

Div and code behind on click event

Author
6 Jun 2005 8:08 PM
Ken Nipper
I am trying to use a div as a quasi button and need to use server side
code to navigate.  Any ideas on how to accomplish this?

Thanks
Ken

Author
6 Jun 2005 10:09 PM
Brock Allen
You can build a custom control and implement IPostBackEventHandler. The IPostBackEventHandler.RaisePostBackEvent
will get called when your custom control causes a postback. It will cause
a postback when you execute the javascript returned from Page.GetPostBackClientEvent.
So attach the returned javascript to your div's onclick. Here are some MSDN
docs to get you started:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwebuiipostbackeventhandlerclassraisepostbackeventtopic.asp

-Brock
DevelopMentor
http://staff.develop.com/ballen



Show quoteHide quote
> I am trying to use a div as a quasi button and need to use server side
> code to navigate.  Any ideas on how to accomplish this?
>
> Thanks
> Ken
Author
8 Jun 2005 1:02 PM
Ken Nipper
Brock Allen wrote:

Show quoteHide quote
> You can build a custom control and implement IPostBackEventHandler.
> The IPostBackEventHandler.RaisePostBackEvent will get called when
> your custom control causes a postback. It will cause a postback when
> you execute the javascript returned from Page.GetPostBackClientEvent.
> So attach the returned javascript to your div's onclick. Here are
> some MSDN docs to get you started:
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref
> /html/frlrfsystemwebuiipostbackeventhandlerclassraisepostbackeventtopi
> c.asp
>
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>
>
> > I am trying to use a div as a quasi button and need to use server
> > side code to navigate.  Any ideas on how to accomplish this?
> >
> > Thanks
> > Ken

Thanks for the info.  This helped a lot.

Thanks
Ken