C# 如何将默认焦点设置为asp:repeater中的第一个文本框?

C# 如何将默认焦点设置为asp:repeater中的第一个文本框?,c#,asp.net,asprepeater,C#,Asp.net,Asprepeater,我已经阅读了所有与之相关的问题 我的aspx包含如下代码 <asp:Repeater runat="server" ID="rptAnswer" OnItemDataBound="rptAnswerTextBox_ItemDataBound"> <ItemTemplate> <asp:TextBox ID="AnswerTextBox" runat="server" Visible="true"></asp:TextBox> </ItemTe

我已经阅读了所有与之相关的问题

我的aspx包含如下代码

<asp:Repeater runat="server" ID="rptAnswer" OnItemDataBound="rptAnswerTextBox_ItemDataBound">
<ItemTemplate>
<asp:TextBox ID="AnswerTextBox" runat="server" Visible="true"></asp:TextBox>
</ItemTemplate>
</asp:Repeater>
它给出的编译错误如下所示

    'System.Web.UI.WebControls.TextBox' does not contain a definition for 'Focus' and no extension method 'Focus' accepting a first argument of type 'System.Web.UI.WebControls.TextBox' could be found (are you missing a using directive or an assembly reference?)   
那么,如何将默认焦点设置为repeater中的第一个文本框?,
我是通过Java脚本实现的,但我希望通过c代码实现。

@fubo-但没有任何解决方案有效我没有那么多的声誉来评论他们的,所以我提出了一个严重的编译错误?您的代码看起来correct@Mysterio11-是的,其编译错误您确定您的文本框的类型为System.Web.UI.WebControl.textbox,如果是,则应具有焦点方法@fubo-但没有任何解决方案有效我没有那么多的声誉来评论他们的,所以我提出了一个严重的问题编译错误?您的代码看起来correct@Mysterio11-是的,其编译错误您确定您的文本框的类型为System.Web.UI.WebControl.textbox,如果是,则应具有焦点方法。
    'System.Web.UI.WebControls.TextBox' does not contain a definition for 'Focus' and no extension method 'Focus' accepting a first argument of type 'System.Web.UI.WebControls.TextBox' could be found (are you missing a using directive or an assembly reference?)