views:

33

answers:

1

Hi Experts,

I have a user control of menu which have links on which user is redirected to the desired page. When I am using that user control in my aspx page, on first time when user click to the link he is redirected to the destination, but when user again click that link it is showing the page stating that "cannot find server", the same thing is happened to the other links also. In my user control I am using:

Private void Link1_Click(Object sender, eventargs e)
{
 Response.Redirect("Secondpage.aspx");
}

Private void Link2_Click(Object sender, eventargs e)
{
 Response.Redirect("Thirdpage.aspx");
}

Unexpectdly, the same code is working fine on the production server but throwing issue in the developmwnt server.

I am not sure the cause of the error.. Thanks in advance.

+1  A: 

your event is not found on the server as it is defined as Private

I think Private should be Protected

Protected void Link2_Click(Object sender, eventargs e)
{
 Response.Redirect("Thirdpage.aspx");
}
Muhammad Akhtar