简体   繁体   中英

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". "ThumbFromId doesn't exist in the current context". 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.

Is the Codebehind file registered in EasyThumbs.aspx?

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. Hence the cs doesn't know which aspx file are you talking about when you are accessing a control.

What you can do is that, search for the string "Default.aspx.cs" in the whole solution. You might end up finding two aspx pages referencing this same cs file.

Hope it helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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