![]() |
| ||
| FileUpload automatically upload after set filepath Hi, I have a gridview that has a fileupload (fupRespuesta) control in a itemtemplate field, I need to enable automatic upload after file is selected. Then I added a imageButton (imgRespuesta) in the template field and added its event with addhandler... Well my problem is that when I uncomment the red line, the event of the image button don't fire (I can't understand why) I need it work, or some other idea to do it. Heres my code: Private Sub gv_RowCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvPropuestasDiagnosticoListar.RowCreated |
| ||
| Re: FileUpload automatically upload after set filepath Write the following code in RowDataBound event of the GridView control. This code is to attach onChange event of the file upload control to the click event of image button control. imgRespuesta = e.Row.FindControl("imgProDiagUploadRespuesta")fupRespuesta = e.Row.FindControl("fupvcProDiaRutaRespuesta")Write this code in RowCreated event of the GridView. This code is to set style for image button and add handler to it. imgRespuesta = e.Row.FindControl("imgProDiagUploadRespuesta")I have tested this way in C#. It is working for me. I can able to reach img_Click event if a file is browsed and selected. |
| ||
| Re: FileUpload automatically upload after set filepath I tried it, and it reaches the event, as you said, but the problem now is that the HasFile property of the FileUpload control is false when after I select the file... And I don't know why... I hope you can help me with this... Private Sub imgEnvio_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Quote:
|
| ||
| Re: FileUpload automatically upload after set filepath Hi, Using ajax, I manage to solve this, registering the imagebutton for postback in the scriptmanager... and that's it! |
| All times are GMT -4. The time now is 4:38 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC