Glossary Item Box
PowerWEB
These buttons can be easily created and added to the toolbar using the techniques discussed in Configuring The Toolbar. The following code demonstrates adding a InsertImage button.
[C#] // Be sure to add "Imports Dart.PowerWEB.TextBox" to the top of your code-behind class. HtmlBox1.AddToolbarItem(ToolbarItemType.InsertImage); [Visual Basic] ' Be sure to add "Imports Dart.PowerWEB.TextBox" to the top of your code-behind class. HtmlBox1.AddToolbarItem(ToolbarItemType.InsertImage)
Once added to the toolbar, several properties control the behavior of the upload.
The following code demonstrates adding an ImageUpload button and setting some of these properties.
[C#] // Be sure to add "Imports Dart.PowerWEB.TextBox" to the top of your code-behind class. ToolbarUploadButton b = new ToolbarUploadButton(ToolbarUploadButtonType.InsertImage); // Set the MaxFileSize to 1 MB b.Upload.MaxFileSize = 1048576; // Set the filter to accept jpgs and gifs only b.Upload.Filter = "*.jpg,*.gif" // Allow the user to delete files b.Upload.AllowDelete = true; // Add the button HtmlBox1.Toolbar.Items.Add(b); [Visual Basic] ' Be sure to add "Imports Dart.PowerWEB.TextBox" to the top of your code-behind class. Dim b As New ToolbarUploadButton(ToolbarUploadButtonType.InsertImage) ' Set the MaxFileSize to 1 MB b.Upload.MaxFileSize = 1048576 ' Set the filter to accept jpgs and gifs only b.Upload.Filter = "*.jpg,*.gif ' Allow the user to delete files b.Upload.AllowDelete = True ' Add the button HtmlBox1.Toolbar.Items.Add(b)
Send comments on this topic.
Documentation version 3.2.0.0.
© 2009 Dart Communications. All rights reserved.