473,796 Members | 2,559 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Setting default page in deployment

QDL
Hello everyone,

is there a way to programmaticall y set the default document from a
deployment project for ASP.NET. My default page is named default.htm and I'd
like to set it as the topmost default document in IIS site properties using
the deployment project, is this possible? Tried to google but found no
answer.

TIA
Paolo
Oct 31 '06 #1
3 1457
You can do this by exporting the IIS settings and actually installing them
on the server in question. I do not have a working example right now, but
will see if I have anything written up on it.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

*************** *************** *************** ****
Think outside of the box!
*************** *************** *************** ****
"QDL" <qd*@qdl.qdlwro te in message
news:45******** *************** @reader3.news.t in.it...
Hello everyone,

is there a way to programmaticall y set the default document from a
deployment project for ASP.NET. My default page is named default.htm and
I'd like to set it as the topmost default document in IIS site properties
using the deployment project, is this possible? Tried to google but found
no answer.

TIA
Paolo


Oct 31 '06 #2
QDL
You can do this by exporting the IIS settings and actually installing them
on the server in question. I do not have a working example right now, but
will see if I have anything written up on it.
Thanx Cowboy for answering, will appreciate if you have a sample but anyway,
you pointed me the right way... I thought there was something in the
Deployment project to obtain that but I was wrong...

Thanx
Paolo
Oct 31 '06 #3
QDL
I answer myself as I found the way and may be helpful to some1:

1. In deployment project add CustomAction for OnCommit specify
InstallerClass= True and add parameter /vdir="[TARGETVDIR]"

2. Add an installer class to your aspnet project and insert this override:

Private Const EnableDefaultDo c = &H40000000&

Protected Overrides Sub OnCommitted(ByV al savedState As
System.Collecti ons.IDictionary )
Dim folderRoot, vdir As DirectoryEntry
Dim vdirname As String

Try
vdirname = Me.Context.Para meters("vdir")

folderRoot = New DirectoryEntry( "IIS://localhost/W3SVC/1/Root")
folderRoot.Refr eshCache()

vdir = folderRoot.Chil dren.Find(vdirn ame, folderRoot.Sche maClassName)

vdir.Properties ("DirBrowseFlag s").Value =
vdir.Properties ("DirBrowseFlag s").Value Or EnableDefaultDo c
vdir.Properties ("DefaultDoc"). Value = "default.ht m"

vdir.CommitChan ges()
folderRoot.Comm itChanges()
Catch ex As Exception
Finally
If (Not vdir Is Nothing) Then
vdir.Close()
End If

If (Not folderRoot Is Nothing) Then
folderRoot.Clos e()
End If
End Try
End Sub

This will enable default documents and add default.htm as the only default
document. Of course can be changed.

Hope someone will be helped by this

Paolo
Oct 31 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
2189
by: fleemo17 | last post by:
My organization is developing a set of "standards" for websites built inhouse. The first question that comes to mind is what would be a good standard default size for <p> text? 12 point? Which begs the question, what unit of measurement should we use for specifying font sizes, points or ems? Thanks. -Fleemo
0
1013
by: Joe S | last post by:
Is there a way in a deployment project to set the default values for textboxes that will be displayed in a User Interface dialog? Specifically, I want to be able to get a look at the environment and then set the defaults that will be shown when the install dialog comes up. For example, a default directory name would be based upon the Windows user id, so I'd like to set the default, but still allow them to override it using the textbox. ...
1
2582
by: CES | last post by:
All, Could someone please point me to a step by step resource on setting up a ..net Web Application on IIS. I'm having a problem setting up IIS to except a new Web Application. I'm deploying the default Asp.net Web Application as is setup by VStudio with no code changed, other then adding "Hello World to the <title> tag. I've been able to narrow down the problem to IIS by compiling the Application and deploying it to my production...
10
1785
by: johndoe | last post by:
While creating a shopping cart application I noticed a strange bug which resulted in the Constructor and everything being called twice. I was using Inherited classes ClassShowProducts inherited TemplatePage which inherited System.Web.UI.Page which I thought was the problem so I spent all day recoding everything so that ClassShowProducts was inherited from System.Web.UI.Page. Then I found out that it still happend. I then quickly narrowed it...
4
1399
by: VB Programmer | last post by:
When I set intro.aspx as the "start page" for my ASP.NET project it works perfectly in Visual Studio.net. When I use IE and open up the website in localhost (http://localhost/MySite/) it uses Default.aspx as the default start page. Any ideas? Thanks!
2
2587
by: junlia | last post by:
Hi All, I am working on a project that acts as a bridge. It does some checking with post xml data, and then redirects the request to an appropriate page. However, we find that depends on the browser cache setting (and OS), the program behaves differently. This is how it should work: 1. The client program opens a webbrowser control, using navigate2 method to post xml data to my aspx pages, eg abc.aspx
0
982
by: willem joubert | last post by:
I got the following message from Microsoft Web Hosting Customer Support ===================================================== The only file that we see located within the /web directory of your account is WebApplication7.dll. Our servers do not support custom DLL files. Also our system requires that the first page of your website is called index.aspx or default.aspx. ===================================================== The .dll files...
1
6510
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting" setting to be "E_ALL", notices are still not getting reported. The perms on my file are 664, with owner root and group root. The php.ini file is located at /usr/local/lib/php/php.ini. Any ideas why the setting does not seem to be having an effect? ...
6
7945
by: WT | last post by:
Hello, I am searching for a way to generate automatically from codebehind the <!Doctype....for asp.net pages using .net 3.5 c# and vs2008. Subidiary question: if I do a server transfert in my codebehind, do I need any Doctype or html tags in the page ? Thanks CS
0
9673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9525
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10452
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10221
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9050
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5440
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5569
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.