Refreshing page


I am uploading files and adding details to database using the following control and code. Both are working fine but after data to appear in the grid view I need to refresh the page (F5). How can I display the data soon after upload and insert completed? BindFiles sub retrieves the data from the table and bind to the gridview.

        <cc1:AsyncFileUpload runat="server" ID="AsyncFileUpload1"
            Width="400px" UploaderStyle="Modern" CompleteBackColor="White" UploadingBackColor="#CCFFFF"
            ThrobberID="imgLoader" OnUploadedComplete="FileUploadComplete" />

  protected void FileUploadComplete(object sender, EventArgs e)
			cmd.ExecuteNonQuery ();
			bindFiles ();  

Open in new window

Who is Participating?
Jitendra PatilConnect With a Mentor Sr.Software EngineerCommented:
the code where you are inserting data in db after insertions of record just call the gridview
binding code again this will do the trick.

the will works for a less no of records, so be specific while firing sql queries for selecting records,as you are using asyn control so there may be possibilies of getting error from sql side.

hope this helps.
isn't there missing something in your code? Please post your entire code.
ayha1999Author Commented:
The page refreshed as expected when I used code on a button click event. But since I moved it to AjaxUpload event it is not refreshing anymore.
ayha1999Author Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.