Posts

Showing posts from January, 2024

No overload for matches delegate 'EventHandler' Error CS0123

Image
In this post, I describe how to fix the error: Compiler Error Message: CS0123: No overload for matches delegate 'EventHandler' Cause This error can occur when, in ASP.NET, you've created your own Web Control or User Control which contains an EventHandler e.g. public event EventHandler CountChanged; Then, when configuring the markup, you use Visual Studio to automatically create an event. The method is automatically created in the code behind but it's missing the parameters e.g. protected void  WebUserControl_CountChanged () Resolution To resolve the issue, ensure the method parameters match the EventHandler e.g. protected void  WebUserControl_CountChanged( object sender, EventArgs e )

Automatically remove orphans from paragraph text blocks - CSS

Image
In this post, I describe how to use CSS to automatically remove orphans from the end of paragraphs or text blocks. An orphan is a single word that sits on its own at the bottom of a paragraph and should be avoided if possible. Resolution To automatically remove orphans using CSS, use the text-wrap property with the value pretty , e.g. p {     text-wrap : pretty ; } Orphans are now automatically removed:  This paragraph of text is long enough to wrap onto two lines and the last word is no orphan . Related Links - You can check browser support here: https://caniuse.com/?search=text-wrap%3A%20pretty