DEV Community

Russ Hammett
Russ Hammett

Posted on • Originally published at kritner.blogspot.com on

My first ASP.NET application/Masterpage

I had been having a few issues when attempting to get asp.net applications working on my web server - not knowing much of anything about asp.net, I was under the assumption it would be similar to the ColdFusion I am used to; it was not.

The thing I didn't understand, which this entry exists to remind me (and potentially any youse out there), is AppPools. IIS seems to by default assign your web root to an appPool - the default (at least for me) being .NET framework 2.0. It is as simple as changing the Default website to a new appPool using the 4.0 framework right? Almost...

Having changed the default appPool to 4.0 framework I was now successfully compiling the standard "Hello World" .aspx - but getting run-time errors when attempting to integrate a master page into my site. A master-page is a 'template' of sorts that can be used to create similar layout/functionality across numerous sites. The run-time error was explaining that my MasterPage.master could not be found at ~/MasterPage.master - but it was there!

Luckily my wife Kristen was there (who does know ASP.net) to let me know that if I have my application within a directory in of itself, but the application is set up in a separate directory, then the "~/MasterPage.master" reference is relative to the application, not necessarily the directory that you are working in.

Simple fix? Create a new application pool on the directory where my code is actually hosted. Yay! Now everything is working without run time errors!

Top comments (5)

Collapse
 
radicalbee profile image
Abdu

None of the articles written on ASP are gaining attraction. Does this mean it is a dead stack?

Collapse
 
kritner profile image
Russ Hammett

Well I mean there is .net core now, and this was written several years ago - and even at that time MVC was a thing, and this is based in webforms.

I know webforms is still used, so I don't think it's dead by any means. But I wouldn't think there'd be too many new projects built with asp.net webforms, but that's just a feeling, no data to back it up.

Collapse
 
radicalbee profile image
Abdu

I know asp.net was booming in 2012. I saw my friends learning and implementing it. I made wrong choices in those days, but now I have an opportunity to join a bootcamp where instructors believe asp.net/.net core has a great future ahead.

Should I jump in or not? I do not want to make a wrong choice again. I have written about it here. dev.to/ajbozdar/enroll-or-not-to-e...

Your feedback is highly appreciated.

Thread Thread
 
kritner profile image
Russ Hammett

I highly enjoy working with C#, and .net core offers C# on all the major OSes, so I mean, I'd say go for it! There's a pretty good market for it here, seems like anyway. And if nothing else, it's something else for your toolbelt! :)

Thread Thread
 
radicalbee profile image
Abdu

Your words are exactly what the instructor said me. Thank you very much for the feedback. I highly appreciate it, and this will help me to redefine my career.