Active Query Builder support area

Syntax to receive QB.Web.Application.UserData in C#

Avatar
  • updated
  • Completed

Using the ASP.NET edition,

I can't find any examples of how you get the value in C# when you set it in JS via QB.Web.Application.UserData.

In JS, do I just set

QB.Web.Application.UserData = 'SomeValue';

or do I need to call an additional method?

In C# is this correct syntax?

QueryBuilderControl1.UserDataReceived += OnUserDataReceived;

public void OnUserDataReceived(object sender, SessionStoreItem.UserDataReceivedHandlerEventArgs e) {
    Debug.WriteLine(e.InputData);
}
 
 

 

Avatar
Andrey Zavyalov, PM

Hello, Marc.

I am sorry, but we've found that it doesn't work as expected. An example of sending data from server to client can be found in the Alternate Names demo project, but sending it from client to server is impossible now. We will fix this in the next version and send you the code sample. Hopefully the new version will be released till the end of this week.

Avatar
Andrey Zavyalov, PM

Hello, Marc.

The new version lets do what you want. Please read this article for details:

Active Query Builder ASP.NET Edition client extensions

Avatar
Marc

Thanks, it's working for me now. The documentation says it sends it on the next "sync" event. How do I force that to happen in my JS code?

Avatar
Andrey Zavyalov, PM

Hello.

Use the QB.Web.Application.update() method for this purpose.