Handle two events on button click
<p>I am a bit new to the asp.net/jQuery game, and I seem to be having difficulty. I am using colorbox to make a modal window popup, and I want an upload picture form on that modal window. I have a button to open up the add photo form:</p>

<pre><code>&lt;a href="#" class="addpicture"&gt;Add/Edit picture(s)&lt;/a&gt;&lt;br /&gt;
 &lt;script&gt;
        $(document).ready(function () {
            $(".addpicture").colorbox({ width: "50%", inline: true, href: "#page1" });
        });
 &lt;/script&gt;
</code></pre>

<p>Thus far my modal window is working perfectly, and is displaying the following upload form and next button:</p>

<pre><code>&lt;asp:FileUpload ID="picup" runat="server" class="upload" /&gt;&lt;br /&gt;
        &lt;asp:Button ID="Button1" type="button" runat="server" Text="Next Page" class="nextpage" /&gt;
</code></pre>

<p>Here's where I am stuck; I am trying to have the next button upload the picture, and move to a second modal window, which I am going to implement a crop function on. The problem is, to do this, I need a jquery event handler:</p>

<pre><code>$(".nextpage").colorbox({ width: "50%", inline: true, href: "#page2" });
</code></pre>

<p>I also need a serverside event handler to do the actual upload:</p>

<pre><code>Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
    Try
        picup.PostedFile.SaveAs("\Pictures\1-a.jpg")
    Catch ex As Exception
        Response.Write("Upload Failed")
    End Try
End Sub
</code></pre>

<p>However, when I put in a breakpoint, this event handler is never firing. 
A possible solution I thought up is to make a hidden button that fires the javascript, and click that button from vb, but I couldn't figure out how to click a button from vb. Is there something I'm doing fundamentally wrong? Is there a good way to accomplish what I want?</p>

<p>Edit: I have changed the way I am doing this, instead of multiple modal windows, I am loading a separate page in an iframe on the modal window, then I can have a postback without reloading the main page. Thank you for your help. </p>
