开发者

Access problem to a control's value in javascript

i have a problem with accessing a control's value in JavaScript.

<tr>
    <th>
        Kullanici Adi:
    </th>
    <td>
        <asp:TextBox ID="txtKullanici" Text="" runat="server" />
    </td>
</tr>
<tr>
    <th>
        Sifre :
    </th>
    <td>
        <asp:TextBox ID="txtSifre" Text="" runat="server" TextMode="Password" />
    </td>
</tr>

I can access to txtS开发者_Python百科ifre's text but i can't access to txtKullaniciAdi's text. There is my accessing code:

    var Sifre = $("#<%=txtSifre.ClientID %>").val();
    var Kul =  $("#<%=txtKullanici.ClientID %>").val();

Do you have any idea?

Çağın


Are you setting the TextBox txtKullanici.Visible=false in the codebehind? This would force ASP.NET NOT to render the control which would explain that you can't find it in the html.

If not, show us the html of the textbox control (something like <input type="text" id="...">)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜