Need some help on runnng a simple program ( I am new to .net )

Discussion in 'ASP.NET 2.0' started by chenna09, Sep 19, 2008.

  1. Hi,

    I wrote simple form ( testing1.aspx)and C# file ( Sample1.aspx.cs). I am getting the following error If I run from the server..

    Copied the above to files to the server. Do I need to do anything else ?

    Parser Error Message: The base type 'DBImages.Sample1' does not exist in the source file 'Sample1.aspx.cs'.

    Source Error:





    Code:
    Line 1:  <%@ Page language="c#" Inherits="DBImages.Sample1" Src="Sample1.aspx.cs"  %>
    Line 2:  
    Line 3:  <html>

    testing1.aspx code :-


    <%@ Page language="c#" Inherits="DBImages.Sample1" Src="Sample1.aspx.cs" %>


    <html>
    <head>
    <title>Sample Page using C#</title>
    </head>



    <form runat="server">
    Select File To Upload:
    <input id="UploadFile" type=file runat=server>
    <asp:button id=UploadBtn Text="Upload Me!" OnClick="UploadBtn_Click" runat="server"></asp:button>


    </form>
    </body>
    </html>


    Sample1.aspx.cs code:-


    using System;
    using System.Web.UI;
    using System.Web.UI.WebControls;


    namespace DBImages {


    public class Sample : Page {


    protected Label lblMessage;
    protected Button btnSubmit;


    public void UploadBtn_Click(object sender, System.EventArgs e){
    Response.Write("The Image was saved");
    }
    }
    }





    Any help would be great...
     
  2. Hi,
    I tried to make sense of that but there is too much confusion in it.
    What are you using to write the pages?
    If it's not Visual Studio 2008 or Visual Web Developer 2008 get a free copy here:
    http://www.asp.net/downloads/essential/
    Salute,
    Mark
     

Share This Page