Search KB Filter article types
Server Client Invocation
By: Ori Cohen
Categories: Custom Controls, Skinnable and Inherited Controls
Tags: Architects, Developers, Visual WebGui Pipeline, C#, JavaScript, VB.NET, 1. Beginner, 2. Intermediate, 3. Advanced, Customization, Navigation, DHTML, Pre v6.3, v6.3, v6.4 and Later
Revision: 1
Posted: 27/July/2010
Updated: 27/July/2010
Status: Publish
Types: Article

Overview

This article describes how to run code on server-side that will in turn run specific commands on client-side.

DetailsCalling JavaScript functions on the client
protected void InvokeMethod(string strMember, params object[] arrArgs)
Protected Sub InvokeMethod(strMember As String, ParamArray arrArgs As Object())
protected void InvokeMethodWithId(string strMember, params object[] arrArgs)
Protected Sub InvokeMethodWithId(strMember As String, ParamArray arrArgs As Object())


Calling the following method from a Form or UserControl instance will cause the JavaScript function, the name of which is sent in the "strMember" argument, to be called, and sent the arguments contained in the "arrArgs" array.
Calling this method will do the same as calling the "InvokeMethod" method, but will also send as the last argument, the unique Visual WebGui ID of the Control

Invoking JavaScript code on the client
protected void InvokeScript(string strJavaScriptCode)
Protected Sub InvokeScript(strJavaScriptCode As String)


Calling the following method from a Form or UserControl instance will cause the JavaScript code in the "strJavaScriptCode" argument to be executed on the client.
This method was only implemented in Visual WebGui v6.4 Preview3.

Background

Visual WebGui is a web development and deployment framework. Reaching server-side is a result of a request made by the client.
The server cannot reach the client or execute code on it, without completing the response for the client-initiated-request first.
As a result of this procedure, if you run an Invoke... command on the server and in the next server command (on the same method for example), you cannot expect the code on the client to be processes already. What actually happened in the previous command was the the invocation to the client was queued to be rendered to the XML sent to the client for processing, once the response is sent back.

ReferencesArticles Issue Tracker

About the author

Related Articles

Custom Controls  
Title Update Author
I played a bit around with the new 6.4 ListView control, its quite amazing what you can do with it. It opens a lot of new ways to present data in a better and more userfriendly way.
Tags: Architects, Developers, Data Binding, C#, 2. Intermediate, 3. Advanced, Customization, Data Binding, v6.4 and Later
02/July/2012    2012/07/02
In this How to we are going to learn the basic usage of Visual WebGui RIA Platform Theme & Control designer.
Tags: Developers, Graphic Designers, Theme, 1. Beginner, 2. Intermediate, Customization, v6.4 and Later, 3. Advanced
04/Jan/2009    2009/01/04
Tags: Developers, Events, JavaScript, 1. Beginner, 2. Intermediate, Integration, Pre v6.3, v6.3, 3. Advanced
07/Jan/2007    2007/01/07
Tags: Developers, Events, JavaScript, 2. Intermediate, 3. Advanced, Integration, Pre v6.3, v6.3
11/Jan/2007    2007/01/11
Tags: Developers, Graphic Designers, Theme, 1. Beginner, 2. Intermediate, Customization, v6.4 and Later, 3. Advanced
06/Jan/2009    2009/01/06
Tags: Developers, Events, JavaScript, 3. Advanced, Customization, v6.3
09/Jan/2009    2009/01/09
.NET HTML5 Web, Cloud and Mobile application delivery | Sitemap | Terms of Use | Privacy Statement | Copyright © 2005-2012 Visual WebGui®       Visual WebGui weblog on ASP.NET Gizmox Blog Visual WebGui Group on LinkedIn Visual WebGui updates on Twitter Visual WebGui Page on Facebook Visual WebGui YouTube Channel Visual WebGui Platform News RSS