Sarà una cavolata con .net ma per me è una cosa difficie! grrr
Ho la mia paginetta:
E nel file .aspx ho questo:codice:<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="upload3.WebForm1" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <HTML> <HEAD> <title>WebForm1</title> </HEAD> <body> <form enctype="multipart/form-data" RUNAT="server"> <div id="Results" runat="server"></div> Uploada questo file: <input id="inputFile" type="file" runat="server"> Nome: <input id="inputNome" type="text" RUNAT="server"> <input type="button" id="BtnUp" value="upload!" OnServerClick="BtnUp_Click" RUNAT="server"> </form> </body> </HTML
Quando cerco di lanciare la pagina mi esce questo errore:codice:... private void BtnUp_Click(object sender, System.EventArgs e) { inputFile.PostedFile.SaveAs(Server.MapPath(inputNome.Value)); Results.InnerHtml = "File uplodato su " + inputNome.Value + " "; }
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0122: 'upload3.WebForm1.BtnUp_Click(object, System.EventArgs)' is inaccessible due to its protection level
Source Error:
Line 15: Nome: <input id="inputNome" type="text" RUNAT="server">
Line 16:
Line 17: <input type="button" id="BtnUp" value="upload!" OnServerClick="BtnUp_Click" RUNAT="server">
Line 18: </form>
Line 19: </body>
Source File: http://localhost/upload3/WebForm1.aspx Line: 17

Rispondi quotando