문제

I'm trying to get a hold of an attribute I've created on a Telerik RadTextBox in the code behind of a click event. I've seen it solved in Javascript, but not the .cs/.vb file. Hopefully my code will explain it better: HTML:

<telerik:RadTextBox runat="server" ID="rdtTest" measurement-type="3" />

Code behind:

    protected void btnSave_OnClick(object sender, EventArgs e)
    {
        RadTextBox rdtTest= (RadTextBox)item.FindControl("rdtTest");
        string m = rdtHead.Attributes("measurement-type");
    }

Visual Studio doesn't think that the Telerik RadTextBox can have an "attributes" method. Am I doing something wrong, or is it not supported in Telerik?

도움이 되었습니까?

해결책

You can use this code

<telerik:RadTextBox ID="RadTextBox1" runat="server" /> 

In your code behind

var result = RadTextBox1.Attributes["yourKeyOfAttribute"];
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top