asp.net - Handle two events on button click -


I'm a bit new in ASP.NET / jQuery games, and I find it difficult. I am using colorbox to create a model window popup, and I need an upload picture form on that modal window. I have a button to open the add photo form:

  & lt; A href = "#" class = "addpicture" & gt; Add / edit picture & lt; / A & gt; & Lt; Br / & gt; & Lt; Script & gt; $ (Document) .ready (function () {$ ("Addpicture"). Colorbox ({width: "50%", inline: true, href: "# page1"});}); & Lt; / Script & gt;  

So far my modal window is working perfectly, and displaying the following upload form and next button:

  & lt ; Asp: FileUpload ID = "picup" runat = "server" class = "upload" /> gt; & Lt; Br / & gt; & Lt; ASP: Button ID = "Button 1" type = "button" run = "server" text = "next page" square = "next page" />  

Here's where I got stuck; I am trying to upload the picture to the next button, and I am going to another modal window, on which I am going to implement the Crop function. The problem is, to do this, I need a jquery event handler:

  $ ("nextpage"). Colorbox ({width: "50%", inline: true, href: "# page2"});  

I also need a server side event handler to upload:

  protected sub button 1_Click (ByVal sender as the object, the system's Click the ByVal and System.EventArgs) button 1. Click picup.PostedFile.SaveAs ("\ Pictures \ 1-a.jpg") Exception Response. However, when I put it in breakpoint, this event handler never fires. I thought the possible solution was Javascript ("upload failed"). To hide a hidden button, and that button is clicked with vb, but I did not know how to click the button from VB. Is there something that I'm doing wrong in the fundamental way? Is there a good way to fulfill me? 

EDIT: The way I am doing this has changed it, instead of several modal windows, I am loading a different page in an iframe on the model window, then I will return the main page Can I postback without loading thanks for your cooperation. You need a postback when uploading a file upload file, otherwise the event will never be closed.

P>

  • There are a couple of jQuery plugins that can be downloaded through AJAX Promises to enable uploading, but I've never tried it.

Comments