PDA

View Full Version : [CLOSED] Session Value not available in Remote page loaded using EXT Window



jamesand
Jul 08, 2013, 8:17 PM
Hi, I'm having a problem using ext.net window. I have a gridpanel with a button in each row. when one button is clicked the id of the row is stored in a session variable and then the window is opened:


wdwFormularioGrupoAbonos.LoadContent()
wdwFormularioGrupoAbonos.Show()

In the Page Load of the page, the session variable is read in order to show the details of the id selected. But the session variable is empty. it works fine in my local machine and doesn't work in the server.

do you know why is it happening or if there are a better way to pass parameters to window?

thank you in advance.

Daniil
Jul 09, 2013, 4:48 AM
Hi @jamesand,

Does the Window load an iframe? If so, what are the URLs of the parent page and the iframe?

jamesand
Jul 10, 2013, 2:38 PM
Yes the window load an iframe. I already fixed it by passing the ID in the URL:



<ext:CommandColumn ID="CommandColumn1" runat="server">
<Commands>
<ext:GridCommand Icon="UserEdit" CommandName="ModificarCliente">
<ToolTip Text="Modificar Cliente" />
</ext:GridCommand>
</Commands>
<DirectEvents>
<Command OnEvent="rptClientesCommand">
<ExtraParams>
<ext:Parameter Name="idCliente" Value="record.data.ID_CLIENTE" Mode="Raw" />
</ExtraParams>
</Command>
</DirectEvents>
</ext:CommandColumn>




Public Sub rptClientesCommand(ByVal sender As Object, ByVal e As Ext.Net.DirectEventArgs)

Dim strPathAndQuery As String = "GestionClientes.aspx"
Dim strUrl As String = HttpContext.Current.Request.Url.AbsoluteUri.Replac e(strPathAndQuery, "")

idCliente = Integer.Parse(e.ExtraParams.Item("idCliente"))

Dim componentLoader As New Ext.Net.ComponentLoader
componentLoader.Url = strUrl & "FormularioCliente.aspx?idCliente=" & idCliente
componentLoader.Mode = Ext.Net.LoadMode.Frame

wdwFormularioCliente.Loader = componentLoader

wdwFormularioCliente.LoadContent()
wdwFormularioCliente.Show()

End Sub


But when it doesn't show the window. what i have to do is to load the content of the window in the load of the gridpanel:



Protected Sub GridPanel1_Load(sender As Object, e As System.EventArgs) Handles GridPanel1.Load

Dim strPathAndQuery As String = "GestionClientes.aspx"
Dim strUrl As String = HttpContext.Current.Request.Url.AbsoluteUri.Replac e(strPathAndQuery, "")

Dim componentLoader As New Ext.Net.ComponentLoader
componentLoader.Url = strUrl & "FormularioCliente.aspx"
componentLoader.Mode = Ext.Net.LoadMode.Frame

wdwFormularioCliente.Width = Unit.Pixel(1000)
wdwFormularioCliente.Height = Unit.Pixel(600)
wdwFormularioCliente.Collapsible = True
wdwFormularioCliente.Maximizable = True
wdwFormularioCliente.Title = "Formulario de cliente"
wdwFormularioCliente.Loader = componentLoader
wdwFormularioCliente.Hidden = True

End Sub



There is a better way to do this?

Baidaly
Jul 11, 2013, 12:35 AM
Hello!


In the Page Load of the page, the session variable is read in order to show the details of the id selected. But the session variable is empty. it works fine in my local machine and doesn't work in the server.

It is interesting it works on your machine but doesn't on IIS. You should review the configuration of your server:

http://stackoverflow.com/questions/8094840/
http://msdn.microsoft.com/en-us/library/ms178586.aspx

Daniil
Jul 11, 2013, 4:59 AM
This stackoverflow question looks related to the problem.
http://stackoverflow.com/questions/6368750/session-variables-not-saved-when-page-is-in-an-iframe

jamesand
Jul 11, 2013, 12:41 PM
Thank you all for your reply, but I finally decided to open the window like this:

http://examples2.ext.net/default.aspx#/GridPanel/Miscellaneous/Details_Window_Remote/

Daniil
Jul 11, 2013, 1:09 PM
A nice decision.

Can we close the thread?

jamesand
Jul 11, 2013, 1:12 PM
Yes indeed ;)