Search
 Search
GET THE HOTEST NEWS ABOUT VISUAL WEBGUI.
CREATE LINE OF BUSINESS SILVERLIGHT APPLICATIONS IN NO TIME.
EVERY THING YOU NEED TO START DEVELOPING WITH VISUAL WEBGUI.
SEE VISUAL WEBGUI SHOW CASES FROM AROUND THE WORLD.
ALL THE RESOURCES YOU NEED TO START BUILDING VISUAL WEBGUI APPLICATIONS TODAY.
SHARE AND FIND VISUAL WEBGUI RESOURCES.
TALK WITH OTHER VISUAL WEBGUI DEVELOPERS.
 
Gateways symptoms
Location: BlogsItzik Spitzen's blog    
Posted by: Itzik Spitzen 1/1/2008

Hi All,

Recently I've got few issues directed to me with Gateway problems; the most common ones were:

1. Symptom: Gateway got page not found error 404   -   Cause: Session is lost

2. Symptom: Gateway does not refresh data              -   Cause: Data is cached

The first case:

There are a few good reasons why applications loose their session (e.g., web.config is changed; cookies data length exceeds the maximal length allowed and other stuff). One less common cause is a deletion of a directory under the virtual directory root, you can observe this google search results to get some additional info regarding this cause.

Detecting that your session has lost can be easily achieved by adding any control with different states to your form and changing it before the gateway's invocation (e.g., add a TextBox control with no text in on initialization and type some text in it before you perform the operation which causes gateway invocation). If the session is lost, your application will restart and controls state will be initialized (e.g., the TextBox text will be empty again).

Overcoming the directory deletion problem can be achieved by using the ASP.NET built in temporary directory mechanism which provides the application with a directory on which temporary directories can be created and deleted without side effects. Getting this directory on runtime is done by:

string strDir = Path.Combine(HttpRuntime.CodegenDir, "my-root");

By using this directory as a temporary solution, you also gain automatic deletion of all files and folders created during a session by .NET Framework when the session is ended.

The second case:

Caching the written data can often happen when using a gateways; detecting such phenomenon is very easy since the data got back from the gateway the first time will be identical all other next times until the current session ends; also, debugging the gateway will discover that the GatewayHandler and GatewayWriter processing methods are not being called.

All you need to do in order to prevent this kind of caching is command:

HttpContext.Current.Response.Expires = -1;

Before writing a response, that is either in IGatwayHandler.GetGatewayHandler() method or in GatewayWriter.ProcessRequest() method, depending on your gateway implementation type.

Best regard,
Itzik Spitzen

Permalink |  Trackback

Comments (1)  
Re: Gateways symptoms    By mab on 1/3/2008
Hi,

I read your article carefully, because I have a problem with the gateway. Firs off, I confess, I know almost nothing about web and asp.net stuff. That’s why I stated using VWG. Until now, as I’m using only Windows Forms and everything as worked, VWG as been an wonderful tool. I’m building a DataBase application, and at this moment I intend to allow users to print, what they see, in a ListView, shown in a VWG Form, clicking in a Button.

I tried, with HtmlBox.url, in another Form, as I have seen in the forum, and its works fine, if I call the gateway, from the initial Form, but not from the other ( the one that contains the ListView and the Button).

The message I receive is: page not found error 404. I tried your advices, with a TextBox, but it not worked.


Can You HELP me?


Go To Blogs

Copyright © 2005-2008 Visual WebGui®   Terms Of Use  Privacy Statement
Visual WebGui is copyright 2005-2008 by Gizmox