Tengo problemas a la hora de pasar datos de una aspx a otra. en un principio lo hacia así:
Código vb.net:
Ver original
Response.Redirect(String.Format("ValidarHoja.aspx?identificador={0}&nombre={1}&codigolinea={2}&ceco={3}&orden={4}" & _ "&proyecto={5}&fecha={6}&facturable={7}&importeTotal={8}" & _ "&importekm={9}&elementopepkm={10}&cuentakm={11}" & _ "&importeap={12}&elementopepap={13}&cuentaap={14}" & _ "&importepark={15}&elementopeppark={16}&cuentapark={17}" & _ "&importealoj={18}&elementopepaloj={19}&cuentaaloj={20}" & _ "&importebitrans={21}&elementopepbitrans={22}&cuentabitrans={23}" & _ "&importevehi={24}&elementopepvehi={25}&cuentavehi={26}" & _ "&importecomb={27}&elementopepcomb={28}&cuentacomb={29}", hoja, nombre, codigolinea, ceco, orden, Me.TxtProyectoVRLG.Text, fechaformato, Me.RadioButtonFacturableVRLG.SelectedItem.Value, Me.TextTotGastosCantiVRLG.Text, importekm, Me.TextElementoPepKmVRLG.Text, cuentaKm, importeap, Me.TextElementoPepApVRLG.Text, cuentaAp, importepark, Me.TextElementoPepParkVRLG.Text, cuentaParking, importealoj, Me.TextElementoPepAlojVRLG.Text, cuentaAlojamiento, importebi, Me.TextElementoPepBiTransVRLG.Text, cuentaBiTrans, importealki, Me.TextElementoPepAlVehiVRLG.Text, cuentaAlVehi, importecomb, Me.TextElementoPepComVehiVRLG.Text, cuentaCombustible))
Pero como veis esto se reflejaria en la barra de direcciones y no kiero que se refleje. Para ello cree una clase llamada DatosG.vb en la que tengo lo siguiente:
Código vb.net:
Ver original
Public Class DatosG Public Property importekm() As Decimal Get Return m_importekm End Get Set(ByVal value As Decimal) m_importekm = value End Set End Property Private m_importekm As Decimal Public Property importeap() As Decimal Get Return m_importeap End Get Set(ByVal value As Decimal) m_importeap = value End Set End Property Private m_importeap As String Public Property importepark() As Decimal Get Return m_importepark End Get Set(ByVal value As Decimal) m_importepark = value End Set End Property Private m_importepark As Decimal Public Property importealoj() As Decimal Get Return m_importealoj End Get Set(ByVal value As Decimal) m_importealoj = value End Set End Property Private m_importealoj As Decimal Public Property importebi() As Decimal Get Return m_importebi End Get Set(ByVal value As Decimal) m_importebi = value End Set End Property Private m_importebi As Decimal Public Property importealki() As Decimal Get Return m_importealki End Get Set(ByVal value As Decimal) m_importealki = value End Set End Property Private m_importealki As Decimal Public Property importecomb() As Decimal Get Return m_importecomb End Get Set(ByVal value As Decimal) m_importecomb = value End Set End Property Private m_importecomb As Decimal Public Property importemanu() As Decimal Get Return m_importemanu End Get Set(ByVal value As Decimal) m_importemanu = value End Set End Property Private m_importemanu As Decimal Public Property importerela() As Decimal Get Return m_importerela End Get Set(ByVal value As Decimal) m_importerela = value End Set End Property Private m_importerela As String Public Property importeotros() As Decimal Get Return m_importeotros End Get Set(ByVal value As Decimal) m_importeotros = value End Set End Property Private m_importeotros As Decimal Public Property importesub() As Decimal Get Return m_importesub End Get Set(ByVal value As Decimal) m_importesub = value End Set End Property Private m_importesub As Decimal Public Property importeferi() As Decimal Get Return m_importeferi End Get Set(ByVal value As Decimal) m_importeferi = value End Set End Property Private m_importeferi As Decimal Public Property importeregla() As Decimal Get Return m_importeregla End Get Set(ByVal value As Decimal) m_importeregla = value End Set End Property Private m_importeregla As Decimal Public Property importecata() As Decimal Get Return m_importecata End Get Set(ByVal value As Decimal) m_importecata = value End Set End Property Private m_importecata As Decimal Public Property importeinter() As Decimal Get Return m_importeinter End Get Set(ByVal value As Decimal) m_importeinter = value End Set End Property Private m_importeinter As Decimal Public Property importegastexcep() As Decimal Get Return m_importegastexcep End Get Set(ByVal value As Decimal) m_importegastexcep = value End Set End Property Private m_importegastexcep As Decimal End Class
Y al darle a un boton de mi aplicacion lo que hago es lo siguiente:
Código vb.net:
Ver original
Dim datoG As New DatosG() datoG.importekm = CDec(Me.TextImporteKmVRLG.Text) datoG.importeap = CDec(Me.TextImporteApVRLG.Text) datoG.importepark = CDec(Me.TextImporteParkVRLG.Text) datoG.importealoj = CDec(Me.TextImporteAlojVRLG.Text) datoG.importebi = CDec(Me.TextImporteBiTransVRLG.Text) datoG.importealki = CDec(Me.TextImporteAlVehiVRLG.Text) datoG.importecomb = CDec(Me.TextImporteComVehiVRLG.Text)
Y para recogerlos no hace falta nada mas que poner lo siguiente:
Código vb.net:
Ver original
Dim datoG As DatosG = TryCast(Session("datosG"), DatosG) importekm = datoG.importekm
No se por que me da error a la hora de recoger los valores. Es como si no se guardarian.
¿Alguien me puede ayudar?