How to Insert Email links using Umbraco TinyMce

Add the below script inside the “script” tag in the \umbraco\plugins\tinymce3\insertLink.aspx page

function AppendProperty() {
var sText = $('#href').val();
if (validateEmail(sText)) {
$('#href').val(function (index, value) {
return 'mailto:' + value;
});
}
else {
if (sText != "" && (/^http/i.test(sText)) == false) {
$('#href').val(function (index, value) {
return 'http://' + value;
});
}
}
}

function validateEmail(sEmail) {
var filter = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
if (filter.test(sEmail)) {
return true;
}
else {
return false;
}
}

and modify the input field like the below

<input id="href" style="width: 220px;" type="text" name="href" value="" onchange="document.getElementById('localUrl').value = ''; selectByValue(this.form,'linklisthref',this.value);<strong> AppendProperty();"/>

The ListView raised event ItemEditing which wasn’t handled.

Error:
The ListView ‘ListView1′ raised event ItemEditing which wasn’t handled.

Resaon:
if the CommandName of a clicked button is “Edit” then it will put the ListView in the Edit mode, try modifying the CommandName=”Edit” to something like “modify”… its so easy :)

ASP.NET ListView Item Delete Confirmation using jQuery Colorbox

The other day I was working on a .NET project I needed to perform a delete confirmation using jQuery Colorbox in ASP.NET ListView. After I spend long hours on internet I couldn’t find solution and come up with this idea. Hope you will enjoy it :)

Solution

Step 1: Add jQuery and Colorbox

you can download colorbox from https://github.com/jackmoore/colorbox

You can find jQuery Colorbox examples here http://www.jacklmoore.com/colorbox/

Step 2: Add the following inside < head > tag

Step 3: ASP.Net Listview using CommandArgument to delete the item

 

You can find much detailed information from ASP.NET Wiki: https://wiki.asp.net/page.aspx/1809/aspnet-listview-item-delete-confirmation-using-jquery-colorbox/

Visualize XSLT issue on Umbraco 4.9.1

Solution:
Modify “editXslt.aspx” xsltVisualize function as follow

Change UmbEditor._editor.selection() to UmbEditor._editor.getSelection();

FYI: You can find “editXslt.aspx” under “umbraco/developer/Xslt” folder

Capture a web page into a BMP, JPEG or PNG image in ASP.Net using IECapt#

IECapt is a small command-line utility to capture Internet Explorer’s rendering of a web page into a BMP, JPEG or PNG image file. IECapt is available in a C++ and a C# version.

For more information please visit IECapt website: http://iecapt.sourceforge.net/

Substitute 1K for 1000 or 1455 for 1.5K using ASP.Net C#

Shorten Number 1000 to 1K OR 1455 to 1.5K


private static string FormatNumber(int NumberCount)
{
if (NumberCount >= 1000000)
return FormatNumber(NumberCount / 1000) + "K";
if (NumberCount >= 1000)
return (NumberCount/1000D).ToString("0.#" + "K");
return NumberCount.ToString("#,0");
}

jQuery validation Group for ASP.NET

ASP.Net Validation Group won’t work well with jQuery CSS Form Validators.  So here in this jQuery Group Validation we are going to use two logical input forms “#product” and “#productcategory”

The main idea of separating validation groups is to notify jQuery validation that it should just ignore any input elements outside the active Div ID groups. Here we are going to use jQuery validate() ignore option and the jQuery not selector, by telling dynamically the validation object to ignore all the input elements outside the active logical form.