为什么“控件”在当前上下文错误中不存在? [英] why 'controls' does not exist in the current context error appearing?

查看:76
本文介绍了为什么“控件”在当前上下文错误中不存在?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将表单从网站应用程序复制到Web应用程序。以下是脚本端和客户端相关的代码:





I have copied a form from website application to web application. The following is the code for relating script side and client side:


<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Highlights_edit.aspx.cs" Inherits="tnrestwebapplication.Highlights_edit" %>





代码背后:



code behind:

namespace tnrestwebapplication
{
    public partial class Highlights_edit : System.Web.UI.Page
    {
...



我得到错误,指出所有标签,面板,文本框中的'控件'在当前上下文中不存在,尽管这些控件完全在脚本中。



有谁可以帮帮我?


I get the error stating that "'controls' does not exist in the current context" for all labels,panels,textbox eventhough these controls are well within the script.

Can anyone help me out?

推荐答案

步骤



Steps



  1. 删除Designer文件。
  2. 右键单击ASPX文件并选择转换为Web应用程序(或类似的东西)。

    这将再次创建Designer文件,并声明所有控件及其属性。

  1. Delete the Designer file.
  2. Right-click on the ASPX file and select Convert to Web application (or something like that).
    That will create the Designer file again with all the controls and its properties declared.


这篇关于为什么“控件”在当前上下文错误中不存在?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆