Monday, May 10, 2010

Updating a single page in a precompiled web site.

Hi,

Problem:

I have a precompiled website in the production server.

The website is compiled with:

fixed names (use fixed names... = true)
not updatable (allow this site to be updatable = false).
I would like to re-deploy a single page, without deploying the entire website, in order to avoid regression tests.

Currently, when I precompile the website again(using publish), and deploy only a single page, by copying only the .dll and .compiled files to the bin folder in the production server, I get:

System.Web.HttpException: The file 'xxxxxxx' has not been pre-compiled, and cannot be requested.


How can I re-deploy only a single page to an existing website ?


Making this site updateable (allow this site to be updatable = false) is not an option, for security reasons.

Solution:

With "not updatable" option, all the code, including markup, will be compiled into assembly, and ASP.NET will generate .compiled file to link the page and assembly. Every publish has random filehash in .compiled file when we make change in website.

In your case, we need to copy the Bin folder of new Publish to replace the old Bin folder in server. This will update .dll and .compiled files. The .aspx files just are marker files, we don't need to update them.

The operation above is similar to re-deploy entire website. Since publish with "not updatable" option is only designed for deployment.

Happy Programming!!!

Monday, April 26, 2010

Changing the default browser setting in VS 2005 and Visual Web Developer

Hi,

I've seen a few people ask if it is possible to change what browser is launched and used when running web apps in VS 2005 and Visual Web Developer (for example: to use FireFox instead of IE). The good news is that there is an easy way to configure this. To-do this:

1) Right click on a .aspx page in your solution explorer

2) Select the "browse with" context menu option

3) In the dialog you can select or add a browser. If you want Firefox in the list, click "add" and point to the firefox.exe filename

4) Click the "Set as Default" button to make this the default browser when you run any page on the site.

Note that there is also an optional drop-down at the bottom of the dialog that lets you select the default browser window size when loading. You can choose 800x600 or 1024x768 if you want to visualize what the site will look like for people using those screen resolutions. This works for both IE and FireFox (and probably other browsers too -- those just happened to be the two I checked).

Hope this helps.

Sunday, December 20, 2009

Difference between ASPX Controls Visible and ClientVisible

.Visible:

The Visible property indicates whether a server control is rendered as an UI on the page. If this property is set to False, the control isn't rendered, and you can't operate it on the client side.

.ClientVisible:

The ClientVisible property specifies the initial visibility state of a web control on the client side. If this property is set to false, the control is rendered on a web page, but it is initially hidden on the client side.

Happy Programming!!!