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 txtSifre’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=falsein 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="...">)