Try our conversational search powered by Generative AI!

PageList CurrentPage.LinkURL click event

Vote:
 

Hi

I have an EPiServer:PageList on an aspx page.

<EPiServer:PageList ID="PageListControl" runat="server" EnableViewState="false" >
<ItemTemplate>
<li>
<a href="<%#Container.CurrentPage.LinkURL%> "><%# Container.CurrentPage.PageName %></a>
</li>
</ItemTemplate>
</EPiServer:PageList>

On the same page I allsow have two different views.When the page is loaded one view is active. When the CurrentPage.LinkURL is clicked I want to stay on the same page and activate the other view.

Is there any way I can get the click event for the CurrentPage link and do this.

#56609
Jan 30, 2012 11:10
Vote:
 

You can use an ASP.NET HyperLink control and add the server side click event there.

Frederik

#56610
Jan 30, 2012 12:07
Vote:
 

Hi,

 

Maybe you can use a querystring to change view. 

<a href="<%#Container.CurrentPage.LinkURL%>&view=your-view">

And in your code-behind file switch the view.

if (Request.QueryString["view"] == "your-view")
{
     this.OneView.Visible = false;
     this.SecondView.Visible = true;
}
else
{
     this.OneView.Visible = true;
     this.SecondView.Visible = false;
}

    

#56612
Jan 30, 2012 12:11
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.