How to dynamically create ImageDraw controls at runtime in ASP.NET
Technologies used
-
Neodynamic ImageDraw 2.0 for ASP.NET
-
Microsoft .NET Framework (any version)
-
Microsoft Visual Studio .NET (any version)
You can create ImageDraw controls at runtime. In the following
sample we're going to create a simple ASP.NET WebForm that shows this scenario.
In the sample, we'll create an ImageDraw control in the Page's Load event as
well as we'll create an ImageDraw control as a response to a click event of a
Button in the WebForm.
For a more advanced sample about dynamic instantiation and creation of ImageDraw objects at runtime, please see How to create a dynamic ASP.NET e-Card Wizard with ImageDraw demo.
Follow these steps to create an ImageDraw control in the Page_Load event procedure:
- Open your .NET development tool such as Visual Studio .NET and create a new ASP.NET Web Application.
- Drag and Drop a PlaceHolder control onto it. This control will hold the ImageDraw control we're going to create at runtime.
- Add a reference to Neodynamic.WebControls.ImageDraw.dll assembly.
- In the Page_Load event procedure write the following code:
Visual Basic .NET
Visual C# .NET
- That's it. Build the ASP.NET Web Application and run it. You'll get the current local time as is shown in the following figure:
Follow these steps to create a barcode control in a Button's Click event:
- Add a new WebForm item to the ASP.NET Web Application project.
- Drag and Drop a TextBox, a Button and a PlaceHolder control onto it.
- In the Page_Load event procedure write the following code:
Visual Basic .NET
Visual C# .NET
- In the Button1_Click event procedure write the following code (Note that both code versions ARE DIFFERENT!):
Visual Basic .NET
Visual C# .NET
- That's it. Build the ASP.NET Web Application and run it. Enter some values in the TextBox, click on the Button control and you should get something like it is shown in the following figure:
Remember to download and install
ImageDraw in order to reproduce this sample demo.
If you need more information or assistance, please contact our
.
|