开发者

How the websites should be organised?

开发者 https://www.devze.com 2022-12-12 07:22 出处:网络
For example how this site is organized? What i do not underst开发者_JAVA百科and is what they upload to the Microsoft server?

For example how this site is organized?

What i do not underst开发者_JAVA百科and is what they upload to the Microsoft server?

I have created, with Visual studio, a very small web-page and i have to upload the whole site, even after the smallest change...


The usual approach is to replace everything with xcopy or the publish function in visual-studio, and in some cases replacing everything is the only approach - for example if you're using the web-application project model everything gets packaged into a single assembly and there you go - even to apply a small change you'll have to re-deploy the whole thing.

An alternative to this could be the Website model in visual studio, using which you should be able to deploy single code files on your server and they should be picked-up if you re-start the website from the IIS management tool. This model - in fact - works in a different way compared to the web-application project model. It's just a bunch of code files that will be dynamically compiled by the ASP.NET runtime.

Even if possible though - I wouldn't suggest the approach of deploying single files - as this is easily error prone (you deploy the code-behind and could easily forget to deploy the aspx counterpart, or similar). Unless you're delpoying Gigs of stuff over slow-networks, redeploying the whole thing is always the safest bet.

Have a look at this and this interesting links to find out more about website and web-application project models in visual studio.


It really depends a lot on how you're building your app.

If you're in VS and you're doing an ASP.Net site, then you can either do it as a Website Project, or as a Web Application project.

in the former case, your files will remain as aspx and .aspx.cs files and you xcopy (or FTP) whichever files change. if you want logic that's outside the scope of a single page, you'll either create a separate class library project or else use the App_code directory.

In the latter case, you'll compile all the logic into one or more .dll files that get copied to your site's /bin directory, and any number of aspx files that can either stay as such or be embedded (recommend leaving them as aspx files). Again, if an aspx file changes, you just movethe one that changed, if anything in the dll changes, you replace a whole dll.

All that said, a huge chunk of what's on the site you posted is probably being pulled out of the database. Most sites now dont' have content on pages, they just have organizational (view) logic on paes, and have other classes which fetch the actual content out of a database to serve up. This allows greater reuse and means that the 4,000 pages (number chosen at random) on MSDN don't have to be each coded individually as an HTML page.


After Googling i think, the check-box Use fixed naming and single page assemblies in the publish Website form of the Visual studio, is the right choice.

Although it might slow things down...

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号