I show how display HTML with NET8 MAUI Label using only the Label attributes. The source code of this post is available on GitHub
Search Results for: html
How to create email buttons with just HTML and CSS
In this post I explain how to create email buttons with just HTML and CSS. A call to action button is an important element of an effective email. But how can we make sure everyone receives the button the way you want? People tend to use images, a rookie mistake because people can turn their images off. Therefore, we will create a responsive email button with only HTML and CSS. Problems when creating an email button Each client processes the HTML and CSS differently but we still want it to…
C# and HTML5: drag and Drop elements
HTML5 API includes Drag and Drop (DnD) native functionality. The event listener methods for all the drag and drop events accept Event object which has a readonly attribute called dataTransfer. The event.dataTransfer returns DataTransfer object associated with the event This is the list of events fired during the different stages: Event Description dragstart Fires when the user starts dragging of the object. dragenter Fired when the mouse is first moved over the target element while a drag is occuring. A listener for this event should indicate whether a drop is…
How to remove HTML tags from data with SQL
The purpose of this article is to provide a way of cleaning up of HTML tags within the data. When we use various styles or tabular format data in UI using Rich Text Editor/ Rad Grid etc, it will save data in database with HTML tags. When you save in database this kind of field you have: An HTML element starts with a start tag (<p>) and ends with end tag (<p/>) and everything between Start tag and End tag is HTML element. e.g. <b>Following are the popular databases: <br…
How to strip all HTML tags and entities and get clear text?
I was encouraged to write this Tip/Trick because of so many questions received for this issue. Suppose you’re having a bunch of HTML strings, but you just want to remove all the HTML tags and want a plain text. You can use Regex to come to the rescue. The Regex I had developed before was more cumbersome, then Chris made a suggestion, so I will now go further with the regex suggested by Chris that is a "\<[^\>]*\>". I have tested it for many cases. It detects all types of…
Creating reusable HTML components in ASP.NET MVC using Razor
Whilst working on a side project I started to notice I was using a lot of the same HTML to create floating boxes. Whilst these boxes looked the same, the content of them changed quite dramatically; for instance, some of the content boxes contained forms, others contained straight text, like so: <div class="panel"> <div class=panel-inner"> <h2 class="panel-title">Panel Title</h2> <div class="panel-content"> /* Can I pass content to be rendered in here here? */ </div> </div> </div> </div> As my side project progressed and grew, I found myself making more and…
How create a OFT file for HTML?
OFT file is a Outlook Template of an email. If you need to send a newsletter for example, it’s very useful to create this kind of file. The procedure to make a OFT file is very simple: build html file open the file in Internet Exlorer in IE open the menu (don’t use the icon!) File | Send | Page by e-mail Outlook opens a new email with the page click on File | Save As, click dropdown and select Outlook Template (*.oft), save to desired location
Why does Html.ActionLink render “?Length=4â€
I’m VERY confused as to why this code Html.ActionLink(“About”, “About”, “Home”, new { hidefocus = “hidefocus” }) results in this link: <a hidefocus=”hidefocus” href=”/Home/About?Length=4″>About</a> The hidefocus part is what I was aiming to achieve, but where does the “?Length=4” come from? Solution The Length=4 is coming from an attempt to serialize a string object. Your code is running this ActionLink method: public static string ActionLink(this HtmlHelper htmlHelper, string linkText, string actionName, object routeValues, object htmlAttributes) This takes a string object “Home” for routeValues, which the MVC plumbing searches for public…
Writing Custom HTML Helpers for ASP.NET MVC
As a web forms developer, I found the transition to MVC to be a bit of a shock at first. Without fully understanding the nature of MVC, I found the lack of a Toolbox filled with server controls to be confusing. However, once it became clear that the goal of MVC was to expose HTML markup and give developers full control over what is rendered to the browser, I quickly embraced the idea. Transitioning from Web Forms In MVC development, HTML helpers replace the server control, but the similarities aren’t…
Parse HTML page and capture contents
Here I show a simple class that receives the HTML string and then extracts all the links and their text into structs. It is fairly fast, but I offer some optimization tips further down. It would be better to use a class. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; namespace PSC { public class Finder { public struct LinkItem { public string Href; public string Text; public override string ToString() { return Href + “\n\t” + Text; } } public class LinkFinder { public static…
C# string to Formatted HTML string
Is there a tool out there that can turn a C# string of unformatted HTML (no indentions, no new lines, etc) into a Formatted HTML string?I am in a situation where I am generating an HTML string, and I am outputting it into a multiline textbox. Write now, it is wrapping, but is showing up similar to a paragraph. I would like it to be shown as formatted HTML? It wouldn’t even have to be very nice formatting, but at least not show a paragraph of HTML.For having a good…
WebApiDocumentator: an alternative to Swagger
The NuGet package WebApiDocumentator is an alternative to Swagger and the design is simple and more useful for developers and end users
APIs with Entity Framework Core
I want to give a complete example of minimal APIs in Blazor with Entity Framework Core with complex objects.
Connect MongoDB with Node.js
In this new post, I show how to connect our application to MongoDB using Node.js. Send users and test your application using an APIs client.
Hello Python
Hello Python! is a new thread in my blog. I started to learn this programming language a few months ago but now I have to be serious.
Introduction to Node.js
This is an introduction to Node.js that is a server to run JavaScript apps. After a brief history, I will create a simple web application.
New MarkdownEditor components for JavaScript and Blazor
Today, after 2 years, I released a new Markdown Editor components for JavaScript and Blazor. The full source code is available on GitHub.
MAUI Push Notifications using Azure Notification Hub for iOS
Here the new post where I explain how to implement the Push Notifications in MAUI using Azure Notification Hub for iOS without external plugin
NET8, Blazor and Custom User Management
I will show how to create custom user management with NET8 and Blazor based on Microsoft Identity. Here is how to add custom fields for users
Custom User Management with NET8 and Blazor
In this new series of posts, I will show how to create custom user management with NET8 and Blazor based on Microsoft Identity.
Blazor integration with Identity Server
I share the code for a Blazor integration with Identity Server and BFF. All browsers don’t allow to share or save an authentication token
NET8 is announced
Microsoft has recently announced the release of NET8, the latest version of its popular software development platform
Labels and OnClickChart for ChartJs
In this new post, I introduce an update with labels and OnClickChart event, my ChartJs component for Blazor. Let me know what you think
Getting started with Python
Python is a high-level, general-purpose and a very popular programming language that lets you work quickly and integrate systems effectively
Autocomplete component for Blazor
The Autocomplete for Blazor component offers simple and flexible autocomplete type-ahead functionality for Blazor WebAssembly and Server