Click here to Skip to main content
15,913,570 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Religious question - MVC benefits vs ASP.NET? Pin
L Viljoen16-Oct-13 3:07
professionalL Viljoen16-Oct-13 3:07 
GeneralRe: Religious question - MVC benefits vs ASP.NET? Pin
Christopher Duncan16-Oct-13 3:36
Christopher Duncan16-Oct-13 3:36 
GeneralRe: Religious question - MVC benefits vs ASP.NET? Pin
L Viljoen16-Oct-13 3:40
professionalL Viljoen16-Oct-13 3:40 
GeneralRe: Religious question - MVC benefits vs ASP.NET? Pin
Christopher Duncan16-Oct-13 3:42
Christopher Duncan16-Oct-13 3:42 
GeneralRe: Religious question - MVC benefits vs ASP.NET? Pin
L Viljoen16-Oct-13 3:48
professionalL Viljoen16-Oct-13 3:48 
GeneralRe: Religious question - MVC benefits vs ASP.NET? Pin
Mycroft Holmes16-Oct-13 13:04
professionalMycroft Holmes16-Oct-13 13:04 
GeneralRe: Religious question - MVC benefits vs ASP.NET? Pin
Christopher Duncan16-Oct-13 13:17
Christopher Duncan16-Oct-13 13:17 
GeneralRe: Religious question - MVC benefits vs ASP.NET? Pin
L Viljoen16-Oct-13 3:11
professionalL Viljoen16-Oct-13 3:11 
Heres some code you can use in your asp.net page
C#
protected override object LoadPageStateFromPersistenceMedium()
    {
        object viewStateBag;
        string m_viewState = (string)Session["ViewState"];
        LosFormatter m_formatter = new LosFormatter();
        try
        {
            viewStateBag = m_formatter.Deserialize(m_viewState);
        }
        catch
        {
            return null; // throw new HttpException("The View State is invalid.");
        }
        return viewStateBag;
    }
    protected override void SavePageStateToPersistenceMedium(object viewState)
    {
        MemoryStream ms = new MemoryStream();
        LosFormatter m_formatter = new LosFormatter();
        m_formatter.Serialize(ms, viewState);
        ms.Position = 0;
        StreamReader sr = new StreamReader(ms);
        string viewStateString = sr.ReadToEnd();
        Session["ViewState"] = viewStateString;
        ms.Close();
        return;
    }


however it just need some minor adaptations to account for when a user opens more than one page at the same time (you may run into corrupted state problems)
What I do is I cancatenate a string to the veiwstate id Session["ViewState"+hashkey]
and i generate the hashkey by using a SHA hash alogoritm with the current url as input , and a whipe the session on page not IsPostback
Chona1171
Web Developer (C#), Silverlight

GeneralRe: Religious question - MVC benefits vs ASP.NET? Pin
ENOTTY16-Oct-13 9:31
ENOTTY16-Oct-13 9:31 
GeneralRe: Religious question - MVC benefits vs ASP.NET? Pin
L Viljoen16-Oct-13 18:08
professionalL Viljoen16-Oct-13 18:08 
GeneralRe: Religious question - MVC benefits vs ASP.NET? Pin
jschell16-Oct-13 8:11
jschell16-Oct-13 8:11 
GeneralRe: Religious question - MVC benefits vs ASP.NET? Pin
3n1g16-Oct-13 3:35
3n1g16-Oct-13 3:35 
GeneralRe: Religious question - MVC benefits vs ASP.NET? Pin
L Viljoen16-Oct-13 3:45
professionalL Viljoen16-Oct-13 3:45 
GeneralRe: Religious question - MVC benefits vs ASP.NET? Pin
3n1g16-Oct-13 3:52
3n1g16-Oct-13 3:52 
GeneralRe: Religious question - MVC benefits vs ASP.NET? Pin
L Viljoen16-Oct-13 4:18
professionalL Viljoen16-Oct-13 4:18 
GeneralRe: Religious question - MVC benefits vs ASP.NET? Pin
virang_2115-Oct-13 16:30
virang_2115-Oct-13 16:30 
GeneralRe: Religious question - MVC benefits vs ASP.NET? Pin
2374115-Oct-13 19:17
2374115-Oct-13 19:17 
GeneralRe: Religious question - MVC benefits vs ASP.NET? Pin
L Viljoen16-Oct-13 3:26
professionalL Viljoen16-Oct-13 3:26 
GeneralRe: Religious question - MVC benefits vs ASP.NET? Pin
2374116-Oct-13 4:30
2374116-Oct-13 4:30 
GeneralRe: Religious question - MVC benefits vs ASP.NET? Pin
L Viljoen16-Oct-13 18:06
professionalL Viljoen16-Oct-13 18:06 
GeneralRe: Religious question - MVC benefits vs ASP.NET? Pin
2374116-Oct-13 18:34
2374116-Oct-13 18:34 
GeneralRe: Religious question - MVC benefits vs ASP.NET? Pin
Mardy Git15-Oct-13 20:45
Mardy Git15-Oct-13 20:45 
GeneralRe: Religious question - MVC benefits vs ASP.NET? Pin
Mardy Git15-Oct-13 20:49
Mardy Git15-Oct-13 20:49 
GeneralRe: Religious question - MVC benefits vs ASP.NET? Pin
Rutvik Dave15-Oct-13 22:59
professionalRutvik Dave15-Oct-13 22:59 
GeneralRe: Religious question - MVC benefits vs ASP.NET? Pin
Christopher Duncan16-Oct-13 1:45
Christopher Duncan16-Oct-13 1:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.