JavaScript Object Model (Server method cannot be called from JavaScript), whenever the Window is an TDI Window

Answered Closed
0
0

Hello Wisej Team,

I have been working on the calling a method in my C# Server from JavaScript Client whenever keypress event is fire.

However, I am working on the TDI interface, and it seems like I cannot call the server method from the client when I have documented in TDI mode.

I have tested with the Non-TDI interface, and the method is called when the window is configured as the Non-TDI window.

I have followed this document to perform my task:
https://wisej.com/docs/2.2/html/JavaScriptObjectModel.htm

 

  • You must to post comments
Best Answer
0
0

Thank you Luca for your reply.
I tried with your suggested answer but for some reason, it was not working.

Nevertheless, I found the workaround, and in that, you don’t explicitly need to override the method OnWebRender.

It seems like, if you call the method with an absolute path, you can trigger the method. I use this calling to access method declared in Child Control Class (MDI Child):

App.Window1.mdiClient.mdiTabView.MdiChildPage_Window2.Window2.Test();

  • You must to post comments
2
0

If you mean an MdiChild form, they don’t automatically exposes web methods because they are not top level containers. See at the bottom of the help the note marked “Important”, it also explains how you can expose web methods on any control.

 protected override void OnWebRender(dynamic config)
 {
     base.OnWebRender((object)config);
     config.webMethods = new[] { "method1", "methdod2" };
 }

HTH

  • You must to post comments
Showing 2 results