{"id":199,"date":"2007-07-10T14:43:21","date_gmt":"2007-07-10T19:43:21","guid":{"rendered":"\/cgi\/wp\/?p=199"},"modified":"2019-12-09T10:42:30","modified_gmt":"2019-12-09T15:42:30","slug":"web-parts-properties-verbs-and-connections","status":"publish","type":"post","link":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/?p=199","title":{"rendered":"Web Parts Properties, Verbs, And Connections"},"content":{"rendered":"<p>Today I expanded my knowledge of Web Parts, which is my favorite addition to ASP.NET in ASP.NET 2.0. I learned how to create custom properties for my web parts and I added a property to my Newsvine web part so that the user can change the RSS feed. It seems you never learn all there is to know about ASP.NET because I also learned there are two ways to register a user control. I was familiar with the method of supplying the source file path but I was not familiar with using a namespace with the tagprefix.<\/p>\n<p>There are two ways to register user controls:<\/p>\n<p>Register Namespace=&#8221;namespace&#8221;\u009d TagPrefix=&#8221;\u009dtagprefix&#8221;\u009d Assembly=&#8221;\u009dassembly&#8221;<br \/>\nRegister TagPrefix=&#8221;\u009dtagprefix&#8221; Tagname=&#8221;\u009dtagname&#8221;\u009d xsrc=&#8221;\u009dpathname&#8221;\u009d<\/p>\n<p><strong>tagprefix<\/strong> &#8211; An alias to associate with a namespace.<br \/>\n<strong>tagname <\/strong>&#8211; An alias to associate with a class.<br \/>\n<strong>Namespace<\/strong> &#8211; The namespace to associate with tagprefix.<br \/>\n<strong>Src<\/strong> &#8211; The location (relative or absolute) of the declarative user control file to associate with the tagprefix:tagname pair.<br \/>\n<strong>Assembly<\/strong> &#8211; The assembly in which the namespace that you are associating with tagprefix resides.<\/p>\n<p>A Web Part verb is a custom action that a user can perform. You can add verbs to the Web Part menu. The example code I studied adds a verb to send an email but it did not implement the actual functionality. My ASP.NET code for sending an email has been deprecated so I had to learn the new way of sending email to actually implement the new Web Part verb functionality.<\/p>\n<p>Web Parts can exchange data through provider and consumer connections. I didn&#8217;t create my own version of the example code but I did get screenshots of how the Connections Zone looks in the browser and practiced making connections between web parts and then disconnecting them. I&#8217;ll probably expand my notes on Web Part Connections when I try to create my own and encounter technical difficulties.<\/p>\n<p>I bought a book that is specifically on Web Parts, <strong>ASP.NET 2.0 Web Parts in Action: Building Dynamic Web Portals (In Action)<\/strong> by Darren Neimke. I am reading this book on my lunch breaks. Unfortunately, there probably won&#8217;t be anything else to learn after I&#8217;ve finished reading that book. Most of the articles and tutorials on web parts just cover the same basic features. I don&#8217;t think I&#8217;ll be able to find any advanced techniques or really useful examples because the developer community does not appear to be too excited about web parts.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today I expanded my knowledge of Web Parts, which is my favorite addition to ASP.NET in ASP.NET 2.0. I learned how to create custom properties for my web parts and I added a property to my Newsvine web part so &hellip; <a href=\"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/?p=199\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"_links":{"self":[{"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=\/wp\/v2\/posts\/199"}],"collection":[{"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=199"}],"version-history":[{"count":2,"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=\/wp\/v2\/posts\/199\/revisions"}],"predecessor-version":[{"id":3252,"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=\/wp\/v2\/posts\/199\/revisions\/3252"}],"wp:attachment":[{"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=199"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}