PDA

Click to See Complete Forum and Search --> : some code to vb.net


Arrow_Raider
Nov 22nd, 2003, 09:30 AM
I have this snipet of code i pulled off the forum on brinkster


<script language="C#" runat="server">
protected override object LoadPageStateFromPersistenceMedium() {
object o = null;
try{
o = base.LoadPageStateFromPersistenceMedium();
} catch {}
return o;
}
</script>


Its evidently supposed to ignore viewstate errors, which i get a lot on brinkster cause something is wrong with their servers and they are too lazy to fix the problem. My site is in vb.net, so like could someone convert that code into vb.net

hellswraith
Nov 22nd, 2003, 02:48 PM
Did it by hand, and didn't verify it. I don't remember what the override is in VB, but you can look that up.

protected override function LoadPageStateFromPersistenceMedium() As Object
Dim o As Object
Try
o = mybase.LoadPageStateFromPersistenceMedium()
Catch(ex As Exception)

End Try

LoadPageStateFromPersistenceMedium = o
End Function


Look at the code I translated, then look at the code you posted. It is pretty simple to do these little conversions. You should try to understand the syntax of the C# language so you can do these without problems.