Thanks Eliyahu,
I used your syntax:
Dim EnterTime As String = System.DateTime.Now.ToString
HttpContext.Current.Profile.GetPropertyValue(Enter Time)
but again the same error, here is the error details:
System.NullReferenceException was unhandled by user code
Message="Object reference not set to an instance of an object."
Source="App_global.asax.5_wxyugz"
StackTrace:
at ASP.global_asax.Session_Start(Object sender, EventArgs e) in
C:\Documents and Settings\saber\My Documents\Visual Studio
2005\WebSites\WebTesting\global.asax:line 27
at System.Web.SessionState.SessionStateModule.RaiseOn Start(EventArgs
e)
at System.Web.SessionState.SessionStateModule.OnStart (EventArgs e)
at System.Web.SessionState.SessionStateModule.Complet eAcquireState()
at
System.Web.SessionState.SessionStateModule.BeginAc quireState(Object source,
EventArgs e, AsyncCallback cb, Object extraData)
at
System.Web.HttpApplication.AsyncEventExecutionStep .System.Web.HttpApplication.IExecutionStep.Execute ()
at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step,
Boolean& completedSynchronously)
"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:ux**************@TK2MSFTNGP09.phx.gbl...
The syntax you are using is good for an aspx file for a page. In
global.asax Profile is not defined . You can access it via
HttpContext.Current with syntax:
HttpContext.Current.Profile.GetPropertyValue("Ente rTime");
Eliyahu
"Saber" <saber[.AT.]oxin.ir> wrote in message
news:en**************@TK2MSFTNGP14.phx.gbl... in <system.web> of web.config I've:
[...]
<profile>
<properties>
<add name="EnterTime" type="System.DateTime" allowAnonymous="true"/>
</properties>
</profile>
And in Session_Start of global.asax:
[...]
Profile.EnterTime = System.DateTime.Now '**** Line 26
But I get an error message in line 26:
System.NullReferenceException was unhandled by user code
Message="Object reference not set to an instance of an object."