Hi,

I have a problem here. I have a project running on localhost. Whenever I made some changes on a .aspx file, the changes can be seen immediately when I access my localhost. But when I made changes in aspx.vb file, the localhost still showing old info.

* I have try delete all files and folders in Temporary ASP.NET Files, clear browser cache, restart my IIS admin, restart my World Wide Web Publishing Service.

Any help???

Hi there

Whenever you make changes in aspx file the changes will be reflected in browser because the page is designed in html; which is parsed in web browser. however if you make changes in code behind .aspx.vb then you have to builld the appliction, this will compile your code into .dll

So i suggest you , just build the app after changes in code-behind

short cut for build : ctrl + b or from build menu -- > build solution


Mark as solved if it helps you

VS is not responsible to compile your web-pages/code, pages are compiled automatically by asp.net compiler. ASP.NET 2.0 and later version uses aspnet_compiler.exe to compile your web-pages/code-behind along with code placed in app_code.

VS is not responsible to compile your web-pages/code, pages are compiled automatically by asp.net compiler. ASP.NET 2.0 and later version uses aspnet_compiler.exe to compile your web-pages/code-behind along with code placed in app_code.

Hi adatapost,
Thanks for you reply. By using the aspnet_compiler.exr to compile website, the result will be just the same when the runtime compiles files for a browser request. Am I right? So, if I clear everything in the "Temporary ASP.NET Files" folder and reopen my website from web browser, it suppose reflect the changes right? But it still remained the same......

> if I clear everything in the "Temporary ASP.NET Files" folder and reopen my website from web browser, it suppose reflect the changes right? But it still remained the same......

I guess! They (deleted files) were belongs to other webapplication. Create a new/empty webapplication and copy all files/folders from exising application into this new one. Let's see what happens.

Hi there

Whenever you make changes in aspx file the changes will be reflected in browser because the page is designed in html; which is parsed in web browser. however if you make changes in code behind .aspx.vb then you have to builld the appliction, this will compile your code into .dll

So i suggest you , just build the app after changes in code-behind

short cut for build : ctrl + b or from build menu -- > build solution


Mark as solved if it helps you

Hi Yousurf,

Thanks for your reply. I'm having problem installing VS actually.:'( I'll try your method as soon as I manage to install VS. I'll post if I get any result. :)

> if I clear everything in the "Temporary ASP.NET Files" folder and reopen my website from web browser, it suppose reflect the changes right? But it still remained the same......

I guess! They (deleted files) were belongs to other webapplication. Create a new/empty webapplication and copy all files/folders from exising application into this new one. Let's see what happens.

Hi adatapost,
I have tried. But the new app I created is just as weird as the old one. The aspx.vb is still not reflecting any changes. I am sure I am editing the correct file. In the XXX.aspx file, I can see the the line :

Codebehind="XXX.aspx.vb"

I even tried removing the .aspx.vb from the folder. Delete all temp files in "Temporary ASP.NET Files" folder, restart IIS. Pre-Compile my project using aspnet_compiler. But it still loading ok.... without the .asp.vb....

>Whenever I made some changes on a .aspx file, the changes can be seen immediately when I access my localhost. But when I made changes in aspx.vb file, the localhost still showing old info.

Code-behind file has a partial class which inherits System.Web.UI.Page class. The .aspx file contains an Inherits attribute in the @Page directive that points to the code-behind partial class. When the page is compiled, ASP.NET generates a partial class based on the .aspx file; this class is a partial class of the code-behind class file. The generated partial class file contains declarations for the page's controls. Finally, ASP.NET generates & compiles another class called [B]Pagename_aspx[/B], that inherits from the class generated (Partial) class.

>Whenever I made some changes on a .aspx file, the changes can be seen immediately when I access my localhost. But when I made changes in aspx.vb file, the localhost still showing old info.

Code-behind file has a partial class which inherits System.Web.UI.Page class. The .aspx file contains an Inherits attribute in the @Page directive that points to the code-behind partial class. When the page is compiled, ASP.NET generates a partial class based on the .aspx file; this class is a partial class of the code-behind class file. The generated partial class file contains declarations for the page's controls. Finally, ASP.NET generates & compiles another class called [B]Pagename_aspx[/B], that inherits from the class generated (Partial) class.

Hi adatapost,
Great explanation. But is there anyway to solve this problem? May I know why the website can run perfectly even after the XXX.aspx.vb is removed??

>May I know why the website can run perfectly even after the XXX.aspx.vb is removed??

ASP.NET compiler compiles App_Code and any code-behind files associated with aspx, ascx, etc files. The runtime caches all the compilation results in order to quickly process later requests, and does not need to recompile again unless someone edits a file.

ASP.NET compiler compiles App_Code and any code-behind files associated with aspx, ascx, etc files. The runtime caches all the compilation results in order to quickly process later requests, and does not need to recompile again unless someone edits a file.

Ok. How can I delete the cache? Other than clearing the "Temporary ASP.NET Files" Folder...

Hi Rahul,
Your aspx page is rightly attached to your aspx.vb page. Now you need to verify that your events in this vb file are handled. For e.g. your page load method should be something like Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Similarly submit button click event should be handled with code similar to Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click

Probably you are not handling the events and as such your code might not be getting called also. Let me know if it works for you.

Thanks to all replies given. I'll try all the methods provided and come back with some feedback. Thanks. :)

Hi all,

Sorry for leaving this thread for so long... So what you mean is that whenever I made changes on aspx.vb file, I'll need to recompile the project again?

P.S: My project is super large can takes long long time to compile. Is it possible for me to compile only the part where I make changes?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.