ciao ragazzi sn un pivello di aspnet e sto studiando un po mi si è preentato un problema:ecco il codice che mi da un errore js
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form name="form1" id="form1" runat="server">
<asp:TextBox ID="txt1" runat="server"></asp:TextBox>
<asp:TextBox ID="Txt2" runat="server"></asp:TextBox>
<asp:Button ID="Cmd1" runat="server" Text="Login"/>
</form>
</body>
</html>
file vb
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Cmd1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Cmd1.Click
Dim js As String
js = "alert(document.forms[0]['txt1'].value);"
Page.ClientScript.RegisterClientScriptBlock(Cmd1.G etType(), "js", js, True)
End Sub
End Class
l'erroe dice document.forms[0][txt1].value nullo![]()
aiutatemi grazie....