Introduction
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 is 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 returns a metadata that describes the change that needs to be performed 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 invocation mechanism that allows you to create events that run in the browser and don’t raise events to the server.
Quickstart
Open Visual studio and create a new Visual WebGui (VWG) application.
Figure 1: Creating a Visual WebGui application

Open Form1 and add three TextBox and four Buttons like this:
Figure 2: Form design

On the Form load add a ClientAction to the first three buttons:
I used 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 or 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:
Figure 3: The application in action

Next we’ll register a client action for the forth button and open a new page with the URL set to CNN.
Let’s run the application. Click the fourth button and a new window will open with the CNN web site.
Figure 4: Opening the CNN website

Summary
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.
You can read the original how to here.
About Eyal Albert
 |
Sorry, no bio is available
This author has published 6 articles on DotNetSlackers. View other articles or the complete profile here.
|
You might also be interested in the following related blog posts
"ADO.NET Entity data model" or "edmx" or "L2E" debug visualizer
read more
My ASP.NET MVC stack and why I chosen it
read more
Creating a Filtering User Interface With jQuery In a Web Forms Application: Part 1
read more
Adding additional power to RadGridView for Silverlight with attached behaviors
read more
Adding additional power to RadGridView for Silverlight with attached behaviors
read more
ClientIDMode in ASP.NET 4.0
read more
WebChart AJAX Zooming and Scrolling: How to get the most out of your data
read more
Gauges to join ComponentArt's expanding list of controls
read more
WebChart Drilldown Demo: A pathway to greater things
read more
Gauges to join ComponentArt's expanding list of controls
read more
|
|
Please login to rate or to leave a comment.