Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

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.
Posted

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?

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*
Posted

You could check if the page is postback.

If Page.IsPostBack then
   Server.Transfer("somepage")
   'or
   Response.Redirect("somepage")
end if

Posted

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! :)

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.
  • 1 month later...
Posted

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

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*
Posted

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

Posted

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.

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...