Saturday, 19 December 2015

12/24 Hour Time format Using Asp.Net C#

   12/24 Hour Time format

Current System Datetime or Server Datetime convert to 12/24 Hour format.

                    Html Coding

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>12/24 Hour Time format Using Asp.Net C#</title>
</head>
<body>
    <form id="form1" runat="server">
    <div align="center">
        <br />
        <asp:Label ID="lblTimeFormat" runat="server" Text="Label"></asp:Label>    </div>
    </form>
</body>

</html>
                      C# Coding

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

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

        lblTimeFormat.Text = DateTime.Now.ToString();
        // 24 hour Time Format
        lblTimeFormat.Text = DateTime.Now.ToString("HH:mm");
        //// 12 Hour Time Format
        lblTimeFormat.Text = DateTime.Now.ToString("hh:mm");
        //// 24 Hour with Seconds
        lblTimeFormat.Text = DateTime.Now.ToString("HH:mm:ss");
        //// 12 Hour with Seconds
        lblTimeFormat.Text = DateTime.Now.ToString("hh:mm:ss");
        //// 24 Hour with AM or PM
        lblTimeFormat.Text = DateTime.Now.ToString("HH:mm:ss tt");
        //// 12 Hour with AM or PM
        lblTimeFormat.Text = DateTime.Now.ToString("hh:mm:ss tt");
        // 24 Hour with Month display
        lblTimeFormat.Text = DateTime.Now.ToString("dd/MMM/yyyy HH:mm:ss tt");
        // 24 Hour with 3 Character Day display
        lblTimeFormat.Text = DateTime.Now.ToString("ddd/MMM/yyyy HH:mm:ss tt");
        // 24 Hour with Month & Day display
        lblTimeFormat.Text = DateTime.Now.ToString("d/MMM/yyyy HH:mm:ss tt");
        // 24 Hour with Full Day display
        lblTimeFormat.Text = DateTime.Now.ToString("dddd/MMM/yyyy HH:mm:ss tt");
        // 24 Hour with 3 Character Day display
        lblTimeFormat.Text = DateTime.Now.ToString("ddd/MMMM/yyyy HH:mm:ss tt");
        // 12 Hour with Hour display
        lblTimeFormat.Text = DateTime.Now.ToString("dd/MMMM/yyyy h:mm:ss");
        // 24 Hour with Hour display
        lblTimeFormat.Text = DateTime.Now.ToString("dd/MMMM/yyyy H:mm:ss");

    }

}


// Current Datetime

        DateTime.Now.ToString();

                        Demo

                                    

// 24 hour Time Format
      
     DateTime.Now.ToString("HH:mm");

                         Demo
                                          

 //// 12 Hour Time Format

      DateTime.Now.ToString("hh:mm");
       
                          Demo

                                           

 //// 24 Hour with Seconds

         DateTime.Now.ToString("HH:mm:ss");

                Demo

                                       
//// 12 Hour with Seconds

      DateTime.Now.ToString("hh:mm:ss");

                 Demo

                                           
//// 24 Hour with AM or PM

 DateTime.Now.ToString("HH:mm:ss tt");
        
                  Demo 

                                         

 //// 12 Hour with AM or PM

       DateTime.Now.ToString("hh:mm:ss tt");
               
                 Demo 
                           
                         

 // 24 Hour with Month display

DateTime.Now.ToString("dd/MMM/yyyy HH:mm:ss tt");

                 Demo 
                      
                             
 // 24 Hour with 3 Character Day display

DateTime.Now.ToString("ddd/MMM/yyyy HH:mm:ss tt");

                 Demo 

        

// 24 Hour with Month & Day display

 DateTime.Now.ToString("d/MMM/yyyy HH:mm:ss tt");

                 Demo 

          

        // 24 Hour with Full Day display

DateTime.Now.ToString("dddd/MMM/yyyy HH:mm:ss tt");
      
                  Demo 

           

   // 24 Hour with 3 Character Day display

    DateTime.Now.ToString("ddd/MMMM/yyyy HH:mm:ss tt");

                 Demo 

       
        // 12 Hour with Hour display

 DateTime.Now.ToString("dd/MMMM/yyyy h:mm:ss");

                 Demo 
          

        // 24 Hour with Hour display

 DateTime.Now.ToString("dd/MMMM/yyyy H:mm:ss");

                  Demo 

           


  




Monday, 14 December 2015

Draggable or Movable div Using Jquery in Asp.Net

Draggable div Using Jquery

Div tag Drag or move One place to another place Using JQuery in Asp.Net.

                                 DEMO


                         Download

                    HTML Coding

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Draggable or Movable div Using Jquery in Asp.Net</title>

    <script src="Scripts/jquery-1.8.2.min.js" type="text/javascript"></script>
    <script src="Scripts/jquery-ui-1.8.24.custom.min.js" type="text/javascript"></script>     
<script  type="text/javascript">
    $(document).ready(function () {
        $("#div1").draggable();
        $("#div2").draggable();
        $("#div3").draggable();
        $("#div4").draggable();
    });
</script>

<style type="text/css">
    .div01
    {      
        color:greenyellow;
        padding20px;
         width25px;
        height25px;      
        font-size20px;
        font-weightbold;
        cursorpointer;
         bordersolid 5px #ccc;
    }
     .div02
    {      
        color:lightpink;
        padding20px;
        width25px;
         height25px;         
        font-size20px;
        font-weightbold;
        cursorpointer;
         bordersolid 5px #ccc;
    }
      .div03
    {      
        color:maroon;
        padding20px;
        width25px;
         height25px;         
        font-size20px;
        font-weightbold;
        cursorpointer;
         bordersolid 5px #ccc;
    }
       .div04
    {      
        color:blueviolet;
        padding20px;
        width25px;
          height25px;            
        font-size20px;
        font-weightbold;
        cursorpointer;
         bordersolid 5px #ccc;
    }
</style>   
</head>
<body>
    <div align="center">
<div id="div1"  class="div01">
                    3
</div>
    <div id="div2" class="div02">
2
    </div>
    <div id="div3" class="div03">
4</div>
    <div id="div4" class="div04">
1</div></div>
</body>

</html>