What we will do is to create a class library project, build a release DLL and put this DLL into the bin folder of another project. And all of this will produce a new admin tool as depicted below.
Create the plugin
We create the plugin and what is worth noting here is the Url on line 4 (this is used with the route helper, see below) and the inheritance of the IPageTypeUsage interface on line 5.
1: [GuiPlugIn(DisplayName = "Page Type Usage",
2: Description = "See the usage of a selected page type.",
3: Area = PlugInArea.AdminMenu,
4: Url = "/PageTypeUsage.aspx")]
5: public class PageTypeUsage : Page, IPageTypeUsage
We will not use an ASPX file at all but instead add all the controls needed to the ControlCollection of the plugin page. And this must be added in the OnInit method in order to be able to use them properly.
1: protected override void OnInit(EventArgs e)
2: {
3: AddControls();
4: InitPageTypesDropDown();
5: base.OnInit(e);
6: }
A little example of the AddControls method. Once added they will render properly without us having to doing anything in particular.
1: private void AddControls()
2: {
3: HtmlGenericControl html = new HtmlGenericControl("html");
4: HtmlHead head = new HtmlHead();
5: HtmlTitle title = new HtmlTitle { Text = "Page Type Usage" };
6: HtmlGenericControl javascript = ControlHelper.GetJavaScriptLinkControl("/util/javascript/system.js");
7: HtmlGenericControl css1 = ControlHelper.GetCssLinkControl("/epi/Shell/ClientResources/ShellCore.css");
8: Controls.Add(html);
9: html.Controls.Add(head);
10: head.Controls.Add(title);
11: head.Controls.Add(javascript);
12: head.Controls.Add(css1);
Route handler
In order for this to work without using an ASPX file and having a virtual path we will use the power of Routes.
1: public class RouteHandler : PlugInAttribute, IRouteHandler
2: {
3: #region IRouteHandler Members
4: public IHttpHandler GetHttpHandler(RequestContext requestContext)
5: {
6: var interfaceType = typeof(IPageTypeUsage);
7: var classType = AppDomain.CurrentDomain.GetAssemblies().SelectMany(s => s.GetTypes()).First(p => interfaceType.IsAssignableFrom(p) && p.IsClass);
8: return Activator.CreateInstance(classType) as IHttpHandler;
9: }
10: #endregion
11:
12: public static void RegisterRoutes()
13: {
14: RouteTable.Routes.Add(new Route("PageTypeUsage.aspx", new RouteHandler()));
15: }
16:
17: public static void Start()
18: {
19: RegisterRoutes();
20: }
21: }
By inheriting PlugInAttribute on line 1 we can access the Start method (on line 17) and register the routes. And we register the route "PageTypeUsage.aspx" - which is the same as we specified on the plugin. Once this route is hit or accessed the GetHttpHandler method on line 4 is used. Basically this utilize a reflection search of the interface IPageTypeUsage and instantiates a PageTypeUsage object (on line 8).
And voila! We have a plugin that we can share between different projects!
This comment has been removed by the author.
ReplyDeleteWell Said, you have furnished the right information that will be useful to anyone at all time. Thanks for sharing your Ideas.
ReplyDeleteangularjs Training in chennai
angularjs Training in chennai
angularjs-Training in tambaram
angularjs-Training in sholinganallur
After seeing your article I want to say that the presentation is very good and also a well-written article with some very good information which is very useful for the readers....thanks for sharing it and do share more posts like this.
ReplyDeletepython training in velachery | python training institute in chennai
Wow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog.
ReplyDeleteblueprism training in chennai | blueprism training in bangalore | blueprism training in pune | blueprism online training
You blog post is just completely quality and informative. Many new facts and information which I have not heard about before. Keep sharing more blog posts.
ReplyDeleteJava training in Jaya nagar | Java training in Electronic city
Java training in Chennai | Java training in USA | Java training in Kalyan nagar
Great post! I am actually getting ready to across this information, It’s very helpful for this blog.Also great with all of the valuable information you have Keep up the good work you are doing well.
ReplyDeleteData Science training in Chennai | Data science training in bangalore
Data science training in pune | Data science online training
Data Science Interview questions and answers
I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well. In fact your creative writing abilities has inspired me to start my own BlogEngine blog now. Really the blogging is spreading its wings rapidly. Your write up is a fine example of it.
ReplyDeletedevops online training
aws online training
data science with python online training
data science online training
rpa online training
This comment has been removed by the author.
ReplyDeleteif you want to learn digital marketing in mumbai. excelr solutions providing best AI course in mumbai.for more details click here
ReplyDeletedigital marketing courses in mumbai
Excellent Blog! I would like to thank for the efforts you have made in writing this post. I am hoping the same best work from you in the future as well. I wanted to thank you for this websites! Thanks for sharing. Great websites!
ReplyDeleteExcelR digital marketing courses in mumbai
Your story is truly inspirational and I have learned a lot from your blog. Much appreciated.keep it up guys.
ReplyDeleteAi & Artificial Intelligence Course in Chennai
PHP Training in Chennai
Ethical Hacking Course in Chennai Blue Prism Training in Chennai
UiPath Training in Chennai
Thank you for your great effort.Keep blogging. Java training in Chennai | Certification | Online Course Training | Java training in Bangalore | Certification | Online Course Training | Java training in Hyderabad | Certification | Online Course Training | Java training in Coimbatore | Certification | Online Course Training | Java training in Online | Certification | Online Course Training
ReplyDeleteI feel really happy to have seen your web page and look forward to so many more entertaining times reading here. Thanks once more for all the details.
ReplyDeletehe contents are masterpiece. you have done a fantastic activity on this subject!
Data Science Training In Chennai
Data Science Online Training In Chennai
Data Science Training In Bangalore
Data Science Training In Hyderabad
Data Science Training In Coimbatore
Data Science Training
Data Science Online Training
seo tools buy is the only trusted website in india at the moment.
ReplyDeleteusing scratch coding has becoming unpopular since Group Buy SEO Tools introduced in the market. its ease the developer works and save their times
ReplyDeleteSeo group buy tools is a term used for sharing SEO tools in groups if you can't afford them individually.
ReplyDeleteSeogroupbuyguru.com offers a platform for a reasonable price to share these expensive tools.. Therefore, an original tool is shared between those who can't subscribe from official sellers.
We provide our clients with premium quality hearing aids that are available in a singapore.
ReplyDeleteReally nice and interesting post. Group Buy SEO Tools
ReplyDeleteStockTrim is inventory planning and demand forecasting software available as a subscription. It helps SME's gain optimised inventory levels and preserves up to 40% of their working capital.Stock Control
ReplyDeleteThis is a real good and well written article about the best forex trading robot to trade the market with. In fact, I think that you should really take a look buy aged bulk gmail twitter instagram accounts pva youtube buy instagram accounts instagram pva accounts buy bulk instagram accounts pvaaccountss com at this, since I think it'll really help you out when it comes to trading. Thank you for writing this article, I am indeed looking forward to your articles as I've learned a lot from it. Indeed I hope you enjoyed this article and I hope you take what you have learned here and use it to make yourself successful in the forex trading market.Buy snapchat account
ReplyDeleteAre you one of the thousands of people who have seen advertisements on social accounts earning thousands of dollars per day? Or are you simply one of the many who have joined these programs in hopes of making some easy money on the internet? In either case, you should know that making a social media account and advertising to it can lead to your business making a social accounts profit. It's true that these types of marketing efforts cost nothing to join, but most business owners don't know how to effectively use them to their advantage. Here are some tips that will help you get the most out of your social media marketing efforts:Buy pinterest accounts
ReplyDelete
ReplyDeleteI was just examining through the web looking for certain information and ran over your blog.It shows how well you understand this subject. Bookmarked this page, will return for extra. data science course in vadodara
You are looking for the most reliable, cheap and reliable seo tools supplier in 2021. You can join the best group buy seo tools here
ReplyDeleteHow to delete long path files /names too long for normal delete
ReplyDeleteThanks for sharing this interesting post.
ReplyDeleteDigital Marketing Courses in Mumbai
Jasper.ai Group Buy are a great way to get your website seen by a larger audience and drive more traffic and sales to your site. Simply sign up for a group buy and let us take care of the marketing and advertising for you. We will create a custom campaign that targets your target audience and drives traffic to your website.
ReplyDeleteA good blog always comes-up with new and exciting information and while reading I have feel that this blog is really have all those quality that qualify a blog to be a one
ReplyDeletebusiness analytics course in hyderabad
If you are looking for the best way to take your company to the next level and increase your revenue, a Digi uprise Course might be the answer. The Internet as well as social networks make it possible for firms to reach a wider audience and generate revenue with little effort. But, the most important thing is to understand how to make use of these tools and techniques to your advantage. In the present, there is many top institutes that will help you master these skills.
ReplyDeleteThe
ReplyDeleteBest Dietitian and Nutritionist in Delhi - Diet Mantra by Monika by Monika is focused on providing expert nutritional advice to suit your body needs and empowering you in making lasting lifestyle changes. One of the biggest challenges one faces in today’s fast-paced life is how to actually keep up with the time crunch and how to actually follow a healthy lifestyle. Taking the right regimen for good wellbeing is significant and according to the various maladies and diseases, it is critical to have a solid eating routine with the goal that the immunity system could help to defend the infection and can help to improve your health. We offer online diet consultation so our customers get handily associated with us with no hustle. Monika Manchanda has been awarded as the best dietitian & nutritionist in Delhi.
Digital Marketing Course in Delhi is now an important method to market your business. It allows companies to interact with customers on multiple levels and make meaningful connections that create lasting relationships. The job of a digital marketing professional involves planning, creating, and implementing online marketing strategies. It can encompass web design and management of social media, the optimization of search engines and content creation.
ReplyDelete_rohitkhanna Check out these amazing reel ideas that will inspire you to get creative! Our reel showcases innovative and unique concepts that are perfect for anyone looking to shake things up. For more inspiration and a deeper dive into each idea, click the link in our bio. Start your creative journey today and let your imagination run wild! 🎨
ReplyDelete