I am trying to call a public function inside a public class in my web application but for some reason the function is not accessible even though I can get to the class fine and the function is marked as public. When I call FileUploader
, the only options I am given are equals and referanceequals. What stupid thing am I over looking? Please not that the class is in a secondary project called Classes in my app. I do not have problems accessing a difference class in the project that FileUploader
is in.
using System;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Auth;
using Microsoft.WindowsAzure.Storage.Blob;
using Microsoft.WindowsAzure;
using System.IO;
using System.Configuration;
using FFInfo.Classes;
namespace FFInfo
{
public partial class FUTest : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
if (fuFile.HasFile)
{
}
}
}
}
FileUploaders.cs
using FFInfo.DAL;
using FFInfo.DAL.Tables;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Blob;
using System;
using System.Web;
namespace FFInfo.Classes
{
public class FileUploader
{
public Int64 UploadSiteImage(string ConnectionString, string ContainerName, string FilePath, HttpPostedFile UploadedFile)
{
CloudStorageAccount SiteImages = CloudStorageAccount.Parse(ConnectionString);
CloudBlobClient SiteImagesBlob = SiteImages.CreateCloudBlobClient();
CloudBlobContainer SiteImageContainer = SiteImagesBlob.GetContainerReference(ContainerName);
SiteImageContainer.CreateIfNotExists();
CloudBlockBlob Image = SiteImageContainer.GetBlockBlobReference(FilePath + UploadedFile.FileName);
using (UploadedFile.InputStream)
{
Image.UploadFromStream(UploadedFile.InputStream);
}
using (var db = new Compleate())
{
File NewFile = new File()
{
ContainerName = ContainerName,
FilePath = FilePath,
FileName = UploadedFile.FileName,
ContentType = UploadedFile.ContentType
};
db.Files.Add(NewFile);
db.SaveChanges();
return NewFile.FileID;
}
}
}
}