handling server clicks after client side script runs
- From: "KK" <KK.kk.com>
- Date: Wed, 16 Nov 2005 12:28:10 +0600
Hi
I have an HtmlInputImage.
at the client, for onClick there is a javascript.
I want the button to be posted as well so that I can handle
the event in the server as well (In case Javascript is disabled or not
supported)
What I currently do is
MyControl : WebControl,IPostBackDataHandler,INamingContainer,
IPostBackEventHandler{
onInit(){
controlButton.ServerClick+=new
ImageClickEventHandler(controlButton_ServerClick);
Page.RegisterRequiresPostBack(this);
Page.RegisterRequiresRaiseEvent(this);
}
private void controlButton_ServerClick(object sender, ImageClickEventArgs
e)
{
Debug.WriteLine("server click");
}
public void RaisePostBackEvent(string eventArgument)
{
controlButton_ServerClick(this,null);
}
}
This way, when the client clicks the image, javascript handles it at client
side and
I am able to call the controlButton_ServerClick() server side function
within
the RaisePostBackEvent().
But I think I am doing something wrong. Shouldn't the Page framework be
calling my serverclick event?? (without me having to call the buttons click
event
explicitly?)
thanks
KK
.
- Prev by Date: Re: Accessing the values of textboxes/labels within a function
- Next by Date: Trust level problems with ISP's with components
- Previous by thread: Exporting a CSV file to the database directly?????
- Next by thread: Trust level problems with ISP's with components
- Index(es):
Relevant Pages
|