开发者

getting some problem with gridview paging

开发者 https://www.devze.com 2023-02-18 09:00 出处:网络
I have two pages. In one page I have placed a GridView. In the grid I am using two hyperlinks for select and edit. When I click for the edit page I am redirected to another page. When I have finished

I have two pages.

In one page I have placed a GridView. In the grid I am using two hyperlinks for select and edit. When I click for the edit page I am redirected to another page. When I have finished editing the record it goes back to the first page.

The p开发者_JAVA技巧roblem is when I was on the 2nd or 3rd page of the GridView and then edited, it went back to first page, not the 2nd or 3rd page I was on.

I want the same page after I go back to the page I left. How can I go about this?


The problem is that the webpage needs to know what page to send you to. The way I do this is to pass a querystring parameter when I change pages.

So in the URL to the edit page you want to have the URL say (for example) http://server/edit.aspx?value=number&returnPage=2 and then when you go back to the grid page you'll pass the page value like http://server/grid.aspx?page=2

This way you'll always know what page to tell the GridView to goto. And it should be pretty easy to add in depending on your level of comfort with the Params object.


Response.Redirect("einward.aspx");

you have to redirect to the page, wtever page u want.

0

精彩评论

暂无评论...
验证码 换一张
取 消