Allora... questo è tutto il codice della mia pagina .aspx.vb
Public Class AreaGeogrNew
Inherits System.Web.UI.Page
Private mTAB As ProgettiBus.Tabelle
Dim sCod As String
Private mDS As DataSet
Dim sEs As String
Public LiteralScript1 As Literal
#Region " Codice generato da Progettazione Web Form "
'Chiamata richiesta da Progettazione Web Form.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Protected WithEvents btnNew As System.Web.UI.WebControls.Button
Protected WithEvents TextBox2 As System.Web.UI.WebControls.TextBox
Protected WithEvents Label2 As System.Web.UI.WebControls.Label
Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox
Protected WithEvents Label1 As System.Web.UI.WebControls.Label
Protected WithEvents btnLista As System.Web.UI.WebControls.Button
Protected WithEvents Label3 As System.Web.UI.WebControls.Label
'NOTA: la seguente dichiarazione è richiesta da Progettazione Web Form.
'Non spostarla o rimuoverla.
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: questa chiamata al metodo è richiesta da Progettazione Web Form.
'Non modificarla nell'editor del codice.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Inserire qui il codice utente necessario per inizializzare la pagina
End Sub
Private Sub btnNew_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnNew.Click
Dim ERRORE As String
Me.SmartNavigation = True
mTAB = New ProgettiBus.Tabelle(ConfigurationSettings.AppSettings("Provider"), _
ConfigurationSettings.AppSettings("Connstring"))
sEs = ConfigurationSettings.AppSettings("Esercizio")
ERRORE = mTAB.crea_tbAreaGeogr(sEs, TextBox1.Text, TextBox2.Text)
Call msgbox(ERRORE)
Response.Redirect("AreaGeogr.aspx")
End Sub
Private Sub btnLista_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnLista.Click
Response.Redirect("AreaGeogr.aspx")
End Sub
Protected Overloads Sub msgbox(ByVal s$)
s = s.Replace("'", "\'")
Dim ScriptString$ = ""
ScriptString += "<script language=javascript>" & vbCrLf
ScriptString += "</script>" & vbCrLf
Page.RegisterClientScriptBlock("clientScript", ScriptString)
End Sub
End Class
Devo inserire qualcosa anche nell'HTML? Perchè se lo eseguo, mi dà solo una pagina bianca senza nessun messaggio di errore!