ASPNET GridView and page question

  • Thread starter Thread starter Jason Huang
  • Start date Start date
J

Jason Huang

Hi,

In my ASPNET 2.0 web form WebForm1.aspx, I have a GridView GridView1 and
some other controls in front of the GridView1.
There are CheckBoxes on the GridView1 also.
My question is when I check the 20th row of GridView1's CheckBox, the
WebForm1 will autopostback, and the web page will go to top of the page, I
need to drag the scrollbar down or hit the PageDown so I will go the 20th
row.
That seems not convenient for users.
How do I fix that situation? Thanks for help.


Jason
 
Hi,

In my ASPNET 2.0 web form WebForm1.aspx, I have a GridView GridView1 and
some other controls in front of the GridView1.
There are CheckBoxes on the GridView1 also.
My question is when I check the 20th row of GridView1's CheckBox, the
WebForm1 will autopostback, and the web page will go to top of the page, I
need to drag the scrollbar down or hit the PageDown so I will go the 20th
row.
That seems not convenient for users.
How do I fix that situation? Thanks for help.

Jason

Hi Jason......
since you are using asp.net 2.0....
you got a easy way to accomplish the job...
just set your page's

MaintainScrollPositionOnPostback property to true...

<%@ Page Language="C#" AutoEventWireup="true"
Codebehind="Login.aspx.cs" Inherits="KazBitoron.Login"
MasterPageFile="~/Kazbitoron.Master"
MaintainScrollPositionOnPostback="true" %>

Just like this....

Thanks
Md. Masudur Rahman (Munna)
kaz Software Ltd.
www.kaz.com.bd
http://munnacs.110mb.com
 
Jason said:
Hi,

In my ASPNET 2.0 web form WebForm1.aspx, I have a GridView GridView1 and
some other controls in front of the GridView1.
There are CheckBoxes on the GridView1 also.
My question is when I check the 20th row of GridView1's CheckBox, the
WebForm1 will autopostback, and the web page will go to top of the page, I
need to drag the scrollbar down or hit the PageDown so I will go the 20th
row.
That seems not convenient for users.
How do I fix that situation? Thanks for help.


Jason

Read here:
http://msdn2.microsoft.com/en-us/library/system.web.ui.page.smartnavigation(vs.80).aspx

Regards,
Mykola
http://marss.co.ua
 

Hi...

"
Version Information
..NET Framework
Supported in: 1.0, 1.1
Obsolete (compiler warning) in 2.0"

in asp.net 2.0 smartnavigation is obsolete...

maintainscrollpositiononpostback is new in asp.net 2.0

http://msdn2.microsoft.com/en-us/li....maintainscrollpositiononpostback(VS.80).aspx


Thanks
Md. Masudur Rahman (Munna)
kaz Software Ltd.
www.kaz.com.bd
http://munnacs.110mb.com
 
Back
Top