打印本文 打印本文 关闭窗口 关闭窗口
My namespace disappear in ASP.NET 2(beta2)?
作者:武汉SEO闵涛  文章来源:敏韬网  点击数714  更新时间:2009/4/23 10:39:36  文章录入:mintao  责任编辑:mintao
   When you create your first ASP.NET 2.0 Web Page. You may say:"Oh!", there''''s no default namespace in your code-behind cs file? OK, let''''s add one, we think every object should be in one certain namespace. it''''s easy to add it, and then let''''s press F5 to run it. "What? Errors? I didn''''t do anything! just add a namespace!".
   OK, calm down, let me explain it. When you add a namspace to you aspx.cs file. please turn to the corresponding aspx file. look at this:
   <%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>
   You see, current page is inherited from the _Default, it should be changed to MyNamespace._Default, right? add it, and press F5, OK, you got it, you first page run successfully! Congratulation!
   There''''re so many different things between ASP.NET 1.1 and 2.0. I''''m sure, and I''''m a beginner. anyway, let''''s learn these things one by one.

打印本文 打印本文 关闭窗口 关闭窗口