System.NotImplementedException: The method or operation is not implemented.

858 views
Skip to first unread message

Mutiullah Haider

unread,
Sep 27, 2011, 1:45:58 PM9/27/11
to WebSharper

Hi all,
I am getting the System.NotImplementedException error. Follow is the
sample code.

#light

#I @"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0"
#I @"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5"
#I @"C:\Program Files\IntelliFactory\WebSharper\2.3"
#r "IntelliFactory.WebSharper.dll"
#r "IntelliFactory.WebSharper.Collections.dll"
#r "IntelliFactory.WebSharper.Control.dll"
#r "IntelliFactory.WebSharper.Formlet.dll"
#r "IntelliFactory.WebSharper.Html.dll"
open IntelliFactory.WebSharper
open IntelliFactory.WebSharper.Formlet
open IntelliFactory.WebSharper.Formlet.Controls
open IntelliFactory.WebSharper.Html
open IntelliFactory.WebSharper.Collections
open IntelliFactory.WebSharper.Control



> let welcome = P [Text "Welcome"]
- ;;
Binding session to 'C:\Program Files\IntelliFactory\WebSharper
\2.3\IntelliFactory.WebSharper.Html.dll'...
System.NotImplementedException: The method or operation is not
implemented.
at IntelliFactory.WebSharper.Dom.Document.get_Current()
at IntelliFactory.WebSharper.Html.Element.New(IHtmlProvider html,
String name)
at IntelliFactory.WebSharper.Html.TagBuilder.NewTag[a64](String
name, IEnumerable`1 children)
at <StartupCode$FSI_0003>.$FSI_0003.main@()
Stopped due to error

Anton Tayanovskyy

unread,
Sep 27, 2011, 1:47:12 PM9/27/11
to websh...@googlegroups.com
This is because you are calling a client-side method on the server,
and it is not implemented for the server context. A clearer example
would involve the use of jQuery or DOM. They do not work on the
server.

Cheers,

Anton

--
Kind Regards,
Anton Tayanovskyy

WebSharper™ - type-safe JavaScript in F#
http://intellifactory.com

Mutiullah Haider

unread,
Sep 27, 2011, 2:12:31 PM9/27/11
to WebSharper


Can you explain difference between client side and server side methods
or how I know if this is client side method or the server side method.

The thing confuse me that I got though some of the examples on the web-
sharper website, but all those examples are using separate modules for
client or server methods. And when I try to use same methods using F#
fsi, one line at a time without declaring modules, I am not able to
do so.

Thanks.



On Sep 27, 1:47 pm, Anton Tayanovskyy <anton.tayanovs...@gmail.com>
wrote:

Anton Tayanovskyy

unread,
Sep 27, 2011, 2:14:02 PM9/27/11
to websh...@googlegroups.com
The difference is that client-side methods run in JavaScript. You
cannot run them in FSI because we are not emulating the browser
environment in F#.

Anton

Anton Tayanovskyy

unread,
Sep 27, 2011, 2:15:59 PM9/27/11
to websh...@googlegroups.com
All these namespaces are clientside-only, they are for developing code
to run in the browser as JavaScript:

open IntelliFactory.WebSharper
open IntelliFactory.WebSharper.Formlet
open IntelliFactory.WebSharper.Formlet.Controls
open IntelliFactory.WebSharper.Html
open IntelliFactory.WebSharper.Collections
open IntelliFactory.WebSharper.Control

Thanks,

A

Mutiullah Haider

unread,
Sep 27, 2011, 2:22:57 PM9/27/11
to WebSharper

Thanks Anton.

On Sep 27, 2:15 pm, Anton Tayanovskyy <anton.tayanovs...@gmail.com>
wrote:
> All these namespaces are clientside-only, they are for developing code
> to run in the browser as JavaScript:
>
> open IntelliFactory.WebSharper
> open IntelliFactory.WebSharper.Formlet
> open IntelliFactory.WebSharper.Formlet.Controls
> open IntelliFactory.WebSharper.Html
> open IntelliFactory.WebSharper.Collections
> open IntelliFactory.WebSharper.Control
>
> Thanks,
>
> A
>
> On Tue, Sep 27, 2011 at 2:14 PM, Anton Tayanovskyy
>
>
>
>
>
>
>
>
>
> <anton.tayanovs...@gmail.com> wrote:
> > The difference is that client-side methods run in JavaScript. You
> > cannot run them in FSI because we are not emulating the browser
> > environment in F#.
>
> > Anton
>

Ryan Riley

unread,
Oct 31, 2011, 1:43:55 PM10/31/11
to websh...@googlegroups.com
Would it be possible to change the output of these functions depending on whether they are running in a server vs. client context? If so, that would really help with the process of familiarizing oneself with the different methods, as well as allow for a form of testing between client and server functions. Obviously, wrapper functions for javascript libraries won't work, but why not functions that generate javascript? (I realize this is a lot more complicated than I'm making it out.)

Anton Tayanovskyy

unread,
Nov 1, 2011, 3:31:28 PM11/1/11
to websh...@googlegroups.com

In principle, yes. We could have the same API work on both client and
server. In practice it requires breaking some APIs we've exposed and
is not quite trivial. There are situations when we want to statically
distinguish client from server HTML, for them to have different types.
So then the code that works on both client and server has to be
generic. I tried prototyping such systems a few times but it wasn't
very pretty or convincing, but I do not want to give up. If we come up
with a convincing prototype it can make it into WebSharper.

Reply all
Reply to author
Forward
0 new messages