bizzydint Posted June 23, 2003 Posted June 23, 2003 I'm sure this is a pretty basic thing but I'm having one of those slow days :) I want a basic anchor (<a name="mylink">) on the page, and when the page does a postback, to jump to that anchor. I've found a random tutorial for a similar thing but in a datagrid, so its a bit overly complicated. Anyone know of a quick fix? or a simpler tutorial? cheers my dears! van. Quote Grant me the serenity to accept the things I cannot change, the courage to change the things I cannot accept and the wisdom to hide the bodies of those people I had to kill today cos they pi**ed me off.
Moderators Robby Posted June 23, 2003 Moderators Posted June 23, 2003 Use a LinkButton and in the click event use Server.Transfer(). Quote Visit...Bassic Software
bizzydint Posted June 24, 2003 Author Posted June 24, 2003 sorry - completely lost by that! Had a look through the help files for linkbuttons and server.transfer but didnt help. You couldnt provide a *smidge* more detail for me, could you? thankyou muchly.... PS. the event causing a postback is the selection from a drop down list. I dont know if that makes a difference? Quote Grant me the serenity to accept the things I cannot change, the courage to change the things I cannot accept and the wisdom to hide the bodies of those people I had to kill today cos they pi**ed me off.
*Experts* mutant Posted June 24, 2003 *Experts* Posted June 24, 2003 You could check if the page is postback. If Page.IsPostBack then Server.Transfer("somepage") 'or Response.Redirect("somepage") end if Quote
bizzydint Posted June 24, 2003 Author Posted June 24, 2003 sounded good, but have tried and the problem is that I lose the information that the user has already given. Bit more detail to help you: The user gives their name & email addy and selects a region from a ddl - which causes postback, and populates another drop down. (which is the one I want the anchor near/on so the page jumps to it) so the response.redirect is reloading the page so i lose the user info and the next drop-down doesnt know that its meant to have been populated. sorry for not being clearer before. I assumed it was a simple thing and I was being slow! :) Quote Grant me the serenity to accept the things I cannot change, the courage to change the things I cannot accept and the wisdom to hide the bodies of those people I had to kill today cos they pi**ed me off.
*Gurus* Derek Stone Posted June 24, 2003 *Gurus* Posted June 24, 2003 <%@ Page SmartNavigation="True" %> Quote Posting Guidelines
bizzydint Posted August 5, 2003 Author Posted August 5, 2003 Finally got round to trying to fix this... using the smart navigation thing, tried to send the page to "http://localhost/IEsmartnav1" - which couldnt be found. do i need to do something special to be able to use the smart navigation thing? also, since it is "off" by default, what's the disadvantage of having it "on"??? cheers. van Quote Grant me the serenity to accept the things I cannot change, the courage to change the things I cannot accept and the wisdom to hide the bodies of those people I had to kill today cos they pi**ed me off.
*Gurus* Derek Stone Posted August 6, 2003 *Gurus* Posted August 6, 2003 Smart navigation only works when posting back to the same page. Its advantages/disadvantages are clearly stated in the .NET SDK: "Smart navigation is an ASP.NET feature that is supported in Internet Explorer 5.5 and later browsers. It allows a page to be refreshed while maintaining scroll position and element focus between navigations, causing only a single page to be stored in the browser's history, and without the common flicker associated with refreshing a Web page. Smart navigation is best used with ASP.NET pages that require frequent postbacks but with visual content that does not change dramatically on return. Consider this carefully when deciding whether to set this attribute to true." - .NET Framework SDK Documentation Quote Posting Guidelines
bizzydint Posted August 7, 2003 Author Posted August 7, 2003 yup. read that already - I'm assuming the disadvantage is an efficiency thing seeing as it's not actually telling us And I *am* posting back to the same page! And it's trying to find that "http://localhost/IEsmartnav1" one. have resolved the problem by rearranging the page (the offending controls are now at the top) - but if anyone can help me work out how to get this working properly, i'd be most grateful. Quote Grant me the serenity to accept the things I cannot change, the courage to change the things I cannot accept and the wisdom to hide the bodies of those people I had to kill today cos they pi**ed me off.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.