Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

set selected index of gridview on load

1 view
Skip to first unread message

WebBuilder451

unread,
May 2, 2008, 5:10:00 PM5/2/08
to
I have the datakey for the gridview passed to the page using cross postback.
How can i set the selected index of the page using this value, but only on
load where a previous page (cross post back) exists?
--
(i''ll be asking a lot of these, but I find C# totally way cooler than vb
and there''s no go''n back!!!)
thanks (as always)

kes

Teemu Keiski

unread,
May 3, 2008, 8:12:58 AM5/3/08
to
Hi,

you can check for cross-page postback on the target page by checking
PreviousPage property for null reference. I've blogged about that at:
http://aspadvice.com/blogs/joteke/archive/2007/07/12/ASP.NET-cross_2D00_page-postbacks_3A00_-PreviousPage-and-PreviousPage.IsCrossPagePostBack.aspx

So basically in Page_Load of your target page, check with previous technique
if you're in cross-page post and if you are then just set the property .

--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net

"WebBuilder451" <WebBui...@discussions.microsoft.com> wrote in message
news:378D8AF4-5C83-4B1C...@microsoft.com...

0 new messages