Brockmann: "Creating Rich Web
Applications Gets a Ton Easier"

e-grou chooses Visual WebGui
over standard ASP.NET

Quick migration of VB 6.0
Applications to the Web

Try the revolutionary Studio
the all-new 6.4 beta is here

Fully functional software versions
for 30 days evaluation period

Download the free edition of the
Visual WebGui Studio
 

Tutorials

Eyal.Albert posted on August 26, 2008 :: 2623 Views :: User Rating:Article Rating
Share |

In this “How to” we will going to learn how to use Visual WebGui client client invocation

You should be familiar by now with What is Visual WebGui and What is Visual WebGui over Silverlight. It is recommended that you read “How to create a Visual WebGui Silverlight application” , “How to create a Visual WebGui Silverlight custom control” and other articles in our “Get Started with Silverlight” section.

Visual WebGui (VWG) adopts the server based computing approach whereby service consumption and processing is handled on the server and human interaction is handled on the client. This model provides intrinsic benefits for enterprise applications since it provides additional measures of security and control which are not available on browser based solutions.

The Visual WebGui programming model is event based. When a control changes state, such as when the user clicks a button, it raises an event. That event runs in the server and return a metadata that describes the change that needs to be preformed in the browser. In order to handle an event, your application registers an event-handling method for that event. This behavior is good for events that need to run on the server, but if there is no need to run the action on the server we created the client client invocation mechanism that allows you to create events that run in the browser and don’t raise events to the server.

Open Visual studio and create a new Visual WebGui (VWG) application.

image

Open Form1 and add three TextBox  and four Buttons like this:

image

On the Form load add  to the first three buttons a ClientAction

this.button1.ClientAction = RegisteredClientAction.CreateWithId(this.textBox1, "Controls_Focus");

this.button2.ClientAction = RegisteredClientAction.CreateWithId(this.textBox2, "Controls_Focus");

this.button3.ClientAction = RegisteredClientAction.CreateWithId(this.textBox3, "Controls_Focus");

I used the Controls_Focus to set focus to the text box next to the button. you can use any function that the object has like Window.print, Button.Click, . You can also create your own custom controls and add functions in the java script page to the control.

Let’s run the application. Every time we click a button the focus is set to the text box next to it. The result should look like this:

image image  image

Next we’ll register a client action to the forth button and open a new page and set the URL to CNN.

this.button4.RegisterClientAction("open", "http://www.CNN.com");

Let’s run the application. On the button click a new window will open with CNN web site.

image

To summarize:
We have seen how to use Visual WebGui Client Client Invocation to save round trips to the server and how to do UI action in the browser.

-- Eyal Albert @ Eyal.Albert (at) Gizmox.com

Posted in: Learn Home Page
1 Users Rated: Article Rating
#
How to use Visual WebGui client client invocation
Posted by on Tuesday, August 26, 2008 3:32 AM
I have installed VWG 6.2 but I have no ClientAction attribute available
Posted by Michael on Wednesday, October 22, 2008 9:02 AM
# Eyal.Albert
I am using the same version and i can see the ClientAction i a button.
You cant access it in design only in code.
Eyal Albert
Posted by Eyal.Albert on Wednesday, October 22, 2008 9:12 AM
Thanks Eyal, but still no ClientAction. Whyt type is your button? I am using following type

private Gizmox.WebGUI.Forms.Button button1;

thanks for your help
Michael
Posted by Michael on Wednesday, October 22, 2008 9:40 AM
# Michael
It seems to be available only in the SDK30.
I cannot find it in SDK20

Is that true?
Posted by Michael on Wednesday, October 22, 2008 9:55 AM
# Eyal.Albert
Hi Michael,
I've justinstalled 6.2.0a for 2.0 and i was able to use the ClientAction.

Do you have reflector installed? Open the assembly and tell me if you can see the Client action?

If not send me the assembly DLL to eyal.albert at gizmox.Com
Posted by Eyal.Albert on Sunday, October 26, 2008 7:56 AM
# izi.versano
vvvvvvvvvvvvv
Posted by izi.versano on Sunday, February 01, 2009 1:22 PM
# jr365
Can we fire javascript?
Posted by jr365 on Monday, March 16, 2009 8:24 PM
# jr365
err, wait - this is javascript - sorry!
Posted by jr365 on Monday, March 16, 2009 8:42 PM
Only registered users may post comments.
Most promising startups
Top 3 most promising startups in 2009
   AJAX Framework | Web Development | Cloud applications | RIA Development | Silverlight Applications | Legacy Migration
The most popular open source Ajax applications framework for enterprises | Sitemap | Terms Of Use | Privacy Statement
Copyright © 2005-2009 Visual WebGui®    Design By: Template World
   
Visual Studio Partners