asp.net - Convert VB code after framework update -


the framework has been updated on computer , i've updated visual studio 2008 2010, there part of code won't work.

public property itemcount() integer                     dim val object = viewstate("itemcount")             return if(val isnot nothing, cint(val), 0)         end         set(byval value integer)             viewstate("itemcount") = value         end set     end property 

the "return if(val isnot nothing, cint(val), 0)" part of code not work error: description: error occurred during compilation of resource required service request. please review following specific error details , modify source code appropriately.

compiler error message: bc30201: expression expected.

source error:

line 21:
line 22: dim val object = viewstate("itemcount")
line 23: return if(val isnot nothing, cint(val), 0)
line 24: end
line 25: set(byval value integer

is there converter can use bring part of code upto date, i'm assuming code that's been outdated. thanks.

get         dim val object = viewstate("itemcount")         ' return if(val isnot nothing, cint(val), 0)         if val nothing             return 0         else             return (cint(val))         end if      end 

try this, should work.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -