Thursday, 12 November 2015

boostrap

page.css

#container {
    width:100%;
    height:75%;
}
#one {
    width:50%;
    height:75%;
    float:left;
}
#two {
    width:50%;
    height:75%;
    float:left;
}
#three {
    width:100%;
    height:25%;
    float:left;
}
#four {
    width:20%;
    height:15%;
    float:left;
}
#one-switch
{
    width:75%;
    height:75%;
}
.col-lg
{
   width:100%;
}
.col-md
{
   width:105%;
}
.col-sm
{
   width:105%;
}
.col-xs
{
   width:105%;
}

pagesplit.css

#container
{
    width: 100%;
    height: 100%;
}
#innerContainer1
{
    width: 100%;
    height: 33%;
}
#oneP
{
    width: 34%;
    height: 99%;
    float: left;
}
#twoP
{
    width: 34%;
    height: 99%;
    float: left;
}
#threeP
{
    width: 29%;
    height: 99%;
    float: left;
}
#innerContainer2
{
    width: 100%;
    height: 25%;
}
#fourP
{
    width: 99%;
    height: 99%;
    float: left;
}
#innerContainer3
{
    width: 100%;
    height: 33%;
}
#fiveP
{
    width: 34%;
    height: 99%;
    float: left;
}
#sixP
{
    width: 34%;
    height: 99%;
    float: left;
}
#sevenP
{
    width: 29%;
    height: 99%;
    float: left;
}
#innerContainer4
{
    width: 100%;
    height: 9%;
}
#eightP
{
    width: 100%;
    height: 99%;
    float: left;
}


page.aspx

<div id="container">
        <div id="innerContainer1">
            <div id="oneP">
                <p>
                    <asp:Label ID="Label2" runat="server" Text="PP. No." class="col-xs-offset-1 col-sm-offset-1 col-md-offset-0 col-lg-offset-0 col-xs-4 col-sm-4 col-md-3 col-lg-3"></asp:Label>
                    <asp:TextBox ID="txtPONo" runat="server" AutoPostBack="True" class="input-sm"></asp:TextBox>
                </p></div>


<div id="twoP">
                <p>
                    <asp:Label ID="Label6" runat="server" Text="PP. End Date." class="col-xs-offset-0 col-sm-offset-0 col-md-offset-0 col-lg-offset-0 col-xs-0 col-sm-0 col-md-3 col-lg-3"></asp:Label>
                    <asp:TextBox ID="txtPPEndDate" runat="server" AutoPostBack="True" class="input-sm"></asp:TextBox>
                </p>
</div></div>

Time Display To the Textbox

Dropdownlist Binding

 static int i;

        protected void Page_Load(object sender, EventArgs e)
        {

            if (!IsPostBack)
            {

                for (i = 1; i < 12; i++)
                {

                    DropDownList1.Items.Add(new ListItem(i.ToString(), i.ToString()));

                }
                for (int j = 1; j < 60; j++)
                {

                    DropDownList2.Items.Add(new ListItem(j.ToString(), j.ToString()));

                }
            }

Time display to the textbox

 protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {
            ViewState["Time1"] = DropDownList1.SelectedItem.Text;
            ViewState["Time2"] = ViewState["Time2"] = Convert.ToBoolean(null) ? "" : ViewState["Time2"];
            //ViewState["Time3"] = ViewState["Time3"] = Convert.ToBoolean(null) ? "" : ViewState["Time3"];
           TextBox1.Text = ViewState["Time1"].ToString() + ":" + ViewState["Time2"] + " " + ViewState["Time3"];
        }

       
        

        protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
        {
            ViewState["Time2"] = DropDownList2.SelectedItem.Text;
            ViewState["Time3"] = ViewState["Time3"] = Convert.ToBoolean(null) ? "" : ViewState["Time3"];
            TextBox1.Text = ViewState["Time1"].ToString() + ":" + ViewState["Time2"].ToString() + " " + ViewState["Time3"];
          
        }

        

        protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e)
        {
            ViewState["Time3"] = DropDownList3.SelectedItem.Text;
            TextBox1.Text = ViewState["Time1"].ToString() + ":" + ViewState["Time2"].ToString() + " " + ViewState["Time3"];
        }

Monday, 2 November 2015

Only Date Display



txtPODate.Text = DateTime.Now.ToString("yyyy-MM-dd").ToString();

Sunday, 1 November 2015

Query String Used to Passed Id to the Code behind

Html List

<li id="Link" ><a class="btn-default" href="?id=1">Log off.</a></li>
(key: passed id to the next page )


Code Behind


 protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["id"] == "1")
            {
                logout();
            }

        }

        private void logout()
        {
            //code

        }

Saturday, 31 October 2015

Ajax Toolkit Calendar

1. Apply Script Manger

<asp:ScriptManager ID="Script" runat="server"></asp:ScriptManager>

2.Using this code inside of Textbox

  <asp:TextBox ID="txtEndDate" runat="server" CssClass="input-sm"></asp:TextBox>

                <ajaxToolkit:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="txtEndDate" Format="dd/MM/yyyy" />


    (key Words: target Control Id is Textbox Id )

Web Browser Closing



onclick="return closeClick();"


Javascript
<script type="text/javascript">
        function closeClick() {
            window.open("about:blank", "_self");
            window.close();
        };
    </script>