ASPNET GridView and page question

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
 
M

Masudur

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
 
M

marss

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
 
M

Masudur


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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,705
Latest member
Stefkari24

Latest Threads

Top