Question

This is the html ,

<asp:LinkButton ID="hlnkLogoffF" runat="server" Text="Logoff" OnClick="hlnkLogoffF_Click" ></asp:LinkButton>

This is the code behind,

protected void hlnkLogoffF_Click(Object sender, EventArgs e)
{
    //do something here
}

When i run this, i get the following error,

"The resource cannot be found. "

Was it helpful?

Solution

You have to use

if (!Page.IsPostBack)
{
      // Your code here
}

in code behind of master page.

Also

What happens if you turn off validating with CausesValidation setting to false?

OTHER TIPS

i tried to run your code

.aspx

  <asp:LinkButton ID="hlnkLogoffF" runat="server" Text="Logoff"     OnClick="hlnkLogoffF_Click" ></asp:LinkButton>

.Cs

    protected void hlnkLogoffF_Click(object sender, EventArgs e)
    {

    }

i Haven't get any error.Could you please post the code inside the click event.?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top