Forum  General Visual ...  How do I...?  Redirect .aspx page to .wgx firing form_Load
Previous Previous
 
Next Next
New Post 2/23/2012 9:24 AM
  informatec
26 posts
www.informatec.com.br
No Ranking


Redirect .aspx page to .wgx firing form_Load 

Hello!

I've been searching for an answer all day long, but couldn't find any.

I have two diferent login pages: frmLogon.wgx (wich is a VWG page) and frmLogonAlt.aspx (wich is an asp.net page and I need to use to link with third part applications).

My frmLogonAlt.aspx code is quite simple. I only have a Response.Redirect(frmLogon.wgx) with some parameters. In my frmLogon.wgx code I have some steps in form_Load method that I need to be executed.

Here's my problem:

When I open frmLogonAlt.aspx and execute the redirect code, it's redirected to frmLogon.wgx and form_Load is fired. Perfect!

When I open frmLogon.wgx and then go to frmLogonAlt.aspx (same browser session) I execute the redirect from frmLogonAlt.aspx and I'm redirected to frmLogon.wgx, but form_Load is not fired any longer.

I've seen some issues like this, but redirecting from a VWG page to another. You recommended to use Transfer instead of Redirect, but I can't use Transfer from an aspx page to wgx. I've already tried to disable caching (Browser and Web.config), but nothing changes.

Do you have any idea about what to do?

Thanks!

 

Renan Vasconcelos

----------------------------

Informatec

Sao Paulo - Brazil

 
New Post 2/25/2012 12:29 PM
  palli
14287 posts
1st Level Poster




Re: Redirect .aspx page to .wgx firing form_Load 

Hi Renan,

This is a by design behaviour. What you are seeing is that the first time you hit a .wgx page, a new context is created for the page (form) and the Load event fires. The next time you hit the page, the context is already there, so the same context is used (same local variables etc) and no load event is fired.

The easiest way of forcing a new instance for every redirect, is to declare a static counter variable and increment it before you do the redirect and then use the vwginstance query parameter like Redirect(string.Format("frmLogon.wgx?vwginstance={0}",yourCounter).

This will force a new instance every time.

Hope this helps,

Palli

 


Páll Björnsson - Visual WebGui support team - Email: support@visualwebgui.com
 
New Post 2/27/2012 8:48 AM
  informatec
26 posts
www.informatec.com.br
No Ranking


Re: Redirect .aspx page to .wgx firing form_Load 

Palli,

Using the vwginstance query parameter worked perfectly!

Thank you very much for your help and sorry for wasting your time with such a fool question. I knew it was something simple that I was missing!

 

Renan Vasconcelos

----------------------------

Informatec

Sao Paulo - Brazil

 
New Post 3/3/2012 12:38 AM
  palli
14287 posts
1st Level Poster




Re: Redirect .aspx page to .wgx firing form_Load 

Hi Renan,

You are welcome and thanks for the confirmation.

Palli

 


Páll Björnsson - Visual WebGui support team - Email: support@visualwebgui.com
 
Previous Previous
 
Next Next
  Forum  General Visual ...  How do I...?  Redirect .aspx page to .wgx firing form_Load
.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