Novo

Forum kao aplikacija na telefonu

Dodajte forum na početni ekran i koristite ga kao aplikaciju, sa menijem na dnu ekrana.

  • 1 odgovor
  • 3.558 pregleda

Najnovija ↓

VB funkcije napisati u C# 27.12.2006. u 06:09 · pre 241 mesec #1
Code:

    Private _refreshState As Boolean
    Private _isRefresh As Boolean
    Protected Overrides Sub LoadViewState(ByVal savedState As Object)
        Dim AllStates As Object() = savedState
        MyBase.LoadViewState(AllStates(0))
        _refreshState = Boolean.Parse(AllStates(1))
        _isRefresh = _refreshState = Session("__ISREFRESH")
    End Sub

    Protected Overrides Function SaveViewState() As Object
        Session("__ISREFRESH") = _refreshState
        Dim AllStates() As Object = New Object(2) {}
        AllStates(0) = MyBase.SaveViewState
        AllStates(1) = Not (_refreshState)
        Return AllStates

    End Function

Ako bi neko mogao da mi pomogne da ovaj kod u VB napisem u C#.
Potpis
Shoot for the moon. Even if you miss, you'll land among the stars.
Les Brown
Re: VB funkcije napisati u C# 27.12.2006. u 06:23 · pre 241 mesec #2
Nasao sam resenje :) Pa ako nekome bude potreban da sazna da li je stranica refreshovana evo :
Code:


    protected bool _refreshState;
    protected bool _isRefresh;
    protected override void LoadViewState(object savedState)
    {
        object[] allStates = (object[])savedState;
        base.LoadViewState(allStates[0]);
        _refreshState = (bool)allStates[1];
        _isRefresh = _refreshState == (bool)Session["__ISREFRESH"];
    }
    protected override object SaveViewState()
    {
        Session["__ISREFRESH"] = _refreshState;
        object[] allStates = new object[2];
        allStates[0] = base.SaveViewState();
        allStates[1] = !_refreshState;
        return allStates;
    }

Potpis
Shoot for the moon. Even if you miss, you'll land among the stars.
Les Brown
Prijavite se da biste odgovorili u ovoj temi.PrijavaRegistracija

Premeštanje teme