Saturday, 20 September 2014

What Is Media Query In Using CSS BootStrap.....

                             What Is Media Query?

One of the most important features of style sheets is that they specify how a document is to be presented on different media: on the screen, on paper, with a speech synthesizer, with a braille device, etc.

  1. here are currently two ways to specify media dependencies for style sheets:
  • Specify the target medium from a style sheet with the @media or @import at-rules.
  • Specify the target medium within the document language.
For e.g:-
<style tyle="text/css">
<!--
@media print {
    body { font-size: 10pt }
  }
  @media screen {
    body { font-size: 12pt }
  }
  @media screen, print {
    body { line-height: 1.2 }
  }
-->
</style>










Wednesday, 17 September 2014

What are Difference between (= =) and (= = =) this Two Relational Operators ?

            What are Difference between (= =) and (= = =) this Two                              Relational Operators ?

Ans:-   The  Relational Operator (a = = = b)
                  a = = = b                    a = = b when a and b are two string objects that contain equivalent characters, the = = = operator will still return true.


For e.g :-

The languages JavaScript and PHP extend this syntax, with the "= =" operator able to return true if two values are equal, even if they have different types.

(for example: "4 = = "4"" is true) and the "= = =" operator returning true only if two values are equal and have equivalent types as well (such that "4 = = = "4"" is 

false but "4 = = = 4" is true). This comes in handy when checking if a value is assigned the value of 0, since "x = = 0" is true for x being 0, but also for x being "0" 

(i.e. a string containing the character 0) and false (as PHP, like other languages, equates 0 to false), and that is not always what one wants, but "x = = = 0" is only 

true when x is 0. When comparing objects in PHP 5, the "= =" operator tests for structural equality, while the "= = =" operator tests for physical equality.







Types Of Operator......

                 Types Of Operator......

1) Unary Operator:-

The following operators are unary:
  • Increment: ++
  • Decrement: − −
  • Address: &
  • Indirection: *
  • Positive: +
  • Negative: −
  • One's complement: ~x
  • Logical negation: !x
  • Sizeof: sizeof x, sizeof(type-name)
  • Cast: (type-name) cast-expression
2)Binary Operator:-

A binary operator is an operator that operates on two operands and manipulates them to return a result.

Some common binary operators in computing include:
  • Equal (= =)
  • Not equal (! =)
  • Less than (<)
  • Greater than (>)
  • Greater than or equal to (> =)
  • Less than or equal to (< =)
  • Logical AND (&&)
  • Logical OR (||)
  • Plus (+)
  • Minus (-)
  • Multiplication (*)
  • Divide ( / )

3)Ternary Operator :-
                                          

syntax :- test ? expression 1 : expression 2

Parameter :-

testAny Boolean expression.
expression 1An expression returned if test is true. May be a comma expression.
expression 2An expression returned if test is false. More than one expression may be a linked by a comma expression.

For e.g :- 


var now = new Date();
var greeting = "Good" + ((now.getHours() > 17) ? " evening." : " day.");





Friday, 12 September 2014

Introduction Of HTML 5

                       Introduction Of HTML 5

HTML 5 is a co operation between the World Wide Web Consortium (W3C) and the Web Hypertext Application Technology Working Group (WHATWG).

WHATWG was working with web forms and applications, and W3C was working with XHTML 2.0. In 2006, they decided to cooperate and create a new version of HTML.

* Some rules for HTML 5 were established:
•New features should be based on HTML, CSS, DOM, and JavaScript
•Reduce the need for external plugins (like Flash)
•Better error handling
•More markup to replace scripting
•HTML5 should be device independent
•The development process should be visible to the public


                     strike out tags

Strike out tags:-


strike out tags used for the display the content ,

like wise login is not succuss success 

tags:-  <p>login is<strike>not succuss</strike>success</p> .


                  Audio hide and videos tags

                                         Audio hide

using  style="visibility:hidden" these properties audio are hide .


<audio controls=""  style="visibility:hidden">
<source src="songs/alimba.mp3" >
</audio>


                                         video tag

<video src="/video/pass-countdown.ogg" width="170" height="85" controls>
<p>If you are reading this, it is because your browser does not support the HTML5 video element.</p>
</video>






Sunday, 31 August 2014

Store Procedure Code In C#....

               Store Procedure Code In C#.... 
                                               In ASPX.CS
protected void btn_login_Click(object sender, EventArgs e)
        {
            SqlConnection cn = null;
            SqlCommand cmd = null;
            SqlDataReader dr = null;

            try
            {
                //////////////make connection///////////////
                cn = new SqlConnection(@"Data Source=UDAYKOTHARI-PC\SQLEXPRESS;Initial Catalog=DB_LOGIN;Integrated Security=True");

                //////////get connection string///////////

                /////////open cn/////////
                cn.Open();

                /////login logic///////////
                cmd = new SqlCommand("DB_LOGIN",cn);
                cmd.CommandType = CommandType.StoredProcedure;
                    //"SELECT COUNT (*) AS [RF] FROM dbo.tbl_login WHERE @username=username AND @password=password";
                cmd.Parameters.AddWithValue("@username",txt_username.Text);
                cmd.Parameters.AddWithValue("@password", txt_password.Text);

                cmd.Parameters.Add("@cn", SqlDbType.Int);//("@password", SqlDbType.VarChar, 50);
                cmd.Parameters["@cn"].Direction = ParameterDirection.Output;

                cmd.ExecuteNonQuery();
                //cmd.Connection = cn;
                //////////execute query////////////
                //dr = cmd.ExecuteReader();
                //if (dr.Read())
                //{
                    if (Convert.ToInt32( cmd.Parameters["@cn"].Value)>0)
                    {
                        Response.Redirect("Forgetpassword.aspx");
                    }
                    else
                    {
                        
                        Response.Write("INVALID LOGIN");
                    }
                
            }
            catch (Exception adoError)
            {
                Response.Write(adoError.ToString());
            }
            finally
            {
                //dr.Close();
                cmd.Dispose();
                cn.Close();
            }

        }

             Logic In Store Procedure

USE [DB_LOGIN]
GO
/****** Object:  StoredProcedure [dbo].[DB_LOGIN]    Script Date: 09/01/2014 11:58:40 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
ALTER PROCEDURE [dbo].[DB_LOGIN] 
-- Add the parameters for the stored procedure here
(@username varchar(50),@password varchar(50),@cn int output)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

    -- Insert statements for procedure here
SELECT @cn=COUNT (*) 
FROM dbo.tbl_login
WHERE username=@username AND password=@password

if(@cn=1)
begin
return 1;
end
else
begin 
return 0;
end



--return @cn;


END

Saturday, 16 August 2014

Register Page Using Standard Controls in the .NET Framework 4.0

Register Page Using Standard Controls in the                       .NET Framework 4.0

                             Register.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="REGISTER.aspx.cs" Inherits="using_standard_control.REGISTER" %>

<!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>
</head>
<body background=abstract-orange-background-wallpaper.jpg>
    <%--//////////////////give bachground image here/////////////////--%>
    
    <form id="form1" runat="server">
    <%--//////////////////heading of page////////////////--%>
    <div align=center><h1><font color=navy>  
        Registration Form Page </font></h1></div>
        <hr>
        <br />
        <div align=center>
    &nbsp;&nbsp;&nbsp;&nbsp;<img src="WEB-hdr-REGISTRATION.jpg" align="middle" height="100" width="600" />
    </div>
        <br>
        <%--/////////////////registration form attrubutes starts from here///////////////////--%>
    <p align=center>
        First Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="txt_firstname" runat="server" Width="353px" 
            BorderStyle="Solid"></asp:TextBox>
    </p>
    <p align=center>
        Last Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="txt_lastname" runat="server" Width="353px" BorderStyle="Solid"></asp:TextBox>
    </p>
    <p align=center>
        Username&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="txt_username" runat="server" Width="354px" BorderStyle="Solid"></asp:TextBox>
    </p>
    <p align=center>
        Password&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="txt_password" runat="server" Width="361px" BorderStyle="Solid" 
            style="margin-left: 0px" TextMode="Password"></asp:TextBox>
    </p>
    <p align=center>
        &nbsp;&nbsp;&nbsp;&nbsp; Gender&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:RadioButton ID="btn_male" runat="server" BorderColor="Red" 
            GroupName="gender" />
        Male&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:RadioButton ID="btn_female" runat="server" BorderColor="Red" 
            GroupName="gender" />
        Female</p>
    <p align=center>
        Profile Picture &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
        <asp:FileUpload ID="FileUpload1" runat="server" Height="34px" Width="258px" 
            style="margin-left: 0px" />
    </p>
    <p align=center>
        <asp:Button ID="btn_register" runat="server" Text="Register" Width="180px" 
            BackColor="#FF5BAD" BorderStyle="Solid" Height="37px" />
    </p>
    </form>
</body>
</html>

                    Register.aspx.cs

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

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

        }

        protected void btn_register_Click(object sender, EventArgs e)
        {
            ///////////////////code for uploading images/////////////////
            if (FileUpload1.HasFile)
            {
                FileUpload1.SaveAs("D:"+ FileUpload1.FileName.ToString());
            }
            else
            {
               label_fileupload.Text= "Please Browse the file first.....";
            }
        }
        
    }

}



Login Page Using Standard Control Tools From .NET Framework 4.0

Login Page Using Standard Control Tools                       From .NET Framework 4.0


                                              Login.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LOGIN.aspx.cs" Inherits="using_standard_control.LOGIN" %>

<!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>
</head>
<body>
    <form id="form1" runat="server">
    <div align=center>
    <h1><font color=navy>       Login page </font></h1></div>
    <hr>
    <br>
    <br>
   <%-- //////////////////////////Username text box////////////////////--%>
    <p align=center>
        <font color=maroon>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UserName&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="txt_username" runat="server" Width="268px" BackColor="#BFD5D5" 
            Height="29px" ontextchanged="txt_username_TextChanged"></asp:TextBox>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
            ErrorMessage="Enter Valid Username" ControlToValidate="txt_username"></asp:RequiredFieldValidator>
        </font>
    </p>
    <%--//////////////////////////////Password text box ///////////////////--%>
    <p align=center>
        <font color=maroon>Password&nbsp;&nbsp;&nbsp; &nbsp;<asp:TextBox 
            ID="txt_password" runat="server" Width="267px" BackColor="#BFD5D5" 
            Height="32px" TextMode="Password" ontextchanged="txt_password_TextChanged"></asp:TextBox>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
            ErrorMessage="Wrong Password" ControlToValidate="txt_password"></asp:RequiredFieldValidator>
        </font>
    </p>
    <%--///////////////login button/////////////--%>
    <p align=center>
        &nbsp;
        <asp:Button ID="btn_login" runat="server" BackColor="White" BorderColor="Red" 
            BorderStyle="Solid" ForeColor="#AA600D" Text="Login" Width="158px" 
            Height="45px" onclick="btn_login_Click" />
    </p>
    </form>
</body>
</html>

                        Login.aspx.cs

   In the .aspx.cs file we write the business logic for any webpage.

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

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

        }

        protected void txt_username_TextChanged(object sender, EventArgs e)
        {
            
            }

        protected void txt_password_TextChanged(object sender, EventArgs e)
        {

        }

        protected void btn_login_Click(object sender, EventArgs e)
        {
            if (txt_username.Text.Equals("Compulink") && txt_password.Text.Equals("12345"))
            {
                Response.Redirect("REGISTER.aspx");
            }
            else {
                Response.Write("ERROR while login");
            }
        }
    }
}