Fileupload is not working

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
9/26/2012 11:12:23 AM
Gravatar
Total Posts 2

Fileupload is not working

I'm trying to add fileupload to and existing control that is working inside mojoPortal.

When I add simple a file upload tag 

<asp:FileUpload ID="FileUpload1" runat="server" />
<asp:Button ID="Button2" runat="server" Text="Button" onclick="Button2_Click"></asp:Button>

The onClick event this not working, Why suggestions?

---

mojoPortal Version 2.3.8.1 MSSQL

Operating System Microsoft Windows NT 6.0.6002 Service Pack 2

ASP.NET v4.0.30319 Running in Full Trust

 

9/26/2012 12:56:32 PM
Gravatar
Total Posts 81
Website Hobbyist and Software Engineer
Proud member of the mojoPortal team
www.doan.me

Re: Fileupload is not working

It is hard to say without more details... are you getting errors? What is your code behind the button click?

Since this currently does not seem mojoPortal specific I would suggest the this tutorial on the ASP FileUpload control to see if you can figure out where your disconnect is.

9/27/2012 11:19:17 AM
Gravatar
Total Posts 2

Re: Fileupload is not working

I'm not getting errors.

In this page I'm using jquery to send form information to server and everything works besides fileupload.

Fileupload event is not triggered.

9/27/2012 11:30:46 AM
Gravatar
Total Posts 1203
Proud member of the mojoPortal team

Help support mojoPortal!
Add-on modules

Re: Fileupload is not working

We always recommend that custom development should follow mojoPortal conventions both for speed/ease of development and consistency in the user interface. For uploading, I'd recommend you look at how mP performs file uploads within its delivered features. A good one to look at would probably be either the Shared Files module, or the Image Gallery. Chances are you'll find there's a much simpler way to do file uploads using already created mojoPortal helper classes. No need to reinvent the wheel if you don't need to.

Jamie

9/27/2012 2:28:24 PM
Gravatar
Total Posts 18439

Re: Fileupload is not working

Hi,

onclick="Button2_Click" only works if you have AutoEventWireup="true" in the .aspx or .ascx file.

If it is false there then you need to remove the declaration on the control and wire it from the OnInit in code behind

Button2.Click += new EventHandler(Button2);

Hope that helps,

Joe

You must sign in to post in the forums. This thread is closed to new posts.