Can you call a vb.net api function using reflection from javascript code?
I just started playing around with reflection, I have this snippet of code that works, I want to change it to a javascript page.
Dim RawPlugin As Reflection.Assembly
RawPlugin = Reflection.Assembly.LoadFrom("C:\Inetpub\wwwroot\demo\MasterApplication\getSession\bin\Debug\getSession.dll")
Dim Instance As Object
Instance = RawPlugin.CreateInstance("getSession.class1", True, _
Reflection.BindingFlags.Default, Nothing, Nothing, Nothing, Nothing)
theValue = Instance.getSessionValue(Session).ToString
Does anyone know if this is possible?
Client side code doesn't speak directly to server side code. If the information you are looking for is unaffected in between page requests by the user, then you have two options: output the server side value to the client with the page request (so it's value is inside a JavaScript variable on the page), or make it an ajax call. If the information could possibly be stale in between page requests, then you're only option is to return the value from an ajax call.