How do I restore a pages data when it is posted from another page.


For the life of me I can't figure this out and it should not be so hard to understand !

I have two pages in my application.

On page 1 I have a gridview which display bound objectdata source data.

When someone decides to edit a row in the gridview they are taken to another page via a link with a datasource key.

What I would like to know is if I place a button on page2 that points to Page1 how and in which event do I save the loaded

gridview ?

I tried saving just the Objectdatasource filter in the page unloading and then restoring it to the ODS and rebinding during the postback.

This didn't work.

I also tried setting the cache property on the ODS.

Didn't work

View state is enabled on my ODS too.

So can you go from one page to another and then return to a prior page and have it look just like it did when you were there initially ?


GMann - Totally confused !



5/4/2009 8:34:57 PM 8807 articles. 0 followers. Follow

2 Replies

Similar Articles

[PageSpeed] 10
Get it on Google Play
Get it on Apple App Store


Some additional thoughts.

This probably is considered crosspage posting.

I tried setting the PostBackURL on by URL button on page 2 and then adding the @output directive on page 1.

But then my gridview selection, which I change through a DDL gets hijacked by the cache duration value.

SO is another way to solve this ?




5/4/2009 11:35:22 PM
If you modify the data on Page2 and you have a button that directs the user back to Page1, you could just DataBind the GridView in the page load event for Page1.  So if anything is changed by the user on Page2, those changes will be displayed in the GridView control.

Malcolm Sheridan
Microsoft Certified Solution Developer
Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as
Answer" if a marked post does not actually answer your question.
5/5/2009 12:18:34 AM

Similar Artilces:

POST to page returns another page (to POST to)
Hello! I am using LWP to post to a web page. The post works fine, but the $response the comes back contains the HTML of _another_ page that I have to POST to. This is where I get stuck. Normally when I $agent->request( POST $url [...] ) I know the $url. In this case I don't have a url -- I have a $response with some html inside of it. How do I POST to this new page? (I tried using HTML::Form as well, using the HTML::Form->parse( $content, $uri ) mechanism, but this simply posted to the original page I POST'ed to). Source and headers given below. Tha...

Paging Paging Paging
I am trying to do paging with my search results and it isnt working very well. Here is what I've tried and I feel I've tried everything, lol, please help me out. Sub DataGrid1_SortCommand(Sender as object, e as DataGridSortCOmmandEventArgs) DataGrid1.DataBind() End Sub Sub Datagrid1_PageIndexChanged(Sender as object, e as DataGridPageChangedEventArgs) Dim ds as dataSet DataGrid1.CurrentPageIndex = e.NewPageIndex if Session("Search") is nothing then 'Session probably has expired, get the datasource from database Datagrid1.DataSource = ...

Can we reserver view state when page is post back from another page
When a page is post back by itself, the view state will automatically be saved and read. But is the page is post to another page, and then call back by that page, can we reserve the state ?  ad_flying wrote: When a page is post back by itself, the view state will automatically be saved and read. But is the page is post to another page, and then call back by that page, can we reserve the state ? I don't think so, whats the purpose for that?Richard XinMCAD(charter member),MCDBA,MCSDWeb Site: (For ASP.Net tips and Code snippet) I have seen this implementation a...

How to post data from gridview on one page to detailview on another page when select is used
I need to get data from gridview on one page to detailview on other page when I use select statement.I am able to do this on same page by using following code but not able to do this on different pageprotected void GridView1_SelectedIndexChanged(object sender, EventArgs e)    {        DetailsView1.PageIndex = GridView1.SelectedIndex;    } Is it possible that when I use select in gridview on a particular page then only that row data appear on detail view of another page. please let me know asap. Find the Best Webhosts ...

Having Problem in Posting Value from a Content Page to another Content Page within a Same Master Page
Hello, I have a Master Page which contains two Content pages named: Default.aspx and Default2.aspx. I want to post a TextBox1 value (in Default.aspx) to Default2.aspx in the Master Pages and all my pages are in ContentPlaceHolder, but it is not working.   Is there Any kind of help?  Hi,you can pass value between two web forms by Query string, session  or by using cookieFor query string  refer : save session in default.aspx Session("t1")=text1.text retrieve session astext2.text = session(&quo...

show the data of current page compleatly and ,then after few second I want to Redirect the page to another page
I want to load a page first after that I have to tranfer control to another page only after wating/passing few seconds. So I tried the following and failed Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LoadComplete showDataOfCurrentPage() Dim sleepT As Int64 = 100000 Threading.Thread.Sleep(sleepT) Response.Redirect("URL")) End Sub I failed because I wrote the sleep code in Page_Load So I tried it ny writing it on Page_LoadComplete That too failed . So in short i want to show the data of current page com...

Transfer data from page to another page
I have a .aspx page (we'll call it Form1) with adatagrid on it. The datagrid is populated from a datasetthat I manually entered data into (the data isn't in adatabase). The datagrid on Form1 has a checkbox. when i click checkbox the row is selected so the selected row should be displayed in the form2 a grid.when i check the grid it should go back to the grid in the parent page   I have another .aspx page (Form2) with anunpopulated datagrid on it. I want to populate it withall the columns from the select click of the checkbox row . I just don't know how to pas...

How to determine whether data is coming from previous page or withing the current page in Cross Page Posting?
Hi everyone,My problem is:I'm using a DataGrid in (page2.aspx) to display the search result for which I'm collecting all the search criteria from previous page(page1.aspx). Till now the task is easy. But in the second page(page2.aspx) there are some other buttons and when I'm trying to invoke methods of those button controls of page2.aspx  an error is displaying i.e. "Object reference not set to an instance of an object" and it is pointing to the code where I'm collecting data from page1.aspx. Also I'm using Masterpage concept. How to separate codes fo...

how to call the data from one page the another page
i would like to call some particular record from one column of gridview from one page1 to another new page,for example:price column in page one,i would like to display the price column value in page2.any idea? Hello,   You can pass values from a gridview to another page using a hyperlink field for that particular column. Within the hyperlink control there is a value you can set in DataNavigateUrlFormatString.  I can remember the make up of the what u enter but search for that and there be loads of pages explaining.   Hope this helps. Kevin   i don really u...

How to force a page to post back from another page?
Hi every one,I have a problem with acouple of solutions in mind but I didn't succeed in any of them, so any help would be highly appreciated  I have a long TreeView that I want it to scroll alone as one control and the rest of the page will stay without scrolling, I couldn't do it so I used a<frameset> in an htm page where the TreeView is in a single frame alone, now when the other page post back I need the page that contains the TreeView to postback too. Any suggestions??Thank You very much Have you tried enclosing the Treeview in a div and setting it's overflow style p...

data pass from one page to another page
 Hi,If i have a 3/4 pages and i want to pass the values of the forms and at last i save the data of the forms. Let , my each page contains about 10 values, and user can go previous page to edit. Finally, all the data of the forms are saved. I know Session , but which is the best practice for this?Thanks.. naqibdotNet Coder You have the answer: Session. You can do this: Session["data1"] = data1value; Session["data2"] = data2value; And on the page where it is needed, go: decimal price = (decimal)Session["price"]; The casting is necessary. Store each f...

how to transfer data one page to another page
hi. anyone help me, how to transfer data my page to another url page  using post method in with c# check out the link > Transferring page values to another pageyou will find various techniques to transfer data from one page to another page using Cookies, QueryString, Session, Application etc., using Server.Transfer / Response.Redirect...hope it helps./. Thanx, [KaushaL] || BloG || Profile || Microsoft MVP"I would love to change the world, but they won’t give me the source code"Don't forget to click "Mark as Answer" on the post that helped ...

How to include another .NET page in your current page ?
Hello, Very simple question how do you include another .NET page in another ? Like say a include=test.aspx or something. I don't think it is possible and if it is, please someone show me some example code. What you can do is create user controls (*.ascx) and dynamically include them. On your page you can set a PlaceHolder control and in your code behind you could attach a user control to it PlaceHolderControlOnPage.Controls.Add(LoadControl("test.ascx")) Grz, Kris.Read my blog. Handy Firefox plugins for web developers.Workaround for non working Mark as answ...

Posting ASPX page to another ASPX page
Hello ; if i want to post my data from my server to thrid party (payment gatway) , how can i post my from and data  to payment gateway page . As we know ASPX doesn't post to another aspx , it just posts to itself , i read many articles they do this by scripts run at server but i need to post my data and page without anyscript  ? So my question is how can i post form (ASPX) without using scripts to to utilize Session State .?     If you want to post your data to another page, use the Response.Redirect(str url). If you want to transfer all the data on you...

Web resources about - How do I restore a pages data when it is posted from another page. -

Rally to Restore Sanity and/or Fear - Wikipedia, the free encyclopedia
... rallies in 20 or more U.S. cities including Austin, Texas ; Los Angeles ; Chicago ; Denver ; Honolulu and Boise, Idaho The Rally to Restore ...

Facebook Restores Ad Targeting of Users 65+
Facebook appears to have restored the ability for advertisers to target users aged 65 and over. (more…) New Career Opportunities Daily: The ...

M1 - Our Engineers are working flat out to restore the... - Facebook
Our Engineers are working flat out to restore the network. This complex restoration work involves loading the configuration for each base station ...

Restore the Gulf (@1restorethegulf) on Twitter
Sign in Sign up To bring you Twitter, we and our partners use cookies on our and other websites. Cookies help personalize Twitter content, tailor ...

Weibo Contact-Support Sina Weibo Avatar import ,backup and restore Contacts,number attribution tracking,smart ...
Get Weibo Contact-Support Sina Weibo Avatar import ,backup and restore Contacts,number attribution tracking,smart match. It is the best addressbook ...

10/30/10, Jon Stewart, Rally To Restore Sanity and/or Fear IV - Flickr - Photo Sharing!
Rally To Restore Sanity and/or Fear, Jon Stewart, Stephen Colbert, The Daily Show, The Colbert Report, Rally To Restore Sanity, March To Keep ...

Restore My Vision Today Review - REAL TRUTH - YouTube
Get Restore My Vision Today Here : Restore My Vision Today is a program designed by Dr. Sen and ...

Chelsea looking to restore 8-point lead
Second-placed Manchester City will be without influential midfielder Yaya Toure as they try to close the gap on Premier League leaders Chelsea. ...

Thailand's Army Declares Martial Law To 'Restore Peace And Order'
Thailand's army on Tuesday declared martial law... Thailand's army on Tuesday declared martial law across the crisis-gripped kingdom to restore ...

Resources last updated: 12/23/2015 10:30:06 AM