Re: What about Anchors (#) and ASP.NET?

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Bobby Ryzhy (bobby_at_weekendtech.net)
Date: 07/26/04


Date: Mon, 26 Jul 2004 09:37:49 -0600

On Mon, 26 Jul 2004 17:01:21 +0200, "Lars Netzel" <[stop_spam]@host.topdomain> wrote:

>Hello!
>
>I have a LOOOOONG page with a bunch of panels that you can expand and
>stuff.. and as you all know when you click on a servercontrol and get a
>postback, it reloads and you end up at the top of the page ... is there
>anyway to get the postback to add a #anchorname to the Address so I can keep
>my location down in the page??
>
>Regards
>/Lars
>

You can try some javascript -

C#
if (IsPostBack)
{
        Page.Controls.Add(new LiteralControl("<script language = \"javascript\">"));
        Page.Controls.Add(new LiteralControl(window.location="abc.aspx#123));
        Page.Controls.Add(new LiteralControl("</script>"));
}

Bobby Ryzhy
bobby @ domain below
http://weekendtech.net



Relevant Pages

  • What about Anchors (#) and ASP.NET?
    ... I have a LOOOOONG page with a bunch of panels that you can expand and ... and as you all know when you click on a servercontrol and get a ... postback, it reloads and you end up at the top of the page ... ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: TreeView Dynamic XML Binding
    ... It actually addressed one issue I was interested in and that is turnning off the postback at all nodes and expand/collapse images. ... However, when I dynamically set the DataFile in the Page_Load, the postback generates the null reference error when clicking the tree node. ... the control generates the according JavaScript and the Expand links do not fire postbacks. ... Object reference not set to an instance of an object. ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Force postback from Treeview leaf node
    ... Using the MS IE WebControls Treeview, I am displaying a series of ... but I can't get the postback ... of the session variable and expand the relevant nodes. ... but when I insert alert statements in the javascript function ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • RE: TreeView populate on demand and mutations after expanding
    ... Sounds like it might be generating a postback. ... method to store whatever you've added and ... my datasource and expand the node again the child node correctly displays. ... there is some kind of cache in the way or something like that. ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: TreeView populate on demand and mutations after expanding
    ... Unfortunaltely it does not generate a postback anymore once a node has been ... It just populates it with values it has cached client side. ... my datasource and expand the node again the child node correctly displays. ... there is some kind of cache in the way or something like that. ...
    (microsoft.public.dotnet.languages.csharp)