{"id":491,"date":"2008-01-27T05:25:35","date_gmt":"2008-01-27T10:25:35","guid":{"rendered":"http:\/\/blogs.devhorizon.com\/reza\/?p=491"},"modified":"2008-09-13T18:01:27","modified_gmt":"2008-09-13T23:01:27","slug":"web-part-with-toolbar","status":"publish","type":"post","link":"https:\/\/blogs.devhorizon.com\/reza\/2008\/01\/27\/web-part-with-toolbar\/","title":{"rendered":"Web Part with Toolbar"},"content":{"rendered":"<p>A web part that has its own toolbar with different controls added to it programmatically is easy to build.<\/p>\n<p>1) Create a web part and override   <span style=\"font-family: Courier New; font-size: 10pt\">CreateChildControls <\/span>and<span style=\"font-family: Courier New; font-size: 10pt\"> Render<\/span> methods:<\/p>\n<div id=\"ig-sh-1\" class=\"syntax_hilite\">\n\n\t\t<div class=\"toolbar\">\n\n\t\t<div class=\"view-different-container\">\n\t\t\t\t\t\t<a href=\"#\" class=\"view-different\">&lt; View <span>plain text<\/span> &gt;<\/a>\n\t\t\t\t\t<\/div>\n\n\t\t<div class=\"language-name\">C#<\/div>\n\n\t\t\n\t\t<br clear=\"both\">\n\n\t<\/div>\n\t\n\t<div class=\"code\">\n\t\t<ol class=\"csharp\" style=\"font-family:monospace\"><li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #0600FF;font-weight: bold\">public<\/span> <span style=\"color: #6666cc;font-weight: bold\">class<\/span> WPT <span style=\"color: #008000\">:<\/span> WebPart <span style=\"color: #008000\">&#123;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #0600FF;font-weight: bold\">protected<\/span> ToolBar tlb<span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&nbsp;<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #0600FF;font-weight: bold\">protected<\/span> <span style=\"color: #0600FF;font-weight: bold\">override<\/span> <span style=\"color: #6666cc;font-weight: bold\">void<\/span> CreateChildControls<span style=\"color: #008000\">&#040;<\/span><span style=\"color: #008000\">&#041;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#123;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #0600FF;font-weight: bold\">base<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">CreateChildControls<\/span><span style=\"color: #008000\">&#040;<\/span><span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">tlb <span style=\"color: #008000\">=<\/span> <span style=\"color: #008000\">&#040;<\/span>ToolBar<span style=\"color: #008000\">&#041;<\/span>Page<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">LoadControl<\/span><span style=\"color: #008000\">&#040;<\/span><span style=\"color: #666666\">&quot;\/_controltemplates\/ToolBar.ascx&quot;<\/span><span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">tlb<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">ID<\/span> <span style=\"color: #008000\">=<\/span> <span style=\"color: #666666\">&quot;NavNodesTB&quot;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">tlb<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Template_Buttons<\/span> <span style=\"color: #008000\">=<\/span> <span style=\"color: #008000\">new<\/span> BtnTemplate<span style=\"color: #008000\">&#040;<\/span><span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">Controls<span style=\"color: #008000\">.<\/span><span style=\"color: #0600FF;font-weight: bold\">Add<\/span><span style=\"color: #008000\">&#040;<\/span>tlb<span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#125;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #0600FF;font-weight: bold\">protected<\/span> <span style=\"color: #0600FF;font-weight: bold\">override<\/span> <span style=\"color: #6666cc;font-weight: bold\">void<\/span> Render<span style=\"color: #008000\">&#040;<\/span>HtmlTextWriter writer<span style=\"color: #008000\">&#041;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#123;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">RenderChildren<span style=\"color: #008000\">&#040;<\/span>writer<span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#125;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#125;<\/span><\/div><\/li>\n<\/ol>\t<\/div>\n\n<\/div>\n\n<p>2) Create the BtnTemplate class that implements <a href=\"http:\/\/msdn2.microsoft.com\/en-us\/library\/system.web.ui.itemplate.aspx\" target=\"_blank\">ITemplate<\/a> interface. Add all the controls you want to show up on the toolbar<\/p>\n<div id=\"ig-sh-2\" class=\"syntax_hilite\">\n\n\t\t<div class=\"toolbar\">\n\n\t\t<div class=\"view-different-container\">\n\t\t\t\t\t\t<a href=\"#\" class=\"view-different\">&lt; View <span>plain text<\/span> &gt;<\/a>\n\t\t\t\t\t<\/div>\n\n\t\t<div class=\"language-name\">C#<\/div>\n\n\t\t\n\t\t<br clear=\"both\">\n\n\t<\/div>\n\t\n\t<div class=\"code\">\n\t\t<ol class=\"csharp\" style=\"font-family:monospace\"><li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #0600FF;font-weight: bold\">public<\/span> <span style=\"color: #6666cc;font-weight: bold\">class<\/span> BtnTemplate <span style=\"color: #008000\">:<\/span> ITemplate<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#123;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">DropDownList ddlNumbers<span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">HyperLink tlBarLink<span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&nbsp;<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #6666cc;font-weight: bold\">void<\/span> ITemplate<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">InstantiateIn<\/span><span style=\"color: #008000\">&#040;<\/span>Control container<span style=\"color: #008000\">&#041;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#123;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">tlBarLink <span style=\"color: #008000\">=<\/span> <span style=\"color: #008000\">new<\/span> HyperLink<span style=\"color: #008000\">&#040;<\/span><span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">tlBarLink<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">ID<\/span> <span style=\"color: #008000\">=<\/span> <span style=\"color: #666666\">&quot;idClickMeText&quot;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">tlBarLink<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Text<\/span> <span style=\"color: #008000\">=<\/span> <span style=\"color: #666666\">&quot;Click Me&quot;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">tlBarLink<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">ToolTip<\/span> <span style=\"color: #008000\">=<\/span> <span style=\"color: #666666\">&quot;Click Me&quot;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">tlBarLink<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">NavigateUrl<\/span> <span style=\"color: #008000\">=<\/span> <span style=\"color: #666666\">&quot;javascript:alert('Hello World!')&quot;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&nbsp;<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">ddlNumbers <span style=\"color: #008000\">=<\/span> <span style=\"color: #008000\">new<\/span> DropDownList<span style=\"color: #008000\">&#040;<\/span><span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">ddlNumbers<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">ID<\/span> <span style=\"color: #008000\">=<\/span> <span style=\"color: #666666\">&quot;idNumbers&quot;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">ddlNumbers<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Load<\/span> <span style=\"color: #008000\">+=<\/span> <span style=\"color: #008000\">new<\/span> EventHandler<span style=\"color: #008000\">&#040;<\/span>ddlNumbers_Load<span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">ddlNumbers<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">AutoPostBack<\/span> <span style=\"color: #008000\">=<\/span> <span style=\"color: #0600FF;font-weight: bold\">false<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&nbsp;<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">container<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Controls<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0600FF;font-weight: bold\">Add<\/span><span style=\"color: #008000\">&#040;<\/span>tlBarLink<span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">container<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Controls<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0600FF;font-weight: bold\">Add<\/span><span style=\"color: #008000\">&#040;<\/span>ddlNumbers<span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&nbsp;<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#125;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&nbsp;<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #6666cc;font-weight: bold\">void<\/span> ddlNumbers_Load<span style=\"color: #008000\">&#040;<\/span><span style=\"color: #6666cc;font-weight: bold\">object<\/span> sender, EventArgs e<span style=\"color: #008000\">&#041;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#123;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">ddlNumbers<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Items<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Clear<\/span><span style=\"color: #008000\">&#040;<\/span><span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">ddlNumbers<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Items<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0600FF;font-weight: bold\">Add<\/span><span style=\"color: #008000\">&#040;<\/span><span style=\"color: #008000\">new<\/span> ListItem<span style=\"color: #008000\">&#040;<\/span><span style=\"color: #666666\">&quot;One&quot;<\/span><span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">ddlNumbers<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Items<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0600FF;font-weight: bold\">Add<\/span><span style=\"color: #008000\">&#040;<\/span><span style=\"color: #008000\">new<\/span> ListItem<span style=\"color: #008000\">&#040;<\/span><span style=\"color: #666666\">&quot;Two&quot;<\/span><span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">ddlNumbers<span style=\"color: #008000\">.<\/span><span style=\"color: #0000FF\">Items<\/span><span style=\"color: #008000\">.<\/span><span style=\"color: #0600FF;font-weight: bold\">Add<\/span><span style=\"color: #008000\">&#040;<\/span><span style=\"color: #008000\">new<\/span> ListItem<span style=\"color: #008000\">&#040;<\/span><span style=\"color: #666666\">&quot;Three&quot;<\/span><span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">&#041;<\/span><span style=\"color: #008000\">;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#125;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #008000\">&#125;<\/span><\/div><\/li>\n<\/ol>\t<\/div>\n\n<\/div>\n\n<p>3)  Finally,deploy your web part and you are pretty much done! Here is how your web part looks like.<\/p>\n<table style=\"border-collapse: collapse\" border=\"0\">\n<tr>\n<td style=\"padding-left: 7px; padding-right: 7px\"><img decoding=\"async\" src=\"https:\/\/blogs.devhorizon.com\/reza\/wp-content\/uploads\/2008\/01\/012708-1026-webpartwith12.png\" \/><\/td>\n<\/tr>\n<\/table>\n<p>Source Code can be downloaded <a href=\"https:\/\/blogs.devhorizon.com\/reza\/wp-content\/uploads\/2008\/01\/wpwtoolbar.rar\">here<\/a>.<\/p>\n<p><font color=\"#ff0000\">Update 13\/Sep\/2008:\u00a0<\/font>\u00a0 Another way of adding toolbar is now documented <a href=\"https:\/\/blogs.devhorizon.com\/reza\/?p=670\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A web part that has its own toolbar with different controls added to it programmatically is easy to build. 1) Create a web part and override CreateChildControls and Render methods: &lt; View plain text &gt; C# public class WPT : WebPart &#123; protected ToolBar tlb; &nbsp; protected override void CreateChildControls&#040;&#041; &#123; base.CreateChildControls&#040;&#041;; tlb = &#040;ToolBar&#041;Page.LoadControl&#040;&quot;\/_controltemplates\/ToolBar.ascx&quot;&#041;; [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[43],"tags":[],"class_list":["post-491","post","type-post","status-publish","format-standard","hentry","category-moss-2007"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Web Part with Toolbar - Reza Alirezaei&#039;s Blog %<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blogs.devhorizon.com\/reza\/2008\/01\/27\/web-part-with-toolbar\/\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Reza Alirezaei\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2008\\\/01\\\/27\\\/web-part-with-toolbar\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2008\\\/01\\\/27\\\/web-part-with-toolbar\\\/\"},\"author\":{\"name\":\"Reza Alirezaei\",\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/#\\\/schema\\\/person\\\/cdbb24d283697a65951cb4a14e474938\"},\"headline\":\"Web Part with Toolbar\",\"datePublished\":\"2008-01-27T10:25:35+00:00\",\"dateModified\":\"2008-09-13T23:01:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2008\\\/01\\\/27\\\/web-part-with-toolbar\\\/\"},\"wordCount\":216,\"commentCount\":13,\"image\":{\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2008\\\/01\\\/27\\\/web-part-with-toolbar\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/wp-content\\\/uploads\\\/2008\\\/01\\\/012708-1026-webpartwith12.png\",\"articleSection\":[\"MOSS 2007\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2008\\\/01\\\/27\\\/web-part-with-toolbar\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2008\\\/01\\\/27\\\/web-part-with-toolbar\\\/\",\"url\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2008\\\/01\\\/27\\\/web-part-with-toolbar\\\/\",\"name\":\"Web Part with Toolbar - Reza Alirezaei's Blog %\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2008\\\/01\\\/27\\\/web-part-with-toolbar\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2008\\\/01\\\/27\\\/web-part-with-toolbar\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/wp-content\\\/uploads\\\/2008\\\/01\\\/012708-1026-webpartwith12.png\",\"datePublished\":\"2008-01-27T10:25:35+00:00\",\"dateModified\":\"2008-09-13T23:01:27+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/#\\\/schema\\\/person\\\/cdbb24d283697a65951cb4a14e474938\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2008\\\/01\\\/27\\\/web-part-with-toolbar\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/2008\\\/01\\\/27\\\/web-part-with-toolbar\\\/#primaryimage\",\"url\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/wp-content\\\/uploads\\\/2008\\\/01\\\/012708-1026-webpartwith12.png\",\"contentUrl\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/wp-content\\\/uploads\\\/2008\\\/01\\\/012708-1026-webpartwith12.png\",\"width\":670,\"height\":80},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/#website\",\"url\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/\",\"name\":\"Reza Alirezaei's Blog\",\"description\":\"Blogging from the field!\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/#\\\/schema\\\/person\\\/cdbb24d283697a65951cb4a14e474938\",\"name\":\"Reza Alirezaei\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3ba940d84e0ecb909e62e93df4c56daf0395c7e53c914467ab2ee73124a7d7b6?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3ba940d84e0ecb909e62e93df4c56daf0395c7e53c914467ab2ee73124a7d7b6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3ba940d84e0ecb909e62e93df4c56daf0395c7e53c914467ab2ee73124a7d7b6?s=96&d=mm&r=g\",\"caption\":\"Reza Alirezaei\"},\"url\":\"https:\\\/\\\/blogs.devhorizon.com\\\/reza\\\/author\\\/rezaa\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Web Part with Toolbar - Reza Alirezaei's Blog %","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blogs.devhorizon.com\/reza\/2008\/01\/27\/web-part-with-toolbar\/","twitter_misc":{"Written by":"Reza Alirezaei","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blogs.devhorizon.com\/reza\/2008\/01\/27\/web-part-with-toolbar\/#article","isPartOf":{"@id":"https:\/\/blogs.devhorizon.com\/reza\/2008\/01\/27\/web-part-with-toolbar\/"},"author":{"name":"Reza Alirezaei","@id":"https:\/\/blogs.devhorizon.com\/reza\/#\/schema\/person\/cdbb24d283697a65951cb4a14e474938"},"headline":"Web Part with Toolbar","datePublished":"2008-01-27T10:25:35+00:00","dateModified":"2008-09-13T23:01:27+00:00","mainEntityOfPage":{"@id":"https:\/\/blogs.devhorizon.com\/reza\/2008\/01\/27\/web-part-with-toolbar\/"},"wordCount":216,"commentCount":13,"image":{"@id":"https:\/\/blogs.devhorizon.com\/reza\/2008\/01\/27\/web-part-with-toolbar\/#primaryimage"},"thumbnailUrl":"https:\/\/blogs.devhorizon.com\/reza\/wp-content\/uploads\/2008\/01\/012708-1026-webpartwith12.png","articleSection":["MOSS 2007"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/blogs.devhorizon.com\/reza\/2008\/01\/27\/web-part-with-toolbar\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/blogs.devhorizon.com\/reza\/2008\/01\/27\/web-part-with-toolbar\/","url":"https:\/\/blogs.devhorizon.com\/reza\/2008\/01\/27\/web-part-with-toolbar\/","name":"Web Part with Toolbar - Reza Alirezaei's Blog %","isPartOf":{"@id":"https:\/\/blogs.devhorizon.com\/reza\/#website"},"primaryImageOfPage":{"@id":"https:\/\/blogs.devhorizon.com\/reza\/2008\/01\/27\/web-part-with-toolbar\/#primaryimage"},"image":{"@id":"https:\/\/blogs.devhorizon.com\/reza\/2008\/01\/27\/web-part-with-toolbar\/#primaryimage"},"thumbnailUrl":"https:\/\/blogs.devhorizon.com\/reza\/wp-content\/uploads\/2008\/01\/012708-1026-webpartwith12.png","datePublished":"2008-01-27T10:25:35+00:00","dateModified":"2008-09-13T23:01:27+00:00","author":{"@id":"https:\/\/blogs.devhorizon.com\/reza\/#\/schema\/person\/cdbb24d283697a65951cb4a14e474938"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blogs.devhorizon.com\/reza\/2008\/01\/27\/web-part-with-toolbar\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blogs.devhorizon.com\/reza\/2008\/01\/27\/web-part-with-toolbar\/#primaryimage","url":"https:\/\/blogs.devhorizon.com\/reza\/wp-content\/uploads\/2008\/01\/012708-1026-webpartwith12.png","contentUrl":"https:\/\/blogs.devhorizon.com\/reza\/wp-content\/uploads\/2008\/01\/012708-1026-webpartwith12.png","width":670,"height":80},{"@type":"WebSite","@id":"https:\/\/blogs.devhorizon.com\/reza\/#website","url":"https:\/\/blogs.devhorizon.com\/reza\/","name":"Reza Alirezaei's Blog","description":"Blogging from the field!","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blogs.devhorizon.com\/reza\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/blogs.devhorizon.com\/reza\/#\/schema\/person\/cdbb24d283697a65951cb4a14e474938","name":"Reza Alirezaei","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/3ba940d84e0ecb909e62e93df4c56daf0395c7e53c914467ab2ee73124a7d7b6?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/3ba940d84e0ecb909e62e93df4c56daf0395c7e53c914467ab2ee73124a7d7b6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3ba940d84e0ecb909e62e93df4c56daf0395c7e53c914467ab2ee73124a7d7b6?s=96&d=mm&r=g","caption":"Reza Alirezaei"},"url":"https:\/\/blogs.devhorizon.com\/reza\/author\/rezaa\/"}]}},"_links":{"self":[{"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/posts\/491","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/comments?post=491"}],"version-history":[{"count":0,"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/posts\/491\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/media?parent=491"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/categories?post=491"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.devhorizon.com\/reza\/wp-json\/wp\/v2\/tags?post=491"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}