Wrox Programmer Forums
|
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 13th, 2008, 05:43 AM
Authorized User
 
Join Date: Dec 2005
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default .aspx.vb file doesnt run

Dear All,

Hope you can help me in the following problem:

I have an asp.net application, and for a newly developed page withen the application: the .aspx is running but the .aspx.vb does not run (no events are executed).
furhter i tried to delete the .aspx.vb file and nothing changed.
this means that there is no connection between the .aspx and the .aspx.vb file (maybe there is some error in the Dll file).


Hope its clear.
awaiting for your kind reply.

BR.

 
Old March 13th, 2008, 06:42 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

What development model are you using? Website or Web Application Project?
What does your pages @ Page directive look like?
What are you using to develop the pages?

-Peter
peterlanoie.blog
 
Old March 13th, 2008, 07:15 AM
Authorized User
 
Join Date: Dec 2005
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you Peter for your instant reply.

Actually, the thing is:

there is already a working website with some under construction pages on a server.

I am trying to edit one of these under construction pages on my PC (not the server), which will have a behind code (it didnt have behind code before).

On the PC I am working on the .net could not open the website as a solution for some reason, so I have edited the pages (files) independently, copy it to the server where the website is hosted and the server runs and compiles the website.

so maybe this is the problem for not accessing the .aspx.vb page?
or maybe the .aspx.resx caused the problem?





 
Old March 13th, 2008, 08:42 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

If this is a precompiled site, then simply posting the codebehind file won't work. The Page directive will likely have 'CodeBehind="somepage.aspx.vb"' in it. If you change that to 'CodeFile="somepage.aspx.vb"' then the page will load the codebehind file dynamically and use that. However, one caveat with this is that you might need to change the page's inherited class name. The codebehind file will contains a class that may also exist in an assembly. When the ASPX is parsed and processed, the runtime will try to load the class it inherits which it will find in two places (the dynamic assembly from the code file and the precompiled assembly) and it won't be able to work out the ambiguity. So you can simply rename the code behind class and the class name in the "inherits" attribute of the page directive. This is often how I implement page patches.

-Peter
peterlanoie.blog
 
Old March 16th, 2008, 03:27 AM
Authorized User
 
Join Date: Dec 2005
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Dear Peter,

thank you for your reply,
I really appreciate your cooperation.

I was trying the solution you proposed and the follwoing parser error appears :
    The 'CodeFile' attribute is not supported by the 'page' directive


and when I tryed to rename the class, it cannot be loaded.

any suggestions?



 
Old March 17th, 2008, 08:45 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

You are using ASP.NET 2.0 right? "CodeFile" should work without a problem. That changes the behavior to force the runtime to dynamically compile the file referenced in the attribute value.

-Peter
peterlanoie.blog
 
Old March 18th, 2008, 08:53 AM
Authorized User
 
Join Date: Dec 2005
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Dear Peter,

its working now i just was supposed to insert: Src="file_name.aspx.vb" :)

thank you very much for your help.

 
Old March 18th, 2008, 12:20 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Yes, that works too. My point was that CodeFile should work in ASP.NET 2.0.

-Peter
peterlanoie.blog





Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling a function from .vb file to aspx file !! NitinJoshi General .NET 4 February 10th, 2005 06:23 AM
run asp script from aspx PostmanPat C# 3 September 14th, 2004 12:58 PM
Can i run A VB Script File From Visual Basic VB GURU VBScript 1 May 21st, 2004 01:42 PM
Occur error when run aspx file bapechun ASP.NET 1.0 and 1.1 Basics 11 May 19th, 2004 07:24 AM
transfearing code to aspx file from vb file alyeng2000 ASP.NET 1.0 and 1.1 Professional 1 December 15th, 2003 11:12 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.