I have a linkbutton placed in the master page. What I want to achieve is, when clicked, the content page will be directed to another page, and the appearance of the the linkbutton will be changed. The link button is defined as below:
<asp:LinkButton ID="LinkButton1" runat="server" PostBackUrl="xxx.aspx" CssClass="menuNormal" >XXX</asp:LinkButton>
I also have the button click event defined as below:
Protected Sub LinkButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LinkButton1.Click
LinkButton1.CssClass = "menuSelected"
End Sub
What happens is:
When the link button is clicked the first time, the master page is initiated, the content page is initiated, and then the master page is loaded. But the button_click event never fires. Therefore, the content page is changed to a different one but the appearance of the button remains the same.
When the link button is clicked a second time, the master page is initiated, the content page is initiated, the master page is loaded, AND then the button_click event is fired. Therefore, this time, the appearance of the button is changed.
Why? And what do I need to do so "both" the appearance of the button will change, and the content page shows a new page, when the button is clicked the first time?
I have tried to put the postbackurl into the LinkButton1_Click event but this time, the appearance of the button is changed BUT the content page does not get directed to a new page...
HELP!!!