Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 13th, 2008, 05:43 AM
Authorized User
 
Join Date: Dec 2005
Location: , , .
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.

  #2 (permalink)  
Old March 13th, 2008, 06:42 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
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
  #3 (permalink)  
Old March 13th, 2008, 07:15 AM
Authorized User
 
Join Date: Dec 2005
Location: , , .
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?





  #4 (permalink)  
Old March 13th, 2008, 08:42 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
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
  #5 (permalink)  
Old March 16th, 2008, 03:27 AM
Authorized User
 
Join Date: Dec 2005
Location: , , .
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?



  #6 (permalink)  
Old March 17th, 2008, 08:45 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
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
  #7 (permalink)  
Old March 18th, 2008, 08:53 AM
Authorized User
 
Join Date: Dec 2005
Location: , , .
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.

  #8 (permalink)  
Old March 18th, 2008, 12:20 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
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
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 03:54 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.