How do I set the scrollbars in an ASP.net page dynamically? When a user comes to certain pages on my site I would like the page to be scrolled down about halfway. Is there a way to do this without using Javascript?
One standard HTML option is to set a target <a name="foo"></a>
on your page. Links to the page would need to be /yourpage.aspx#foo
, but that would cause the browser to scroll to the target.
asp.net is a server side technology so it is not possible to manage the scroll position without using javascript. At least I have not seen it done.
Sounds like you're looking for an anchor tag. You specify the URL as www.site.com/page.aspx#middle
Then in your page, you put the tag where you want them to scroll to
<a name="middle" />
Something you might be interested in that I've used successfully on projects before is the smartScroller. You can place this control on a web page and the web page will automatically remember the scroll position between postbacks and scroll there. Check it out: http://www.4guysfromrolla.com/articles/111704-1.aspx
It does use javascript though. Any reason in particular you don't want to use javascript?