名称"sEcode"在当前上下文中不存在

编程入门 行业动态 更新时间:2024-10-28 20:20:28
本文介绍了名称"sEcode"在当前上下文中不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

嗨 访问数据时出现此错误: 名称" sEcode"在当前上下文中不存在" 导致此问题的代码段如下

Hi I am getting this error while accessing data: "The name ''sEcode'' does not exist in the current context" The code snippet which causes this is below

protected void btnEmpDet_Click(object sender, EventArgs e) { Response.Redirect("empfetch.aspx?Ecode=" + sEcode + "&Employeename=" + sEmployeename + "&department" + sdepartment + "&location" + slocation); }

我该怎么办才能消除错误? 谢谢

What can I do to remove the error? Thanks

推荐答案

avijit1112010写道: avijit1112010 wrote:

"empfetch.aspx?Ecode =" + sEcode +&

"empfetch.aspx?Ecode=" + sEcode + "&

您正在尝试使用名为"sEcode"的变量.我在您的按钮单击事件方法中找不到该定义.那是全局变量吗? 错误提示它不是定义的变量(不是全局变量!). 为了解决这个问题,在使用Response.Redirect之前,声明并定义您要使用的所有查询字符串的值.

You are trying to use a variable named ''sEcode''. I don''t find that defined in your button click event method. Is that a Global variable? Error suggests it''s not a defined variable (not global!). In order to resolve, before using the Response.Redirect, declare and define the values of all the query strings you are trying to use.

是否已声明sEcode ? 如果尚未声明,IDE将无法识别它. 要么将其声明为Public,要么将其声明为private. 这样,它就可以被看到"并变得可用. Have you declared sEcode? If it has not been declared the IDE cannot recognise it. Either declare it as Public or within the sub as private. That way it will be ''seen'' and made usable.

您在哪里定义了sEcode? 请重新检查变量名称. Where did you defined sEcode ? please recheck the variable name.

更多推荐

名称"sEcode"在当前上下文中不存在

本文发布于:2023-07-25 09:15:47,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1209037.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:上下文   中不   名称   sEcode   quot

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!