In Asp.net check at least one checkbox is selected in CheckBoxList using Javascript

function Validate_Checkbox()
{
// GET CHECKBOXLIST OBJECT
var chks= document.getElementById(”);

var chkListinputs = chks.getElementsByTagName(“input”);
var hasChecked = false;
for (var i = 0; i < chkListinputs.length; i++)
{
if (chkListinputs[i].checked)
{
hasChecked = true;
break;
}
}
if (hasChecked == false)
{
alert("Please select at least one Plan!");

return false;
}

return true;

}

//Calling method
OnClientClick=”return Validate_Checkbox()”

Immediate Button Disable On Click – ASP.net/Javascript

note :immediate button Disable when click on button ..after your process complete button enable.

protected void Page_Load( object sender, EventArgs e)
{

btnname.Attributes.Add(“onclick”, @” this.value=””Processing…”” ;this.disabled = true; ” + this.Page.ClientScript.GetPostBackEventReference(btnname, null) + “;”);

}

protected void btnname_Click( object sender, EventArgs e)
{

//cause delay
System.Threading.Thread.Sleep(3000);

}

Data Table horizontal (side to side) Data Show in Vertical Direction (Up and Down) in GridView c#

public DataTable FlipDataTable(DataTable dt)
{
DataSet ds = new DataSet();
DataTable table = new DataTable();

for (int i = 0; i <= dt.Rows.Count; i++)
{
//First you create New Table Column
table.Columns.Add(Convert.ToString(i));
}
//Initilize Row
DataRow row;
for (int k = 0; k < dt.Columns.Count; k++)
{
//Create New Row
row = table.NewRow();
//Insert Data Into Row.
row[0] = dt.Columns[k].ToString();
for (int j = 1; j <= dt.Rows.Count; j++)
row[j] = dt.Rows[j - 1][k];
table.Rows.Add(row);
}

return table;
}
hope its help, This code is not totally my effort without google its not easy i think there is different ways to Filp Data but in my views its easy and understable.

Failed to access IIS metabase

 

followed below steps to resolve the issue -

 

1. Unregistered all the versions of ASP.NET with command “C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis –ua”.

 

2. Deleted the ASPNET account from “Local Users and Group – Users”.

 

3. Then registered ASP.NET 2.0 with IIS using “C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis –i”.

 

4. Gave permissions to the ASPNET account using “C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis –ga machinename\ASPNET”.

 

5. Reset the IIS and that resolved the issue for ASP.NET 2.0.

 

6. We registered ASP.NET 1.1 with IIS as well using command “C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet_regiis –i”.

 

7. Reset the IIS.

 

 

 

After following the above steps we configured virtual directory versions as required and test both ASP.NET 1.1 and ASP.NET 2.0 application.

 

Everything worked fine as expected.

Send Email using C# (Desktop App) with using your GMAIL Account..

First you Create New Project

Put button On your form

Double Click button1 and write on top of page Using System.Net.mail

using  System.Net.Mail;

System.net.mail

Now you Write a method Which Send Your Email

Mail Sending Method

   private Boolean SendEMail()
        {
            try
            {

                MailMessage mail = new MailMessage();
                SmtpClient SmtpServer = new SmtpClient(“smtp.gmail.com”);
                //Your Id write here
                mail.From = new MailAddress(“yourID@gmail.com”);
                //Sending Address write here
                mail.To.Add(“SendIDONe@hotmail.com , SendIDTWO@hotmail.com “);
                mail.Subject = “Test Email…..”;
                mail.Body = “Hope You Received My Mail”;
                SmtpServer.Port = 587;
                SmtpServer.Credentials = new System.Net.NetworkCredential(“yourID@gmail.com”, “YourIdPassword”);
                SmtpServer.EnableSsl = true;

                SmtpServer.Send(mail);
                return true;
            }
            catch (Exception ex)
            {
                return false;
            }

        }

Call Your Method ON button1 Click….

Call SendEmail Method

        private void button1_Click(object sender, EventArgs e)
        {
            SendEMail();
        }

Hope Its HelpFull to you