当前上下文中不存在名称“users”

qingyazhi2010 2014-07-28 10:50:17

using System;
using System.Collections;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using jdyh.Model;
using System.Collections.Generic;

namespace jdyh.manager
{
public partial class mrdg : System.Web.UI.Page
{
protected List<Url> users;
protected int cc;
protected void Page_Load(object sender, EventArgs e)
{
users = UrlServices.GetAllUsers();
}
}
}



<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="mrdg.aspx.cs" Inherits="jdyh.manager.mrdg" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0062)http://m.fang.com/zt/wap/201407/huinanloupan.html?city=sh&m=xf -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK"/>
<meta charset="gbk">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>每日导购-往期回顾</title>
<meta content="房天下" name="keywords">
<meta content="房天下" name="Description">
<script src="./jscss/jquery-1.7.1.min.js"></script>
</head>
<body>
<form id="form1" runat="server">
<div id="urllist">
<% if (users != null)
{
for (int ix = 0; ix < users.Count; ix++)
{
%>
<div>
<a href="<%=users[ix].Urls %>">
<%=users[ix].Title %></a>
</div>
<%}
} %>
</div>
</form>
</body>
</html>


咋回事呢
...全文
80 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
qingyazhi2010 2014-07-28
  • 打赏
  • 举报
回复
不是权限的问题看看这个吧:http://blog.csdn.net/wind8303/article/details/5847301
淡淡的活着 2014-07-28
  • 打赏
  • 举报
回复
··没注意看·· 这样写还真没用过··
-烟花雨季 2014-07-28
  • 打赏
  • 举报
回复
请把权限设置为public
qingyazhi2010 2014-07-28
  • 打赏
  • 举报
回复
我知道了~http://blog.csdn.net/wind8303/article/details/5847301
淡淡的活着 2014-07-28
  • 打赏
  • 举报
回复
users哪来的?

62,047

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧