- C# code
using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using System.Text;using FN.CMS.Utility;using FN.CMS.Entities;using FN.CMS.Operator;namespace FN.CMS{ public partial class NewsMore : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { this.Label1.Text="求购";//这里赋得值在前台没有反映啊,this点居然出不来Label1,怎么回事了,去掉外面的面命空间就可以,这是为什么? }}}
------解决方案--------------------------------------------------------
- HTML code
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Adm_New_SerDJ_Edit.aspx.cs" Inherits="ServicePlatform.adm.Adm_New_SerDJ_Edit" StylesheetTheme="WccsTheme" %>看看页面这里的命名空间跟后台是否一致
------解决方案--------------------------------------------------------
查看一下aspx aspx.cs aspx.cs aspx.designer.cs三个文件的命名空间是否一样。。
------解决方案--------------------------------------------------------
检查你的label是否为服务器控件,再检查a.aspx.designer.cs中是否已经注册了这个控件