Asp.Net tips: calling server-side events on the client side
Author:Eve Cole
Update Time:2009-07-01 16:13:00
Asp.Net tips for calling server-side events on the client side:
string strCMD = Page.GetPostBackClientHyperlink(ControlName,Parameter);
OtherControlName.Attributes.Add("ClientEventName", strCMD);
Small note:
In the above two lines of code, use the Page.GetPostBackClientHyperlink method to obtain a reference to the server control event, and then add a client event through the Attributes.Add method of other controls on the page so that the server-side event can be called. In this way, the function of calling server events on the client can be completed.