473,387 Members | 1,453 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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
Nov 15 '05 #1
0 1994

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Josema | last post by:
Hi, I have in a database models of cars, CarID int CarName varchar CarFeatures varchar CarImage binary I have a class Car that have the properties:
2
by: Coder Coder | last post by:
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...
0
by: VB Programmer | last post by:
I have 2 webforms. When I print out the page.Controls(1).tostring variable one says "HtmlForm", the other "HtmlGenericControl". How can I change the first one to "HtmlForm"? ?...
2
by: Ralph Krausse | last post by:
I am updating a span tag with the title of my expanded node (a 3rd party control).text that I wish to get later in my codebehind file. my tag in my html <span class="hint" runat="server"...
4
by: qualitynice | last post by:
HELP :-)... I'm creating an embedded activex object in an asp.net page using the HtmlGenericControl class. I'm doing this because when I tried to embed it directly in the aspx page, it stopped...
8
by: Randall Parker | last post by:
I want to generate an HTML tag that will look like: <a href="EquipmentServiceCreate.aspx?serial=X01">Create New Service For X01</a> or on a different instance where the user would be viewing...
2
by: Rik Brooks | last post by:
I have a web page that has a placeholder on it called PlaceHolderText. I read some html out of the database. The value for my test is: this is <strong>a test </strongof the html stuff I read...
0
by: papillonhn | last post by:
Please help me. In my HtmlGenericControl object has: an image and a string. Is there anyway to determine or calculate the width of HtmlGenericControl. I need to display this HtmlGenericControl...
2
by: swathi amireddy | last post by:
Hi Experts, //BodyID Defined as in other page where method ControlWebPage(HtmlGenericControl BodyID) in OnInit method protected System.Web.UI.HtmlControls.HtmlGenericControl BodyID; ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.