错误msg =在当前上下文中不存在 [英] error msg =does not exist in the current context
问题描述
我有一个div,它将runat =server添加到它
i have a div that add runat="server" to it
<div id="insert" runat="server" Visible="False" ">
起初==> div可见是假
按下按钮后会显示
divinsert.visible = true;
然后在div
i有一个按钮用这个代码关闭div
divinsert.visible = false;
但我收到了错误信息msg =
1当前上下文中不存在divinsert这个名称
如何添加附加我的项目
=========
i corect它但是
这个错误w如图所示:
System.Web.UI.HtmlControls.HtmlGenericControl'不包含'visible'的定义,也没有扩展方法'visible'接受第一个参数可以找到类型'System.Web.UI.HtmlControls.HtmlGenericControl'(你是否缺少using指令或程序集引用?)
at first ==>div Visible is "False"
after press a button it will be show
divinsert.visible = true;
then on div
i has a button to close div with this code
divinsert.visible = false;
but i recived erroe msg=
1 The name 'divinsert' does not exist in the current context
how can i add attach my proj
=========
i corect it but
this error was appear:
System.Web.UI.HtmlControls.HtmlGenericControl' does not contain a definition for 'visible' and no extension method 'visible' accepting a first argument of type 'System.Web.UI.HtmlControls.HtmlGenericControl' could be found (are you missing a using directive or an assembly reference?)
推荐答案
嗯...... ID是插入,而不是divinsert
所以我建议更改按钮代码中的名称?
Um... The ID is "insert", not "divinsert"
So I would suggest changing the name in your button code?
这篇关于错误msg =在当前上下文中不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!