By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,144 Members | 872 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,144 IT Pros & Developers. It's quick & easy.

Wrong Code-Behind Page being referenced

P: n/a
Hey Folks,

I have a bunch of aspx pages in a solution. One of these pages, call it
header1.aspx, has it's code behind in header1.aspx.vb. Another,
header2.aspx, has header2.aspx.vb. When I double-click a web control on
header1.aspx, it brings me to the code behind for header2! In fact, the
code behind page header1.aspx.vb doesn't even recognize the controls on page
header1.aspx.

BUT, header2.aspx.vb recognizes the controls from header1.aspx.

The @ Page tag at the top of each page has the correct vb file listed
(header1.aspx has CodeBehind="header1.aspx.vb" and header2.aspx has
CodeBehind="header2.aspx.vb").

Earlier, I notice something got messed up and the header1.aspx Page tag had
it's code behind pointing to header2.aspx.vb, but I changed that and now the
proper vb files (with their proper resx files) are under ther respective
aspx pages in the Solution Explorer.

Anyone know if there is some other tag/setting/whatever to get an aspx page
pointing to the right vb file?

Thanks,

Jeff
Nov 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi Jeff,

Is it possible that the src attribute in the .aspx file is pointing to the
right place but the inherits is looking at the wrong class? I've made that
mistake when doing a copy/paste file within VS.NET.
"Jeff Cooper" <js******@compudude.com> wrote in message
news:UW*******************@newsread1.news.atl.eart hlink.net...
Hey Folks,

I have a bunch of aspx pages in a solution. One of these pages, call it
header1.aspx, has it's code behind in header1.aspx.vb. Another,
header2.aspx, has header2.aspx.vb. When I double-click a web control on
header1.aspx, it brings me to the code behind for header2! In fact, the
code behind page header1.aspx.vb doesn't even recognize the controls on page
header1.aspx.

BUT, header2.aspx.vb recognizes the controls from header1.aspx.

The @ Page tag at the top of each page has the correct vb file listed
(header1.aspx has CodeBehind="header1.aspx.vb" and header2.aspx has
CodeBehind="header2.aspx.vb").

Earlier, I notice something got messed up and the header1.aspx Page tag had
it's code behind pointing to header2.aspx.vb, but I changed that and now the
proper vb files (with their proper resx files) are under ther respective
aspx pages in the Solution Explorer.

Anyone know if there is some other tag/setting/whatever to get an aspx page
pointing to the right vb file?

Thanks,

Jeff

Nov 17 '05 #2

P: n/a

P: n/a
The Codebehind attribute doesn't do anything at runtime. This just tells
VS.NET what source files to compile into code-behind classes in the .dll for
your bin folder. What matters is the Inherits attribute which tells ASP.NET
which class to use from that dll. You might have the same Inherits attribute
on both pages, causing both pages to inherit from the same page class.

"Jeff Cooper" <js******@compudude.com> wrote in message
news:UW*******************@newsread1.news.atl.eart hlink.net...
Hey Folks,

I have a bunch of aspx pages in a solution. One of these pages, call it
header1.aspx, has it's code behind in header1.aspx.vb. Another,
header2.aspx, has header2.aspx.vb. When I double-click a web control on
header1.aspx, it brings me to the code behind for header2! In fact, the
code behind page header1.aspx.vb doesn't even recognize the controls on page header1.aspx.

BUT, header2.aspx.vb recognizes the controls from header1.aspx.

The @ Page tag at the top of each page has the correct vb file listed
(header1.aspx has CodeBehind="header1.aspx.vb" and header2.aspx has
CodeBehind="header2.aspx.vb").

Earlier, I notice something got messed up and the header1.aspx Page tag had it's code behind pointing to header2.aspx.vb, but I changed that and now the proper vb files (with their proper resx files) are under ther respective
aspx pages in the Solution Explorer.

Anyone know if there is some other tag/setting/whatever to get an aspx page pointing to the right vb file?

Thanks,

Jeff

Nov 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.