Forum  General Visual ...  Install It!  regarding default document setting in IIS
Previous Previous
 
Next Next
New Post 10/3/2008 11:51 AM
  palli
11824 posts
1st Level Poster




Re: hiRe: regarding default document setting in IIS 
Hi !

I'm in a similar situation, but as I have been working on a launch of my first major VWG application, I have not been able to make time to study how I am going to do it. I know what I want to do, but for now I just made sure the site was up and running and will study this at a later time, hopefully soon.

The trivial way to make it work is to have the web address like: http://somehost/someapplication/form1.wgx

I hate doing it that way, and I surely would like to have it http://somehost and that would just bring up my main form1.wgx, and then have the possibility to have http://somehost/AnotherForm.wgx for specific other forms.

I will be running more than one VWG application on the same server, so http://somehost should bring up Form1.wgx of that application, but http://anotherhost should bring up Form1.wgx of another application on the same server.

Like I said, I have not studied it in detail, but from what I have gathered, this should be possible by creating new Web Site, in addition to the "Default Web Site" in IIS, and for each new Web Site you create, you assign a specific "Host Header". After that I have not tested anything.

Will post my results when I have any.

Palli

Páll Björnsson - Visual WebGui support team - Email: support@visualwebgui.com
 
New Post 10/4/2008 6:44 AM
  palli
11824 posts
1st Level Poster




Re: hiRe: regarding default document setting in IIS 
Hi !

This is what I have figured out so far.

There seems to be a "conflict of interest", regarding this setup and I'm not sure that this can be done without some scripting. The VWG setup for IIS requires you to add the .WGX extension and clear the checkmark for "verify the file exists", meaning that your Form1.wgx does not need to exist.

On the other hand the default document handling of IIS needs the default document to exist to be able to load it. That means that it has no effect of adding the Form1.wgx as the top default document for your web site, as it does not exist, so it will never work.

Remember that in IIS, the default document is not "applied" unless the requested webaddress is for a directory or application, that is not referencing a specific page.

From what I've figured out so far, the easyest way, requiring minimal scripting, to get the user to the default mainform when referencing the application with something like http://myhost.domain.ext would be to put a document on the app folder, like LoadDefaultMainform.aspx and in that aspx file you have just the following lines:
<%
Response.Redirect("Form1.wgx");
 %>

In you IIS app setup, you make sure this default document is on the top of the list of default documents and then you're done!

This makes all requests for http://myhost.domain.ext be redirected to Form1.wgx, while requests for specific pages like http://myhost.domain.ext/Admin.wgx will go to the correct Admin form.

Another approach, with similar or same results would be to add your default .aspx document to your project and just add something like the following to the .vb code for it (in my case I just added Default.aspx):

Public Partial Class _Default
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not HttpContext.Current.Request.RawUrl.ToUpper.Contains(".WGX") Then
            HttpContext.Current.Response.Redirect("Form1.wgx", True)
        End If
    End Sub

End Class

You still have to change your IIS config for the Default document handling. This is similar to Jay's approach, but in this case the redirection does not take place unless your request does not include and reference to a .WGX page.

I donno if this is the most elegant way, and if this was exactly what you was looking for, but both of these methods are working quite well for me, and do exactly what I was looking for.


Palli

Páll Björnsson - Visual WebGui support team - Email: support@visualwebgui.com
 
New Post 10/4/2008 2:55 PM
  palli
11824 posts
1st Level Poster




Re: hiRe: regarding default document setting in IIS 
Hi !

Two things.... silly me, of course my code is allmost an identical solution to what Jay suggested in the first place! The searching for .WGX is probably never needed, as the default document is not applied unless there is no .WGX in the url so there is probably not any point in searching for that within the url anyway.

Second, I reread through your post, praveen.chitturi, and came to the conclution that maybe you are just asking about how to operate the IIS to set a different default document than default.aspx. If so, then I donno a way to do it via web.config, but I know of an easy way to do it via the IIS management tool.

Palli

Páll Björnsson - Visual WebGui support team - Email: support@visualwebgui.com
 
New Post 10/6/2008 2:40 AM
  dror.shahak
302 posts
3rd Level Poster




Re: hiRe: regarding default document setting in IIS 
Hi guys,
Well, Palli and Jay are correct essentially.
The way to do it is to use a 'redircet' in an asp.net page or preferably in an HTML page as it is not as heavy an action.
Another idea - perhaps you can save the going back and forth if you use 'Server.Transfer' instead of 'Response.Recdirect'.

praveen.chitturi,
please see Ori Cohen's response to you here

Tell us if this helped you.

Thanks,
Dror Shahak
The Visual WebGui Team

Dror Shahak, The Visual WebGui Team
 
Previous Previous
 
Next Next
  Forum  General Visual ...  Install It!  regarding default document setting in IIS
CompanionKit Bottom
.NET Web, Cloud and Mobile application delivery platform | Sitemap | Terms of Use | Privacy Statement | Copyright © 2005-2011 Visual WebGui®       Visual WebGui weblog on ASP.NET Visual WebGui Group on LinkedIn Visual WebGui updates on Twitter Visual WebGui Page on Facebook Visual WebGui YouTube Channel Visual WebGui Platform News RSS