.get_text() doesn't work on toggle?

3 posts, 1 answers
  1. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 11 Jan 2011 Link to this post

    In the Clicking event I'm trying to get the text of the button, but sender.get_text() is giving me an empty string

    Button is defined like this
    <telerik:RadButton ID="showInputButton" runat="server" ButtonType="StandardButton" ToggleType="CustomToggle" AutoPostBack="False" ForeColor="Black" CommandArgument='<%# Eval("pdrid") %>' OnClientClicking="OnToggleInputClicking">
                                    <ToggleStates>
                                        <telerik:RadButtonToggleState PrimaryIconCssClass="rbAdd" Text="Show" />
                                        <telerik:RadButtonToggleState PrimaryIconCssClass="rbRemove" Text="Hide" />
                                    </ToggleStates>
                                </telerik:RadButton>

    Am I doing something wrong?
  2. Answer
    Cori
    Cori avatar
    562 posts
    Member since:
    Jul 2010

    Posted 12 Jan 2011 Link to this post

    Hello Steve,

    I have to assume to get the text of a toggle button, you have to do it this way:

    sender.get_selectedToggleState().get_text()

    I hope that helps.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 12 Jan 2011 Link to this post

    Oh yes, you would be right!

    I did not see that function in the list, I just stopped at get_text
Back to Top