I use ASP.NET and i need an easy way to upload a file asynchronously. So I tried to use asyncfileupload (Ajax control toolkit) but I also need to pass parameters to the server side. How can I do that ? thanks.
Here is my code :
on client side :
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
<asp:AsyncFileUpload ID="afuMedia" runat="server" UploaderStyle="Modern" OnUploadedComplete="afuMedia_UploadedComplete" />
on server side :
protected void afuMedia_UploadedComplete(object sender, AsyncFileUploadEventArgs e)
{
//int id = int.Parse(Request.QueryString["id"]);
string mediaPath = ConfigurationParameters.MediaPath;
string filePath = CurrentBrand.BrandCode + "\\" + CurrentCulture.CultureCode + "\\" + "highlights-" + id;
string physicalPath = Path.Combine(MapPath("~/" + mediaPath), filePath);
afuMedia.SaveAs(physicalPath);
}