How to get the value of a CSS property using jQuery?
Consider the following HTML:
<div id="jjTechSol" style="height: 50px;width: 50px;">
<p>Content</p>
</div>
The following jQuery is used to get the value of a CSS property.
<script type="text/javascript">
$(document).ready(function.
How to Compare two fields with jQuery validate plugin?
Consider the following HTML.
<input type="text" id="txtEmail" name="Email" />
<input type="text" id="txtConfirmEmail" name="ConfirmEmail" />
The following script is used to Compare two fields with jQuery validate plugin.
$('#myform').validate({
.
How to convert the first character of a string into upper case?
The following C# code is used to convert the first character of a string into upper case.
static string UppercaseFirst(string s)
{
// Check for empty string.
if (string.IsNullOrEmpty(s))
{
return string.Empty;
}
// Return char and.
How to convert all first letters of a sentence into upper case and rest of the letters into lower case?
The following C# code is used to convert all first letters of a sentence into upper case and rest of the letters into lower case.
string s = "THIS IS MY TEXT RIGHT NOW";
s = System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(s.ToLower());
//.
How to check whether an Umbraco Node has children or not?
The following Razor code is used to check whether an Umbraco Node has children or not.
bool hasChildren = (Model.ChildrenAsList.Count() > 0);
if(hasChildren)
{
//code
}
else
{
//code
}.
Razor function to fetch the Data Type Items in Umbraco
The following Razor function is used to fetch the Data Type Items in Umbraco.
Namespaces Required:
using System.Xml.XPath;using umbraco.MacroEngines;
@functions{
public List<string> FetchDataTypeItems(int DataTypeNodeID)
.
How to get the URL of the current page
The following code is used to get the URL of the current page.
string url = HttpContext.Current.Request.Url.AbsoluteUri;
// http://localhost:1302/TESTERS/Default6.aspx
string path = HttpContext.Current.Request.Url.AbsolutePath;
// /TESTERS/Default6.aspx
string.