Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

overrirde methods

Status
Not open for further replies.

logi2000

Programmer
Joined
Jun 17, 2003
Messages
221
Location
CR
i am overriding this methods, but the way i am doing it is not working properly, does anyone knows a better and effective way to overrides this methods?

thanks.

Protected Overrides Sub SavePageStateToPersistenceMedium(ByVal viewState As Object)
Session("MyViewState") = viewState
End Sub

Protected Overrides Function LoadPageStateFromPersistenceMedium() As Object
Return Session("MyViewState")
End Function
 
This is my test example using exactly your code
Code:
Public Class WebForm1
    Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: This method call is required by the Web Form Designer
        'Do not modify it using the code editor.
        InitializeComponent()
    End Sub

#End Region
    Protected Overrides Sub SavePageStateToPersistenceMedium(ByVal viewState As Object)
        Session(&quot;MyViewState&quot;) = viewState
    End Sub

    Protected Overrides Function LoadPageStateFromPersistenceMedium() As Object
        Return Session(&quot;MyViewState&quot;)
    End Function
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here
    End Sub

End Class
And Worked.
What is the problem actualy? Isnt saving view state to session?

________
George, M
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top