Overview
The ASP.NET wrapper's capabilities open a new way for a Visual WebGui programmer to develop richer and even more customizable applications then before. The wrapper allows you to use third party ASP.Net components or your own ASP.Net components in Visual WebGui as fully integrated controls just like the Visual WebGui out of the box controls.
In our demo we will wrap Dundas charts and use them in a Visual WebGui application.
Let's Start
First let's create a new Visual WebGui application:

Right click the solution and click Enable Visual WebGui:

Add the necessary reference to Dundas assembles:

Right click the project and click "Add ASP.NET Wrapper" control:

From the ASP.NET wrapper wizard select the Dundas Chart control and give it a name "DundasChart":

After clicking the OK button you will get a new wrapper class generated:

Because Dundas chart control renders images it needs a fixed size to rely on, otherwise you will get an error indicating that Dundas chart control does not support non pixel dimensions. To force the wrapper to pass absolute dimensions you need to override the IsFixedSize property in the DundasChart.cs fileas following:
The current wrapper generator does not work out ambiguous properties well and that still is left to be hand fixed, until the next version release.
After you compile the project you will get a list of warnings regarding ambiguous properties. Fix those warnings by changing the names of the properties / methods or simply mark out the conflicting code:

After you compile the project and you open the Form1.cs designer, you will get the new wrapper in the toolbox, like this:

Now you can drag the new wrapper control to the form which will put in a place holder like this:

The new wrapper allows you to initialize the control by using a reference to an ASCX file. Add a new WebUserControl1.ascx to the project

And in that ASCX you can add the control code and set his initialization.
In this demo we will paste in the current code which will initialize the Dundas chart so we will be able to just insert data from code (This code is taken from a Dundas sample)
To use an external file insert a path to your code (ASCX file) in the ControlCode property using the following format: [Assembly Resource Name]

Now we can add a Visual WebGui button to the form and attach its click event to the following code (This code is taken from a Dundas sample)
Open your web.config and add to it the Dundas http handler as following:
Set Form1 to be the startup form using the right click as following:

Run the application and you will get the following screen:

After you click the button our code will refresh the chart and display the following view:

Summary
As you can see it is very simple to create a wrapper using the new ASP.NET wrapper feature. This is the first version (6.2.1) of Visual WebGui which has this capability and we intend to simplify the procedure even more.
For more information http://www.visualwebgui.com/
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
Adding additional power to RadGridView for Silverlight with attached behaviors
read more
Unit Testing - Do Repeat Yourself
read more
Telerik and Imaginet Resources Introduce Free Developer Team Management Tools Built with RadControls for WPF
read more
Update to Logging in to DotNetNuke from a Silverlight Application with RIA Authentication
read more
ASP.NET Membership Tip: Requiring New Users To Change Their Password When Logging On For The First Time
read more
WPF Release History : Q2 2009 (version 2009.2.701)
read more
Teleriks Q2 2009 Release Expands All-in-one .NET Offering
read more
CodeDigest.Com Article,Codes,FAQs - April,2009
read more
Customizing ASP.NET's CreateUserWizard Control To Display a Fixed Set of Security Questions
read more
Don't be afraid of complex constraints
read more
|
|
Please login to rate or to leave a comment.