Users Pricing

forum

home / developersection / forums / asp.net is not calling c# code

ASP.NET is not calling C# code

Mark M 2140 08 Dec 2014

For some reason this following ASP code is not calling the c# method "checkLastNames" that is suppose to be evaluated in the 'Visible=' field below. 

<asp:Button ID="btnZ" 
            runat="server"
            Text="Z"
            Height="20px"
            Width="25px"
            Font-Size="12px"
            CommandArgument="Z"
            OnClick="btnA_Click"
            Visible='<%# checkLastNames("Z") %>' />

When I enter debug mode the method isn't even being called. Visible just defaults to true. I've tried changing the method to return only false just to see if it would work but "Visible" is still defaulting to true. 

protected bool checkLastNames(string s){
    return false;
}


Mark M

Other


2 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md