|
Home > Archive > Microsoft Content Management Server > November 2005 > an exception of type: {System.InvalidCastException} occurred
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
an exception of type: {System.InvalidCastException} occurred
|
|
| Nithya 2005-11-22, 5:54 pm |
| Hi,
When i am trying to access cmshttpcontext.current i am getting the
invalidcastexception error. Please help.
Dim oContext As CmsHttpContext = CmsHttpContext.Current
strSitePath = oContext.Current.RootChannel.Path &
System.Configuration.ConfigurationSettings.AppSettings.Get(BASEEASTMAN)
TIA
Nithya
| |
| Stefan [MSFT] 2005-11-23, 7:50 am |
| Hi Nithya,
in which line do you get the problem?
Which type is strSitePath dim'ed to?
I would suggest to retrieve each element separatly into a string variable to
see which element causes the problem or debug the code below using VS.NET.
Cheers,
Stefan
--
This posting is provided "AS IS" with no warranties, and confers no rights
New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
Check out the new book as well: Advanced MCMS development:
http://tinyurl.com/8ugwj
----------------------
"Nithya" <nithya.baskaran@gmail.com> wrote in message
news:1132692538.976537.228160@g44g2000cwa.googlegroups.com...
> Hi,
> When i am trying to access cmshttpcontext.current i am getting the
> invalidcastexception error. Please help.
>
> Dim oContext As CmsHttpContext = CmsHttpContext.Current
> strSitePath = oContext.Current.RootChannel.Path &
> System.Configuration.ConfigurationSettings.AppSettings.Get(BASEEASTMAN)
>
> TIA
> Nithya
>
| |
| Nithya 2005-11-29, 5:55 pm |
| Hi Stefan,
I am getting exception in the first line.
"Dim oContext As CmsHttpContext = CmsHttpContext.Current "
I am getting Invalidcast exception error.
Please let me know regarding this.
| |
| Stefan [MSFT] 2005-11-29, 5:55 pm |
| Hi Nithya,
is this code inside a MCMS template?
Cheers,
Stefan
--
This posting is provided "AS IS" with no warranties, and confers no rights
New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
Check out the new book as well: Advanced MCMS development:
http://tinyurl.com/8ugwj
----------------------
"Nithya" <nithya.baskaran@gmail.com> wrote in message
news:1133284062.439168.260700@f14g2000cwb.googlegroups.com...
> Hi Stefan,
> I am getting exception in the first line.
> "Dim oContext As CmsHttpContext = CmsHttpContext.Current "
>
> I am getting Invalidcast exception error.
>
> Please let me know regarding this.
>
| |
| Nithya 2005-11-29, 5:55 pm |
| Hi stefan,
Yes, this code is inside the CMS template.
| |
| Stefan [MSFT] 2005-11-29, 5:55 pm |
| Hi Nithya,
then you should not get this exception.
Please open a support case with Microsoft.
Cheers,
Stefan
--
This posting is provided "AS IS" with no warranties, and confers no rights
New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
Check out the new book as well: Advanced MCMS development:
http://tinyurl.com/8ugwj
----------------------
"Nithya" <nithya.baskaran@gmail.com> wrote in message
news:1133292348.361885.41660@g44g2000cwa.googlegroups.com...
> Hi stefan,
> Yes, this code is inside the CMS template.
>
|
|
|
|
|