asp.net - Can I use System.Web.UI.Page in console application? -
i want test function in web page. have way use system.web.ui.page in console application , put in session , test way?
i created test class , inherit page not put session in it. when type "mypage." show below, not see come out after "."
<testclass()> public class unittest2 inherits system.web.ui.page dim mypage = new system.web.ui.page mypage. end class
please help!
update: below code seemed pass compiler
<testclass()> public class unittest2 <testmethod()> public sub testcheckrules() dim mypage testwebpage = new testwebpage mypage.testsession() end sub end class public class testwebpage inherits system.web.ui.page public sub new() end sub public sub testsession() dim firstname string = "john" dim lastname string = "smith" dim city string = "seattle" session("firstname") = firstname session("lastname") = lastname session("city") = city end sub
end class
then when ran got following error: exception of type 'system.web.httpexception' occurred in system.web.dll not handled in user code
additional information: session state can used when enablesessionstate set true, either in configuration file or in page directive. please make sure system.web.sessionstatemodule or custom session state module included in \\ section in application configuration.
Comments
Post a Comment