Friday, 16 August 2013

HOW TO MAKE SIMPLE LIGHTBOX

In this example I am going to explain how a light box can be created without JQUERY or any other such extensions.




<!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>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>LIGHT BOX</title>
    <script type="text/javascript">
    function test()
    {
     
    light.style.display ="inline-block";
    }

    function hide()
    {
    light.style.display="none";
    }
    </script>
</head>
<body>

<a onclick="test()"><img src="tulips.jpg" alt="image not found" width="146" height="118" align="middle" /></a>
     

<div id="light" onclick="hide()" style="display:none;background-color: #000000; opacity:.9;text-align: center; background-position: center; top: 0px; right: 0px; bottom: 0px; left: 0px; position: absolute; z-index: 2;">
<img src="
tulips.jpg" />

 </div>

</body>
</html>





Even though I use HTML here, you can covert it into any other programming language.





Tuesday, 13 August 2013

PLAYING MISSILE GAME ON YOUTUBE




Step 1) Open Youtube and just click any video.


Step 2) While the page is loading type 1980



Enjoy your GAME and make your buffering time entertaining.............

Monday, 12 August 2013

SAVING GRIDPANEL VALUES WITH DRAG AND DROP FACILITY TO DATABASE IN EXT.NET



In the previous post it is mentioned how to enable drag and drop feature in a gridpanel without any additional DLLs.

So first add a grid panel with drag and drop facility in aspx page.




<ext:GridPanel
            ID="GridPanel1"
            runat="server"
            StoreID="Store1"
            Title="Drag and drop to adjust Timetable"
            Collapsible="true"
            Cls="x-grid-custom"
            ForceFit="true">
            <ColumnModel ID="ColumnModel1" runat="server">
             <Columns>
                    <ext:Column ID="Column1" runat="server" Text="Monday" DataIndex="Monday" Width="75" />
                    <ext:Column ID="Column2" runat="server" Text="Tuesday" Width="75" DataIndex="Tuesday"/>
                    <ext:Column ID="Column3" runat="server" Text="Wednesday" Width="75" DataIndex="Wednesday" />
                    <ext:Column ID="Column4" runat="server" Text="Thursday" Width="75" DataIndex="Thursday" />
                     <ext:Column ID="Column5" runat="server" Text="Friday" Width="75" DataIndex="Friday" />
                     <ext:Column ID="Column6" runat="server" Text="Saturday" Width="75" DataIndex="Saturday" />
             </Columns>
            </ColumnModel>
         
              <View>
                <ext:GridView ID="GridView1" runat="server">  
                  <Plugins>                                                  
                   <ext:CellDragDrop ID="CellDragDrop1" runat="server" ApplyEmptyText="false" EnforceType="true" />    
                  </Plugins>                    
                </ext:GridView>            
             </View>                  
</ext:GridPanel>
         <ext:Label ID="Label1" runat="server" Hidden="true" /><br />
         <ext:Label ID="Label2" runat="server" Hidden="true"/><br />
         <ext:Label ID="Label3" runat="server" Hidden="true"/><br />
         <ext:Label ID="Label4" runat="server" Hidden="true"/><br />
         <ext:Label ID="Label5" runat="server" Hidden="true"/><br />
         <ext:Label ID="Label6" runat="server" Hidden="true"/>




The labels are temporary storage locations and therefore you have to give the same number of Labels as that of the columns.Here I use 6 Labels since I had 6 columns.
Now at the code behind section give the following code.




     protected void SubmitSelection(object sender, DirectEventArgs e)
        {
            string json = e.ExtraParams["Values"];
            Dictionary<string, string>[] companies = JSON.Deserialize<Dictionary<string, string>[]>(json);
            foreach (Dictionary<string, string> row in companies)
            {
                int i = 1;
                StringBuilder sb = new StringBuilder();
                StringBuilder sb1 = new StringBuilder();
                StringBuilder sb2 = new StringBuilder();
                StringBuilder sb3 = new StringBuilder();
                StringBuilder sb4 = new StringBuilder();
                StringBuilder sb5 = new StringBuilder();
                foreach (KeyValuePair<string, string> keyValuePair in row)
                {
                    if (i == 1)
                    {
                        sb.Append(keyValuePair.Value);
                    }
                    else if (i == 2)
                        sb1.Append(keyValuePair.Value);
                    else if (i == 3)
                        sb2.Append(keyValuePair.Value);
                    else if (i == 4)
                        sb3.Append(keyValuePair.Value);
                    else if (i == 5)
                        sb4.Append(keyValuePair.Value);
                    else if(i == 6)
                        sb5.Append(keyValuePair.Value);
                    i++;
                }
                this.Label1.Text = sb.ToString();
                this.Label2.Text = sb1.ToString();
                this.Label3.Text = sb2.ToString();
                this.Label4.Text = sb3.ToString();
                this.Label5.Text = sb4.ToString();
                this.Label6.Text = sb5.ToString();
                SqlConnection con = new SqlConnection("YOUR CONNECTIONSTRING");
                string query = "insert into tablename 0values ('" + Label1.Text + "','" + Label2.Text + "','" + Label3.Text + "','" + Label4.Text + "','" + Label5.Text + "','" + Label6.Text + "')";
                SqlCommand cmd = new SqlCommand(query, con);
                con.Open();
                cmd.ExecuteNonQuery();
                con.Close();



In this the 'i' value represents the number of columns.



ADDING DRAG AND DROP FEATURE ON GRIDPANEL IN EXT.NET




Add this simple code for enabling drag and drop feature on a GridPanel in EXT.NET.





<ext:GridPanel
            ID="GridPanel1"
            runat="server"
            StoreID="Store1"
            Title="Drag and drop to adjust Timetable"
            Collapsible="true"
            Cls="x-grid-custom"
            ForceFit="true">
            <ColumnModel ID="ColumnModel1" runat="server">
           <Columns>
                    <ext:Column ID="Column1" runat="server" Text="Monday" DataIndex="Monday" Width="75" />
                    <ext:Column ID="Column2" runat="server" Text="Tuesday" Width="75" DataIndex="Tuesday"/>
                    <ext:Column ID="Column3" runat="server" Text="Wednesday" Width="75" DataIndex="Wednesday" />
                    <ext:Column ID="Column4" runat="server" Text="Thursday" Width="75" DataIndex="Thursday" />
                     <ext:Column ID="Column5" runat="server" Text="Friday" Width="75" DataIndex="Friday" />
                     <ext:Column ID="Column6" runat="server" Text="Saturday" Width="75" DataIndex="Saturday" />
           </Columns>
            </ColumnModel>
           
              <View>                      <ext:GridView ID="GridView1" runat="server">                    <Plugins>                                                          <ext:CellDragDrop ID="CellDragDrop1" runat="server" ApplyEmptyText="false" EnforceType="true" />                                               </Plugins>                        </ext:GridView>                    </View>                  
         
        </ext:GridPanel>



For saving the GridPanel which is altered using Drag and Drop Feature,just go through the next post.....

Sunday, 11 August 2013

NOKIA MORPH- 'LET IT BE YOUR NEXT MOBILE PHONE'