DevExpress ASPxUploadControl - I need some help

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.
5/17/2011 10:31:28 AM
Gravatar
Total Posts 7

DevExpress ASPxUploadControl - I need some help

Hello Everyone,

I am having trouble getting the DevExpress ASPxUploadControl to work within Mojoportal.

I have the DevExpress controls registered within the web.config, all of the DLLs within the Bin folder of the main mojoportal\web folder.

Here is the code from within the page:

<portal:mojoPanel ID="MojoPanel1" runat="server" ArtisteerCssClass="art-PostContent">

  <dx:ASPxUploadControl ID="uploadedFile" runat="server"
    onfileuploadcomplete="UploadControl_FileUploadComplete"
    ShowAddRemoveButtons="True" ShowProgressPanel="True" ShowUploadButton="True"
    ClientIDMode="AutoID">
                <ClientSideEvents FileUploadComplete="function(s, e) {
FileUploaded(s, e)
}" />
                </dx:ASPxUploadControl>

</portal:mojoPanel>

Here is the code from the MBUpload .js file

// <![CDATA[
function FileUploaded(s, e) {
  if (e.isValid) {
    alert(e.callbackData);
  }
}
// ]]>

Here is the code that is within the code behind:

protected void Page_Load(object sender, EventArgs e)
        {

          Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "FileUploadScript", "\n<script type=\"text/javascript\" src=\"" + Page.ResolveUrl("~/MBUploadTest/MBUpload.js") + "\" ></script>");

        }

protected void UploadControl_FileUploadComplete(object sender,  FileUploadCompleteEventArgs e)
        {
          try
          {
            e.CallbackData = SavePostedFiles(e.UploadedFile);
          }
          catch (Exception ex)
          {
            e.IsValid = false;
            e.ErrorText = ex.Message;
          }
        }

        string SavePostedFiles(UploadedFile uploadedFile)
        {
          if (!uploadedFile.IsValid)
            return string.Empty;

          FileInfo fileInfo = new FileInfo(uploadedFile.FileName);
          string resFileName = "C:\\temp\\" + fileInfo.Name;
          uploadedFile.SaveAs(resFileName);
          return fileInfo.Name;
        }

During my testing I've put a break point at the "e.CallbackData" line and it doesn't break at all.

Has anyone had any luck getting the DevExpress ASPxUploadControl working within Mojoportal?

5/20/2011 1:00:28 PM
Gravatar
Total Posts 245
mojoPortal Community Expert

Re: DevExpress ASPxUploadControl - I need some help

Hi

I have never tried using the ASPxUploadControl from DevExpress so can not be of direct help.

However...  I mostly use Telerik Web Controls with mojoPortal and seem to remember that when I had trouble with their Upload Control not working. The solution to getting mine to work was...

In the mojoPortal skin I was using, I had to replace the standard ScriptManager and use the Telerik ScriptManager.

In the skin Layout.Master file Replace
<asp:ScriptManager ID="ScriptManager1"..................
With
<telerik:RadScriptManager ID="RadScriptManager1"..................

That's my hunch.  Hope it works.

Rick

 

5/20/2011 2:50:54 PM
Gravatar
Total Posts 7

Re: DevExpress ASPxUploadControl - I need some help

Hello Rick,

I'll take a look and see if the DevExpress Script manager will do the trick.

Thanks again.

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