Save Page Position (vertical Scroll In Browser) After Clicking Button Or Some Other Action
Feb 26, 2010
Can I save a page position in browser after clicking button or some other actions (after PostBack)
I need it on Page Change event in my DBGrid like on msdn.microsoft.com - when I change Tab C# -> C++ for example it doesn't refresh whole page and I still being on same position in browser.
Is there any way to stop Gridview to turn back to first row when user click edit link button. Say there are 50 rows in gridview, user scrolled down to 45th row then click edit button. Gridview shifted to editmode but user need to roll down back again to reach the row 45th.
My page scrolls down a bit, so the problem is when the ASP.NET validation kicks in (its a server side validation that sets a table row to visible if there was a failed validation for a given input box).The problem is, when there is an error, the page scrolls back to the top.How can I force the page to the bottom? can use <a name="asdf"></name> but the page doesn't refresh normally since its a asp.net image button.
In a page hving some textboxes and dropdownlists with every control having server side validation controls.On selecting a dropdown all the validation controls are disappear and on clicking the save button the page remains idle.
In the page there are two links. When i click the first link it opens a window in a new page. I do this by using the above code.
I am clicking the second link in the page and navigating to another page. Now i am clicking the browser back button. Supprisingly its opening the first link.
How clicking back button is opening the link in the page. I am using c# .net 2005.
I want to maintain the scroll position of a page. So I try to get the page cordinates and set the position on the page load (actually I've a postback in my page) using JS as follows. What I've done is on a client click on an image get the page cordinates and keep in a hidden field.
[Code]....
GetScollerPosition function invoke in an image click event. But it's not work as I expected, the SetScrollPostion always find the value of hidden fields as zero.
I am trying to use an anchor tag to automatically scroll down to "position1" when the page loads.
I have created this name tag in the .aspx page and then trying to redirect to that tag in the page_load event but this results in that the page doesn´t load at all and cant be seen in the browser:
I have some collapse able anhcor link tags on a page that reveal some text when clicked on i.e.: [+] Topic This is all done in javascript client side. I would like to maintain the users scroll position on the page when these links are clicked on. They dont cause a postback as iv mentioned above its client side javascript.
i am using asp.net 4.0 iis 7.5 microsoft visual studio 2010
what i want is keep whole page (browser) scroll position (not a div or panel) when asynchronous postback happened (update panel) how can i do this actually i had a function which can keep div scroll bar position after postback like this
<script type="text/javascript"> var xPos, yPos; var prm = Sys.WebForms.PageRequestManager.getInstance(); prm.add_beginRequest(BeginRequestHandler); prm.add_endRequest(EndRequestHandler); function BeginRequestHandler(sender, args) { xPos = document.getElementById('Main').scrollLeft; yPos = document.getElementById('Main').scrollTop; } function EndRequestHandler(sender, args) { document.getElementById('Main').scrollLeft = xPos; document.getElementById('Main').scrollTop = yPos; } </script>
bu i could not find browser scroll bar id to get its values to get with document.getElementById
I have serveral long ASP.Net pages, I use RequiredFieldValidator, RegularExpressionValidator and ValidatorCalloutExtender for validations, Submit buttons are typically at the bottom of the pages. The problem I have: if the errors happen at the top portion of the page when Submit buttons are clicked, the forms do not scroll to the top automatically, the users have to scroll up to see the ValidatorCalloutExtender.
I use pagination for my datalist according to this link [URL].....
this is style of pagination
First 1,2,3,4,5 Last
when i run web site i see my datalist with pagination in webpage my datalist is middle of page when i click on page number 2 or 3 to see other page of datalist it reload page and go to top of page i should scroll until I can see my datalist again.
i want when users click on page number after that they see other page of datalist directly not top of page ..
i have validation controls in my form. i have save and exit button in the form and side menus in the page...
i set property" causevalidation=false" to all the side menu controls and exit button....
so when i press side menu or exit button no validation fires...but the problem comes here... if the user accidently pressed save button(which already caused validation), and now he want to exit from the form and user dun wanna enter any details in the form.in that case i cudnt leave from the form coz of validation
My webapplication starts a new session at a point, where there is no reason.For the moment I even don't know, which part of code I should post.Clicking a button in the browser on the app, everything is ok for the first time.Clicking it a second time, the new session begins.
What could be the reason for this behavior? Perhaps after an answer I can better determine, what lines of code I need to show you.
I was finally able to expire a page in both Firefox 3 and IE7, so that when the user clicks on "Back", I'll either get a message from the browser saying that it needs to connect to the server to reload the page (FF3), or simply display the "Webpage has expired" message (IE7). So both browsers retrieve it from the server.
Unfortunately, it will refresh the last copy the browser has in the cache. In my case, the last copy displays a ton of data that does not exist anymore since the process' lifecycle was already completed. I need the browser to display the webform as if it the user went there for the first time.
I believe that for all purposes, clicking "Resend" in Firefox (when hitting "Back") is the same as pressing F5 in IE7 when the "Webpage has expired" page is displayed, which is basically a page postback.
I've got a site that uses an Accordion, it has AutoSize="Limit" and the height is set to 600, however, when rendered, the Accordion div style is set to:"overflow-x: auto; height: 600px; overflow: hidden;"Does anyone know why this is the case? My understanding is that an AutoSize value of Limit should render style of "overflow-y: auto;" if not "overflow: auto;"?I tried setting the width to see if that makes any difference, but it still has "overflow: hidden".At the moment I have a work around which places the Accordion (with AutoSize="None") in a div with a style of "height: 420px; width: 750px; overflow: auto;", but I'm surprised that this issue exists and would prefer if I didn't have to use this work around.
But it doesnt display any scrolling images. I am using .net 4.0 Tried setting menuAccountMembers.RenderingCompatibility = new Version(3, 5); as well. If there a property to only display the first 5 root menu items, then show scroll bars for the rest? It can be click-able, no need to hover over to show next item.
I don't think this is possible at all, but does anyone know a way to get 2 vertical scroll bars on a panel? Right now here's the code:
[code]....
There's a GridView inside the panel and it's so wide that scrolling all the way over to the right to scroll down causes the client to lose their position on the page and would like a scrollbar provided on the left (keeping the one on the right) if it's possible, anyone know of a way to do that?
I would like to create an animation effect in order to have a vertical scroll of my images, the scroll must have a pause from an image to another. I have started with this, but I have some problems:
[Code]....
1. how center my image exactly in the div? Actually it is "near" it but not "in" it!
2. When the image move up it moves in the window OVER the div, not inside (so it doesen't disappeare when move up)
3. how realize the start-stop-start moving of the effect? Actually it begin at the load event of the page and then finish!