Forum  General Visual ...  How do I...?  deploy on IIS5
Previous Previous
 
Next Next
New Post 4/17/2012 1:15 AM
  JamesC
849 posts
www.redcastle.co.uk
1st Level Poster




Re: deploy on IIS5  

Hi Winanjaya,

your login form is just a form then and not a vwg login form

public

partial class Login : Form, ILogonForm

(you'll need a using Gizmox.Webgui.Common.Interfaces)

what does it say in your web.config for your defaul.wgx registartion?

it should probably read like this so that it uses the vwg authentication method:

<

Application Code="Default" Type="WebClient.Default, WebClient" Authentication="Default" Stateless="False" ForceSSL="False" />

PS the Authentication=Default does not refer to the fact that your form is called Default.wgx it means that it is using the applications default method of authentication (you can have multiple login forms different ones and you can set that some forms have no authentication)

you should then not have to do the redirects - your start form will detect that IsLoggedOn = False and display the login form instead

here's a short video (albeit slightly out of date) that shows the concept:

http://www.visualwebgui.com/Developers/KB/tabid/654/article/how_to_create_a_logon_form/Default.aspx?category=Code1.Code.Code1

cheers james

 
New Post 4/17/2012 6:27 AM
  winanjaya
305 posts
3rd Level Poster


Re: deploy on IIS5  

 Thanks JamesC, 

but how for the action of Logout_Link  as below?..

I was unable to just put VWGContext.Current.IsLoggedOn = false; .. then it does not automatically redirect to Login.wgx..

or do I need to do like codes below?

 private void lnkLogout_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)

        {

            VWGContext.Current.IsLoggedOn = false;

            VWGContext.Current.Redirect("/Login.wgx");

        }

 
New Post 4/21/2012 4:34 AM
  palli
14298 posts
1st Level Poster




Re: deploy on IIS5  

Hi Winanjaya,

Glad you got this far, thanks to James.

If global authentication is active on your application (see below on global and per form) the authentication mechanism in Visual WebGui will intercept any request that will be directed to your application and VWGContext.Current.IsLoggedOn = false, then it will fire up the logon form. This means that in order to fire up the logon form the client has to issue a request. Setting VWGContext.Current.IsLoggedOn = false within serverside code will not make the client issue any request, not yet, but it will on the next KeepConnected request or if you have a timer active. Adding that Redirect will make the client issue that needed request, but you should not redirect directly to the logon form. You should redirect to your mainform, and as I said above, Visual WebGui will intercept that request and automatically fire up the logon form.

There are two flavors of IsLoggedOn, the ones I called Global and per form authentication. The Global authentication is set like here where you have the same logon form for the whole of your application. The per form authentication has a code sample here. What you are using above, VWGContext.Current.IsLoggedOn, is a per form authentication, meaning that you are setting the IsLoggedOn state for the current context only, as opposed to set VWGContext.Current.Session.IsLoggedOn, which will affect all your application as explained by the code sample.

Hope this helps,

Palli

 

 


Páll Björnsson - Visual WebGui support team - Email: support@visualwebgui.com
 
New Post 4/25/2012 12:51 AM
  winanjaya
305 posts
3rd Level Poster


Re: deploy on IIS5  

 Thanks Palli 

 
New Post 4/26/2012 5:01 PM
  palli
14298 posts
1st Level Poster




Re: deploy on IIS5  

Hi Winanjaya,

You are welcome,

Palli

 


Páll Björnsson - Visual WebGui support team - Email: support@visualwebgui.com
 
Previous Previous
 
Next Next
  Forum  General Visual ...  How do I...?  deploy on IIS5
.NET HTML5 Web, Cloud and Mobile application delivery | Sitemap | Terms of Use | Privacy Statement | Copyright © 2005-2012 Visual WebGui®       Visual WebGui weblog on ASP.NET Gizmox Blog Visual WebGui Group on LinkedIn Visual WebGui updates on Twitter Visual WebGui Page on Facebook Visual WebGui YouTube Channel Visual WebGui Platform News RSS