Solved

Refreshing page

Posted on 2013-06-27
4
264 Views
Last Modified: 2013-06-30
Hi,

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


Thanks
0
Comment
Question by:ayha1999
  • 2
4 Comments
 
LVL 11

Expert Comment

by:mcnute
ID: 39283613
isn't there missing something in your code? Please post your entire code.
0
 
LVL 7

Author Comment

by:ayha1999
ID: 39283633
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.
0
 
LVL 12

Accepted Solution

by:
jitendra patil earned 500 total points
ID: 39288068
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.
0
 
LVL 7

Author Closing Comment

by:ayha1999
ID: 39288387
Thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Angular- another way of coding hide and display 3 38
Syntax error 9 45
Error in query expression 3 35
Enter key on html form page 11 46
Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now