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

  • Home
  • SEARCH
  • 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 8910553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:43:03+00:00 2026-06-15T03:43:03+00:00

I have a gridView to show up document (.PDF) list and a LinkButton to

  • 0

I have a gridView to show up document (.PDF) list and a LinkButton to download/read document.

LinkButton:

<ItemTemplate>
     <asp:LinkButton ID="lbDocTitle" runat="server" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "ID") %>' Text='<%# DataBinder.Eval(Container.DataItem, "Content") %>' OnClick="lbDocTitle_Click"></asp:LinkButton>
</ItemTemplate>

lbDocTitle_click

protected void lbDocTitle_Click(object sender, EventArgs e)
        {
            LinkButton btn = (sender as LinkButton);

            int docID = Convert.ToInt32(btn.CommandArgument);
            //get fileName from docID here...

            ReadPdfFile(fileName);

        }


private void ReadPdfFile(string fName)
        {

            WebClient client = new WebClient();
            Byte[] buffer = client.DownloadData(fName);

            if (buffer != null)
            {
                Response.ContentType = "application/pdf";
                Response.AddHeader("content-length", buffer.Length.ToString());
                Response.BinaryWrite(buffer);
            }
        }

All the code above are worked perfect.

Next I make some improvements: add a loadding screen while codes are executed on server

<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

<asp:UpdatePanel ID="updatePanel" runat="server">
<ContentTemplate>
    <asp:GridView ...> <!-- move gridview here -->
</ContentTemplate>
</UpdatePanel>


<asp:UpdatePanelAnimationExtender ID="upae" BehaviorID="animation" runat="server" TargetControlID="updatePanel">
                <Animations>
                    <OnUpdating>
                        <Parallel duration="0">
                            <ScriptAction Script="onUpdating();" />  
                         </Parallel>
                    </OnUpdating>
                    <OnUpdated>
                        <Parallel duration="0">
                            <ScriptAction Script="onUpdated();" /> 
                        </Parallel> 
                    </OnUpdated>
                </Animations>
            </asp:UpdatePanelAnimationExtender>

JavScript :

function onUpdating() {
    $('#loadingBox-holder').show();
    $('#loadingBox').show();
}

function onUpdated(x) {
    $('#loadingBox-holder').hide();
    $('#loadingBox').hide();
}  

After improvement, when clicking on LinkButton lblDocTitle the loadding screen show up and still loading loading loading… and loading forever.

I don’t know why and how to fix that bug hope some help ?

Thanks !

  • 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-15T03:43:05+00:00Added an answer on June 15, 2026 at 3:43 am

    OK I fix that error. Just use other ASPX page to handle download file. UpdatePanel can not response other output except HTML 😀

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a asp.net gridview where I hide and show columns using 'onclick' on
I have a Gridview with a list of Items. I want to show the
Have a gridview control which will show X amount of rows. I want to
I have a requirement that I need to show my records in a gridview
In my activity i have to show some images. I used gridview in my
I have GridView and this grid has setup paging, but this paging not show
I have gridview in my asp.net page which is bound to sqldatasource. when i
I have created a database using visual studio and a gridview to show the
I have a gridview bound to a sql server datasource. I am currently moving
I have a GridView in ASP.net which is filled from an SqlDataSource. one of

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.