0

trying to get same string on tooltip as is in the "Text" e.g.
Text="<%# methodname(parameter) %>"
ToolTip="<%# methodname(parameter) %>" - this however errors out

  • Text is not static - dependent on string returned in method

    <HeaderTemplate>
    <asp:Label ID="Header" runat="server" Text="<%# methodname(parameter) %>"
    meta:resourcekey="HeaderResource1"></asp:Label>
    </HeaderTemplate>
    

any help would be really appreciated

protected string methodname(int integer)
{
    switch (integer)
    {
        case 1:
            return RadtxtLot1.Text.Trim();
        case 2:
            return RadtxtLot2.Text.Trim();
        case 3:
            return RadtxtLot3.Text.Trim();
        default:
            return "";
    }
}
2
  • how your methodname looks like?? Commented Jun 13, 2012 at 16:42
  • The methodname is returning a string - which is then set as the column header Commented Jun 14, 2012 at 8:35

1 Answer 1

1

You could do something in your code behind like setting the Tooptip equal to the Text of the Label in your preRender stage.

Or another less tidy way would be to make your label a ReadOnly TextBox and attach a method on it "OnTextChanged" then set the Tooltip in that... if you don't mind that field looking like a text box.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.