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 6668607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:03:34+00:00 2026-05-26T03:03:34+00:00

i have a Handler.ashx in my project for showing save as dialog to my

  • 0

i have a Handler.ashx in my project for showing save as dialog to my users.
also i have a repeater with a link buttons inside for click and showing the upper save as dialog at last.
i put my repeater inside an update panel!
the codes of ItemCommand Of that repeater is like below :

   protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
        {
            //The Below Line Does Not Work - Always Is Null
            //NewAddedFiles currentItem = (NewAddedFiles)e.Item.DataItem;

            HiddenField hfFilePath = (HiddenField)e.Item.FindControl("hfFilePath");
            HiddenField hfFileName = (HiddenField)e.Item.FindControl("hfFileName");
            HiddenField hfFileSize = (HiddenField)e.Item.FindControl("hfFileSize");
            HiddenField hfFileCreationDate = (HiddenField)e.Item.FindControl("hfFileCreationDate");

            switch (e.CommandName)
            {
                case "lbFile_Click":
                    {
                        if (Session["User_ID"] != null)
                        {
                            DataSet dsDownload = DataLayer.Download.Size_By_UserID_Today(int.Parse(HttpContext.Current.Session["User_ID"].ToString()), DateTime.Now);
                            if (dsDownload.Tables["Download"].Rows.Count > 0)
                            {
                                DataRow drDownload = dsDownload.Tables["Download"].Rows[0];

                                int SumOfFileSize4Today = int.Parse(drDownload["FileSizSum"].ToString());

                                if (SumOfFileSize4Today + int.Parse(hfFileSize.Value) <= 1073741824)//1 GB = 1024*1024*1024 bytes = 1073741824 bytes
                                //if (SumOfFileSize4Today + int.Parse(hfFileSize.Value) <= 100000)
                                {
                                    DataLayer.Download.InsertRow(
                                               int.Parse(HttpContext.Current.Session["User_ID"].ToString()),
                                               DateTime.Now,
                                               hfFilePath.Value,
                                               hfFileName.Value,
                                               hfFileSize.Value,
                                               DateTime.Parse(hfFileCreationDate.Value)
                                             );
                                    Response.Redirect("~/HandlerForRepeater.ashx?path=" + hfFilePath.Value);
                                }
                                else
                                {
                                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "YouCanNotDownloadAnyMore_SizeOverload", "YouCanNotDownloadAnyMore_SizeOverload();", true);
                                }
                            }
                            else
                            {
                                if (int.Parse(hfFileSize.Value) <= 1073741824)
                                //if (int.Parse(hfFileSize.Value) <= 100000)
                                {
                                    DataLayer.Download.InsertRow(
                                               int.Parse(HttpContext.Current.Session["User_ID"].ToString()),
                                               DateTime.Now,
                                               hfFilePath.Value,
                                               hfFileName.Value,
                                               hfFileSize.Value,
                                               DateTime.Parse(hfFileCreationDate.Value)
                                             );
                                    Response.Redirect("~/HandlerForRepeater.ashx?path=" + hfFilePath.Value);
                                }
                                else
                                {
                                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "YouCanNotDownloadAnyMore_SizeOverload", "YouCanNotDownloadAnyMore_SizeOverload();", true);
                                }
                            }
                        }
                        else
                        {
                            ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "plzLoginFirst_ForDownload", "plzLoginFirst_ForDownload();", true);
                        }
                        break;
                    }

                default:
                    {
                        break;
                    }
            }
        }
    }

the important part of this code is :

 Response.Redirect("~/HandlerForRepeater.ashx?path=" + hfFilePath.Value);  

because of this line callback never ends and when save as dialog comes up , repeater area goes to thinkink mode and is disabled!

how can i fix this issue?

  • 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-05-26T03:03:35+00:00Added an answer on May 26, 2026 at 3:03 am

    I am not completely familiar with UpdatePanels but I think you have pretty much answered this yourself when you say the ‘callback never ends and when save as dialog comes up, repeater area goes to thinking mode and is disabled’.

    What is happening is you are not returning a page response to your request but instead making a request to the server from your page which is redirecting to your handler which I am guessing is responding with a file download. The page you requested from is now stale, if you want to carry on using this page you need to return it as the response instead.

    Two options you could consider are:

    1. Instead or redirecting to your handler let the response continue as normal and instead register a script to make a request to your handler asyncronously passing it the file path.
    2. Using jQuery call a web method asyncronously to handle this using the ajax method.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a project, i have on ashx handler file, I want
I have a function: window.onbeforeunload = function () { $.get(Handler.ashx, mode=saveuser&user= + $(#username).text(), function
I have written a small ASHX handler that uses a small state object that
I have an *.ashx (handler) with this code: public void ProcessRequest (HttpContext context) {
I have an ashx handler which takes the 'html' property from the request, then
I have an ASHX handler that I am using to display images that are
I have a generic handler Image.ashx that crops/resizes images on the fly by reading
In my asp.net application I have web service ~/service.asmx and generic handler ~/handler.ashx .
I have made a generic handler (.ashx) to fetch some database values using jquery
I have created an ashx handler to render image thumbnails from images in a

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.