Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_professional thread: Server.transfer with querstring and anchor not working


Message #1 by "Sean Marchiafava" <smarch@c...> on Fri, 7 Feb 2003 17:45:38
Server.Transfer is a server-side execution switch. The client browser never
knows that it
is actually receiving data from the second page.

e.g.

page 1 -> output renders, then server.transfer to page 2 -> output renders

client browser still thinks its looking at page 1.

The only way the # anchor will work is if the browser sees it, which means
you need to do a Redirect, which is client-side.




"Sean Marchiafava" <smarch@c...> on 02/07/2003 11:45:38 AM

Please respond to "ASPX_Professional" <aspx_professional@p...>

To:   "ASPX_Professional" <aspx_professional@p...>
cc:

Subject:  [aspx_professional] Server.transfer with querstring and anchor
      not working

The javascript code below is used for a dropdownlist to navigate to an
element on another page with an attached anchor in the url.


 Dim sb As New System.Text.StringBuilder()
 sb.Append("<SCRIPT type='text/javascript'>")
 sb.Append("window.parent.main.location.href ='FormBuilder.aspx?
FBFormId=" & Mid(dlForms.SelectedItem.Value, InStr
(dlForms.SelectedItem.Value, "=") + 1) & "#lbl" & sBookmark & "';")
sb.Append("</SCRIPT>")
Page.RegisterClientScriptBlock("Navigate", sb.ToString)

When I try using Server.Transfer(Somepage.aspx?querystring#anchor) it
will not move to the anchor element.

I already tried Server.Transfer(Somepage.aspx#anchor?querystring) which
produces an error.

Anyone know why this doesn't function, is this a browser bug?








  Return to Index