Click here to Skip to main content
15,850,298 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Here is my problem.

I have a master page.

I have an update panel in my master page.

I have a default.aspx page which is content page of my master page.

In my master page I have a link button, Once you click on that It creates a user control and adds it to my content page.

C#
protected void lnk_home_Click(object sender, EventArgs e)
    {

    Panel pnl_view = ContentPlaceHolder1.FindControl("pnl_view") as Panel;
    home home_view = LoadControl("home.ascx") as home;
    pnl_view.Controls.Clear();
    pnl_view.Controls.Add(home_view);

    }


in my user control I have a link button



<asp:LinkButton ID="Link_return" runat="server" CssClass="menu-item"
CausesValidation="False" onclick="Link_return_Click">Return

This is server side code of my link button

C#
protected void Link_return_Click(object sender, EventArgs e)
{
Panel pnl_view = this.Parent.FindControl("pnl_view") as Panel;
home home_view = LoadControl("home.ascx") as home;

pnl_view.Controls.Add(home_view);

}


When I click on the link button in user control click event does not fire at all, none of my controls fires any event at all.

Please help me :(
Posted
Updated 6-Aug-13 22:29pm
v2
Comments
PrissySC 4-Aug-13 12:30pm    
<asp:Button id="Button1"
Text="Click here for greeting..."
OnClick="GreetingBtn_Click"
runat="server"/>


Try the format above and watch your capitalization. I have not worked much with ASP lately and don't remember if it was sensitive, but you have "onclick" and MSDN says it is "OnClick". HTH
Amey K Bhatkar 7-Aug-13 4:02am    
Do you have link button inside you update panel that add user control on the page?

1 solution

Try it in JQuery...Write the below code with in document ready function of jQuery.

C#
$("#Link_return").live("click", function () {
       alert("Link_return button fired successfully");       
    });
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900