简体   繁体   English

aspx.cs和aspx页面问题

[英]aspx.cs and aspx page problem

I'm developing a sort of a Web-site that lets you search, display(as thumbnails), delete images. 我正在开发一种网站,可让您搜索,显示(作为缩略图),删除图像。 I've followed the example of this site http://www.codeproject.com/KB/web-image/EasyThumbs.aspx , but i've found some problems into the "Default.aspx.cs". 我已经遵循了该站点的示例http://www.codeproject.com/KB/web-image/EasyThumbs.aspx ,但是在“ Default.aspx.cs”中发现了一些问题。 "ThumbFromId doesn't exist in the current context". “ ThumbFromId在当前上下文中不存在”。 Now i've noticed the Default.aspx.cs can't see the "objects" of the aspx pages., but i don't know why and how to solve that. 现在我注意到Default.aspx.cs看不到aspx页面的“对象”。但是我不知道为什么以及如何解决这个问题。

Is the Codebehind file registered in EasyThumbs.aspx? 是否在EasyThumbs.aspx中注册了Codebehind文件?

CodeBehind="EasyThumbs.ascx.cs" CodeBehind =“ EasyThumbs.ascx.cs”

This issue of "something doesn't exist in the current context" is due to the fact that multiple aspx files are referencing the same cs file. 此问题“当前上下文中不存在”是由于多个aspx文件引用了同一个CS文件。 Hence the cs doesn't know which aspx file are you talking about when you are accessing a control. 因此,当您访问控件时,cs不知道您在谈论哪个aspx文件。

What you can do is that, search for the string "Default.aspx.cs" in the whole solution. 您可以做的是,在整个解决方案中搜索字符串“ Default.aspx.cs”。 You might end up finding two aspx pages referencing this same cs file. 您可能最终会找到两个引用此同一个CS文件的aspx页面。

Hope it helps. 希望能帮助到你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM