Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Using ASP.NET 2.0 how to refresh a GridView when a second page triggers some event

Posted on 2009-04-10
4
Medium Priority
?
216 Views
Last Modified: 2012-06-22
Hi, I need to develop a small program that allows the user to create a backorder of items. I would like to use GridView for showing the items as they can be as many as they like.

Every item can have one product code and the user should lookup into a stored procedure to let him chose the item after a filtering process as we have thousands of record of items and I need to show the results paged.

Now, my question since I am really newbie to asp.net is, which should be the fastest way to this approach. I think opening a second page where the user could select the item would do, but then how should I refresh my Gridview when the second page is closed?

Any advice would do. Thank you.
0
Comment
Question by:osmendez
  • 2
4 Comments
 
LVL 8

Accepted Solution

by:
Haris V earned 2000 total points
ID: 24119007
0
 

Author Comment

by:osmendez
ID: 24119248
Thank you Sirah, I just figured it out with your first link.
0
 

Expert Comment

by:samgiuoco
ID: 24119286
You could store a datatable for these backorder items in a Session variable.

Datatable tblBackorder = new Datatable();
... set up the table...
   Session["backorder"] = tblBackorder;


Then you could navigate to other pages to browse items and add rows to the table.

Datatable tblBackorder = (Datatable)Session["backorder"];
... add items ...
 Session["backorder"] = tblBackorder;

Then go back to your Grid page, get the table from Session and databind it.
The items you were browsing on other pages will appear even if the page was in a new window.
If it is in a seperate window, however, you need to address the added complication of refreshing the Grid page.
0
 

Author Comment

by:osmendez
ID: 24120533
Thanks for your prompt answer Samqiuoco, at the end I dediced to leave both Grids on the same page. It was a pain in the ass for me to fire the DataBind() method from a child window.

I'm sure this is possible but I don't have any clue on how to do it. Anyway, you session variable holding the datatable is great!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
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)

916 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