Access problem to 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="...">
)
精彩评论