Ask a Question related to ASP.NET General, Design and Development.
-
Coder Coder #1
C# HtmlGenericControl
Hi.
I have an aspx page which has a datagrid sitting inside of DIV tags.
The users can now scroll down to look at the all the items in the
datagrid.
The only problem is that when a selection is made and the page is
reloaded the scrollbar of the DIV tag goes back up to the top. So the
user has to scroll back down again to see the previous selection.
I have tried SmartNavigation but that didnt do the trick.
I have used:
Control cont = null;
cont = Page.FindControl ("mydiv");
if (cont == null)
{
alert.Text = "control not found";
}
else
{
alert.Text = "control found";
}
mydiv = (HtmlGenericControl) cont;
This tells me that the control was FOUND so, I then do the
following:
int newLocation = DataGrid.SelectedIndex * 20;
mydiv.Attributes.Add ("scrollTop", newLocation);
However the scroll bars of the DIV dont move.
In javascript if you do the following:
var sp = document.getElementById('mydiv');
sp.scrollTop = 150;
It moves the scrolls.
But I need to do it in the code behind to see which index was
selected.
- Thanks
Coder Coder Guest
-
Natty Gur #2
Re: C# HtmlGenericControl
Hi,
Consider using scrollintoview DHTML method. You can embed it into the
html using RegisterStartupScript.
http://msdn.microsoft.com/library/de...p/author/dhtml
/reference/methods/scrollintoview.asp
Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114
Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377
Know the overall picture
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Natty Gur Guest
-
Natty Gur #3
Re: C# HtmlGenericControl
Hi,
Consider using scrollintoview DHTML method. You can embed it into the
html using RegisterStartupScript.
http://msdn.microsoft.com/library/de...p/author/dhtml
/reference/methods/scrollintoview.asp
Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114
Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377
Know the overall picture
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Natty Gur Guest



Reply With Quote

