Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9164817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:46:17+00:00 2026-06-17T14:46:17+00:00

Based on dropdown i’m getting value and need to use for ajax file upload,

  • 0

Based on dropdown i’m getting value and need to use for ajax file upload, now the problem is that i’m getting value properly, i’m using two ajax file upload(ajaxUpload1_OnUploadComplete & ajaxUpload2_OnUploadComplete), whenever i click the upload control for uploading files from the both the control goes to one upload method(ajaxUpload1_OnUploadComplete) only for uploading files. I need a solution for this. Thanks in advance.

In .cs

protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {

        Session["Value"] = DropDownList1.SelectedItem.Text;
    }

protected void ajaxUpload1_OnUploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e)
    {
        String value = Session["Value"].ToString();
    }

 protected void ajaxUpload2_OnUploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e)
    {
        String value1 = Session["Value"].ToString();
    }

In .aspx

 <asp:AjaxFileUpload ID="AjaxFileUpload1" AllowedFileTypes="jpg,jpeg" MaximumNumberOfFiles="10" ThrobberID="1" ContextKeys="1"  OnUploadComplete="ajaxUpload1_OnUploadComplete" runat="server"/>

 <asp:AjaxFileUpload ID="AjaxFileUpload2" AllowedFileTypes="jpg,jpeg"  ThrobberID="2"  MaximumNumberOfFiles="10" ContextKeys="2" OnUploadComplete="ajaxUpload2_OnUploadComplete" runat="server" />
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T14:46:18+00:00Added an answer on June 17, 2026 at 2:46 pm

    I think it a bug in the AjaxFileUpload I asked about this before and never got any reply except work a workaround here is the solution for this.

    private string ContextKey = "";
    public AjaxFileUpload()
                : base(true, HtmlTextWriterTag.Div)
            {
                if (HttpContext.Current.Items["lastAjaxFileUploadContextKey"] == null)
                {
                    HttpContext.Current.Items["lastAjaxFileUploadContextKey"] = 1;
                }
                else
                {
                    HttpContext.Current.Items["lastAjaxFileUploadContextKey"] = (int)HttpContext.Current.Items["lastAjaxFileUploadContextKey"] + 1;
                }
    
                ContextKey = HttpContext.Current.Items["lastAjaxFileUploadContextKey"].ToString();
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Well, based on dropdown value I need the values in my form to be
I'm tyring to use AJAX to populate a dropdown box based on the selection
I created this fiddle that the div value changes based on your dropdown list
I have a page that postbacks on a dropdown list selection (using AJAX update
I need to filter my list based on selected dropdown value. I've created a
I'm using the following code to cause a ul based dropdown menu to open,
I using dropkick js to style dropdown forms but have one little problem. What
I have a custom built ajax [div] based dynamic dropdown. I have an [input]
I have a user form that has dropdown boxes which i have populated using
I am using the Jquery based multi select dropdown provided by Eric Hynds. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.