Adventures in ASP.NET
Posted: Wed May 19, 2010 8:19 am
				
				I took a bit of a break from PHP coding to get more comfortable with ASP.NET. I was looking into possibly using it to create a basic PBBG. However, I have come to the conclusion that it would be much more difficult to use for an RPG than PHP. 
ASP.NET is a great web platform. I was already quite familiar with C#, but if someone doesn't know how to use it, it could take a long time to first get up to speed with C# or VB.NET, and then learn the details of ASP.NET. However, it is an extremely powerful platform for enterprise applications. Master Pages is a great templating feature for webpage layouts that I wish was in PHP. The server control model can save tons of time as well, since you only have to add one ASP.NET element to the page, and it is rendered by the ASP.NET engine using one or more HTML elements, automatic Javascript code, etc. to render the element just right. ASP.NET AJAX also simplifies AJAX and Javascript development by freeing up the developer from dealing with browser differences.
With all of these pluses, I ran into some serious trouble trying to use ASP.NET for a web game. It is very hard to drop down into dynamic page writing, because ASP.NET works on a higher level. For enterprise applications where the form is static, and the data is dynamic, this works great, and really unclutters the page. I would use ASP.NET in a heartbeat over PHP for such tasks. But when both the form of the page and the data is dynamic, ASP.NET just isn't the easiest tool to use for the task. Instead of being able to make decisions in your HTML while rendering the page like PHP does, you have to create Page objects in your code, create instances of new ASP.NET elements and then use methods of the Page object to programmaticly add those ASP.NET elements to the page, and intersperse that with Placeholder objects which must be injected with text through C# code for all non-server control elements. Then it takes quite a bit more code to correctly arrange these dynamic elements on the page. This is quite a bit more work versus PHP. Making an entire PBBG (which uses tons of both dynamic page layouts and dynamic data) would be a nightmare in ASP.NET.
I hope maybe this has been helpful for anyone interested in using ASP.NET for browser-based RPGs.
			ASP.NET is a great web platform. I was already quite familiar with C#, but if someone doesn't know how to use it, it could take a long time to first get up to speed with C# or VB.NET, and then learn the details of ASP.NET. However, it is an extremely powerful platform for enterprise applications. Master Pages is a great templating feature for webpage layouts that I wish was in PHP. The server control model can save tons of time as well, since you only have to add one ASP.NET element to the page, and it is rendered by the ASP.NET engine using one or more HTML elements, automatic Javascript code, etc. to render the element just right. ASP.NET AJAX also simplifies AJAX and Javascript development by freeing up the developer from dealing with browser differences.
With all of these pluses, I ran into some serious trouble trying to use ASP.NET for a web game. It is very hard to drop down into dynamic page writing, because ASP.NET works on a higher level. For enterprise applications where the form is static, and the data is dynamic, this works great, and really unclutters the page. I would use ASP.NET in a heartbeat over PHP for such tasks. But when both the form of the page and the data is dynamic, ASP.NET just isn't the easiest tool to use for the task. Instead of being able to make decisions in your HTML while rendering the page like PHP does, you have to create Page objects in your code, create instances of new ASP.NET elements and then use methods of the Page object to programmaticly add those ASP.NET elements to the page, and intersperse that with Placeholder objects which must be injected with text through C# code for all non-server control elements. Then it takes quite a bit more code to correctly arrange these dynamic elements on the page. This is quite a bit more work versus PHP. Making an entire PBBG (which uses tons of both dynamic page layouts and dynamic data) would be a nightmare in ASP.NET.
I hope maybe this has been helpful for anyone interested in using ASP.NET for browser-based RPGs.
