difference between onclick event or commandbutton_click

snoopyyu

Newcomer
Joined
Feb 26, 2004
Messages
7
Does anyone know the difference between onclick event or the command_click event?
Specifically, for a command button, we can add something like this in our code:

cmdRunReport.Attributes.Add("onclick", <do something>)

Or/And:
Private Sub cmdRunReport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdRunReport.Click
<do something>
End Sub

If have have codes in both of the above situation, which one will execute first?

In my application, I want to do the following:
when user click the command button -
1. Open a new window displaying the progressbar.htm
2. executing code to generate pdf report and store it in myreports/report.pdf
3. redirect the new window to display report.pdf

Any ideas of how I can do it? I tried to add codes in the click event, but it looks like nothing will happen until the generating report finish executing.

Thanks in advance.
 
Back
Top