0

I’m getting the following error while developing a report in SSRS 2008 R2:

Request for the permission of type 'System.Web.Aspnethostingpermission, System, Version 2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’ failed

When I use the following piece of custom code:

 System.Web.HttpContext.Current.Response.Write("< script language='javascript' >alert('From date can’t be more than the To date');< /script >")
I have searched across various sites to fix this but no use. Any help in this regard will be appreciated.

Here is the complete custom code:

Function CheckDateParameters(FromDate as Date, ToDate as Date) as Integer

If (FromDate > ToDate)  Then

System.Web.HttpContext.Current.Response.Write("< script language='javascript' >alert('From date can’t be more than the To date');< /script >") 

End If

End Function
James
  • 2,626
  • 5
  • 37
  • 51
Praveen
  • 11
  • 1
  • 5

1 Answers1

0

I think code

System.Web.HttpContext.Current.Response.Write("script language='javascript'alert('From date can’t be more than the To date');<\script>")

should be (there was missing brackets):

System.Web.HttpContext.Current.Response.Write("<script language='javascript'>alert('From date can’t be more than the To date');<\script>")

edit: http://forums.whirlpool.net.au/archive/1131887

pmaruszczyk
  • 2,157
  • 2
  • 24
  • 49
  • yes i know i missed those brackets wantedly becoz i was not able give those brackets wen raising the question... – Praveen May 13 '11 at 14:18