Nella DLL:
codice:Option Explicit On Imports System Imports System.IO Imports System.Web Imports System.Web.UI.Page Imports System.Web.UI.HtmlControls Imports System.Drawing Imports System.Drawing.Imaging NameSpace Gold Public Class Upload Inherits System.Web.UI.Page 'accetta solo immagini max 100 kb Public const MaxLength=102400 Public const FileType="image/*" Private _Name As String Public Property FinalFile() As String Get Return _Name End Get Set(Value As String) _Name = Value End Set End Property Protected lbl As System.Web.UI.WebControls.label Protected WithEvents cmdOK As System.Web.UI.WebControls.Button Protected Files As System.Web.UI.HtmlControls.HtmlInputFile Sub Page_Load(sender as Object, e as EventArgs) Files.Accept=FileType End Sub Public Sub cmdOK_Click(sender as Object, e as EventArgs) Handles cmdOK.Click ' AZIONI PER QUESTO EVENTO ' ECC. ECC. ECC.
NELLA PAGINA ASPX:
PERO' QUANDO CLICCO SUL BOTTONE cmdOK OTTENGO L' ERRORE: Impossibile fare riferimento ad un oggetto non impostato su istanza di oggettocodice:<%@ Page Language="VB" %> <script runat="server"> Sub Page_Load() Dim NuovaClasse As New Gold.Upload End Sub </script> <html> <head> </head> <body> <form runat="server"> </p> <input id="Files" type="file" size="40" runat="Server" /> </p> </p> <asp:Button id="cmdOK" Text="OK" runat="server" /> </p> <asp:Label id="lbl" runat="server" font-bold="true"></asp:Label> </form> </body> </html>

Rispondi quotando

