.ASP Do I need to compile? - asp-classic

I'm poking my head around ASP for work and I'm not sure how it works... I'm used to being able to create a HTML, PHP, ColdFusion page, put it on the webserver and execute it.
Do I need to compile ASP pages or is that just ASPX?
I just want to create an ASP page and put it on my web server to test...

You can just create an ASP or ASPX page and put it on the server to test. The web server in all those cases (ColdFusion, PHP, ASP, ASP.NET) takes care of compiling the page when it's accessed.
In ASP, I believe it is compiled(/interpreted) every time you load it, where as in ASP.NET it's compiled on first access (which is slow) and the compiled version is available for the next page load.

Related

Mixing ASP.NET pages with ASP Pages in windows server 2003 IIS

I've got a lot of Classic ASP pages in production on a Windows Server 2003 64-bit machine. I've also got .NET on there working.
I'm starting to move the ASP ajax pages (pages that receive ajax calls from the Classic ASP) to ASP.NET/C# to take advantage of the business/data/logging layer I've got set up there in C#.
I've figured on securing the ASPX pages by way of a "token" that I create in the database in ASP and then pass to the ASPX page, which then uses it to validate that it's a legit call and destroys it.
My big question is - aside from making the ASPX pages, do I need to compile the app into the same site as the ASP site? I assumed I'd do that - deploy it there alongside the ASP Classic pages, and then just call the ASPX individually as needed.
Is this strategy sound? Do I need to do anything special for performance or configuration to make ASP Classic and ASP.NET coexist well?
Thanks - this migration has been a bear because of the extreme asp classic dependency.
It will work just fine. I've seen it on several sites. Just put them all in the same directory.
Your biggest issue will be that the ASP and ASP.NET pages will each have their own SESSION and APPLICATION variables which won't be shared between the two. If you are using session variables in either it can force you into doing a lot of hacks to make it all work together well.

How to update a Kentico Aspx Template Page?

I created a template page, and a page that uses that template in Kentico. So I edited the aspx template file, but the changes arent being updated when viewing the page in the CMS. I turned off caching and everything, but I cannot get my changes viewable.
If you use web application (there are .designer.cs files in your solution) you have to rebuild the app. Or you can try changing Codebehind to CodeFile in your aspx markup.(Not really clean method but will ensure file gets build dynamically as they do under web site).
If you use web site and you tried to delete cache (CMS Site Manager->Administration->System->Clear cache) you are doing something wrong, believe me.
As a last resort you can try to clear asp.net temporary files
(C:\Windows\Microsoft.NET\Framework64\your version\Temporary ASP.NET Files). This will need IIS to be restarted.
Differences between web app. and web site are described here.

How is an ASP.NET read by the browser?

How does the browser interpret an ASP.NET webpage, hosted in IIS?
The first time the webpage is accessed, is something installed in the browser? Or ASP.NET creates "normal" HTML pages?
IIS interprets and executes the ASP.NET code and markup and sends HTML to the browser.
The browser interprets the HTML.
ASP .NET is server side. It executes remotely and delivers standard HTML page to browser
"An ASP.NET page has the extension .aspx. If a browser requests an
ASP.NET page, the server processes any executable code in the page,
before the result is sent back to the browser."
Quoted from w3schools website.
The first time the asp.net page is accessed it is compiled into a .net class (together with the code behind). There is a so called ISAPI filter installed into iis. When you access an asp.net page (a file with .aspx extension) iis will use the ISAPI filter to execute the request using class that has been compiled.
everything you need is HERE my friend

How to stop asp page downloading

I heard that it is possible to download asp pages to view the server side script. (asp classic by the way) And I want to make sure this is not possible. What steps can I take to prevent this?
This is only possible if your server is misconfigured to serve up files with the .asp extension rather than process them server side.
If you see your .asp files are being processed, the text of the script cannot be viewed by a web browser.

Changes in aspx files won't show until rebuild

As I understand it, I should be able to change an aspx file in VS, update in the browser and then see the changes without rebuilding the entire solution. For me thats not the case...
Any ideas?
Edit:
I use VS 2008, .NET 3.5 and development server. It is a Web Application project and I always need to rebuild to see the changes in the aspx files. I use master pages and aspx controls. I use edit and continue and have no problem updating the code behind files without rebuilding.
If the change is affecting code behind in any way, you need to rebuild.
If not, can you give an example of what you change so we have a little more to go by ;)
If you are using the Web Application Template (versus the web site template) and you add controls to the aspx front-end code, it will automatically add it to the <file_name>.cs.designer partial class auto-generated code behind. since this is part of the class, it needs to be compiled.
I think you need put more information into your question, like what change are you making? What version of IIS are you using? Are you using IIS or Cassini (Visual Studio Web Development Server)?

Resources