Archive

Archive for June, 2014

Disable Alert me in SharePoint 2010

June 23, 2014 Leave a comment

Hi all,

try this example to disable Alert me SharePoint 2010

Functions Alert me : Receive email notifications when things change.

Disable-Alert-Me-SharePoint2010-1

Steps :

1. log-in Central administrator > Manage Web Applications
2. Highlight on your web application disable alert me > General Settings
3. Alerts : Change Alerts on to off

Disable-Alert-Me-SharePoint2010-2

4.Click Save.

Now Refresh site SharePoint again . Functions Alert me it hide on library tools.

Disable-Alert-Me-SharePoint2010-3

Hope this helps

Good Luck.

 

Advertisements
Categories: SharePoint 2010

Format GridView Rows Based On Data In ASP.Net

June 20, 2014 Leave a comment

Hi all,

try this example to Format GridView Rows Based On Data In ASP.Net

FormatedGridview

We can format Gridview Rows based on Data using the following code :

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class FormateFieldInGridview : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}

public string FormatEmpSal(object objEmpSal)
{
if (objEmpSal.Equals(DBNull.Value.ToString()))
{
return "<span style='color: red; font-weight: bold;'>EmpSal is Blank</span>";
}
else
{
decimal Sal = Convert.ToDecimal(objEmpSal);
if (Sal <= 0)
{
return "<span style='color: red; font-weight: bold;'>EmpSal is Zero</span>";
}
else
{
return Sal.ToString();
}
}
}
}

then we can Call this method in GridView

FormatedGridviewCode

Hope this helps

Good Luck.

Categories: ASP.Net

Get Selected Value and Text from CheckBoxList Using JQuery

June 6, 2014 1 comment

Dear all,

try this example to Get Selected Value and Text from CheckBoxList Using JQuery


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="scripts/jquery-1.4.3.min.js" type="text/javascript"></script>
<script type="text/javascript">
function btnShow_onclick() {
$("#spnLabels").text("");
$("#spnValues").text("");
var labels = "";
var values = "";
$("#<%= CheckBoxList1.ClientID %> input:checkbox:checked").each(function() {
var label = $('label[for=' + this.id + ']').html();
var value = $(this).parent().attr('hiddenValue');
labels += label + ", ";
values += value + ", ";
});
labels = labels.substring(0, labels.length - 2);
values = values.substring(0, values.length - 2);
$("#spnLabels").text(labels);
$("#spnValues").text(values);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:CheckBoxList ID="CheckBoxList1" runat="server">
<asp:ListItem Text="Google" Value="1" />
<asp:ListItem Text="Yahoo" Value="2" />
<asp:ListItem Text="Bing" Value="3" />
</asp:CheckBoxList>
<br />
<input id="btnShow" type="button" value="Show Selected Items" onclick="return btnShow_onclick()" />
<br />
<br />
<span id="spnLabels"></span>
<br />
<br />
<span id="spnValues"></span>
<br />
</form>
</body>
</html>

Hope this helps

Good Luck.

Categories: ASP.Net, Jquery

Remove Non Number from TextBox Using Javascript

Hi all ,

try this example to remove non number from TextBox control

Javascript Code :

function removeNonNumeric(txt) {
var text = document.getElementById(txt.id).value;
var numericString = text.replace(/[^0-9]/g, '');
document.getElementById(txt.id).value = numericString;
}

In Code behind :

TextBox1.Attributes.Add("onkeypress", "removeNonNumeric(this)");

or In ASPX Page :

<asp:TextBox ID="TextBox1" runat="server" onkeypress="removeNonNumeric(this);"></asp:TextBox>

Hope this helps

Good Luck.

Categories: ASP.Net, Javascript