Tuesday, 14 October 2014

RegisterForEventValidation can only be called during Render();

Error : RegisterForEventValidation can only be called during Render();















Wednesday, 8 October 2014

What is Grid VIew Control in Asp.Net c#

GRIDVIEW DATA CONTROL











Textbox Enter Values Even Display Another LABEL or TEXTBOX in Asp.Net C#

No comments    
categories: , ,
TextBox Enter Values Display Another






Html Coding


<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>

</head>
<body>
    <form id="form1" runat="server">
    <div>
          <table><tr><td><asp:TextBox ID="TextBox1" runat="server"
 AutoPostBack="True" OnTextChanged="TextBox1_TextChanged"></asp:TextBox>      
    </td>
        <td><asp:Label ID="Label1" runat="server" Text="Label"></asp:Label></td></tr></table>
        
        
    </div>
    </form>
</body>
</html>








Convert Text to UpperCase While Typing TextBox in Asp.Net C#

No comments    
categories: , ,
TextBox Text Convert to UpperCase



                              i think useful this post.

Validation to Check Terms and Conditions Checkbox Checked or Not Using Asp.Net C#

CheckBox Use Terms and Conditions

Validation for terms and conditions checkbox checked or  not  check terms and conditions checkbox selected or not using c# or restrict user to accept terms and conditions using Asp.net c#.

If Checkbox Checked = True    Agreed 

If Checkbox  Checked = False  Not Agreed



                         DEMO






                            
                               Html Coding


 <html xmlns="http://www.w3.org/1999/xhtml">
   <head>
    <title></title>    
      </head>
   <body>
    <form id="form1" runat="server">
    <div>              
          <table>

            <tr><td>
                <asp:Label ID="Label1" runat="server" Text="Name"></asp:Label>
                </td><td>
                    <asp:TextBox ID="txtName" runat="server"></asp:TextBox>
                </td></tr>
               <tr><td>
                <asp:Label ID="Label2" runat="server" Text="Mobile"></asp:Label>
                </td><td>
                    <asp:TextBox ID="txtMobile" runat="server"></asp:TextBox>
                </td></tr>
            <tr><td> Check Status:</td><td>
                <asp:CheckBox ID="ChkTermsCondition" runat="server" />
          Agree Terms & Conditions</td></tr>
            <tr><td></td><td><asp:Button ID="btnSave" runat="server" Text="Check"  />
                </td></tr>
                           
        </table>
    </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;
using System.Data;
using System.Data.SqlClient;

public partial class Termss : System.Web.UI.Page
{
    SqlConnection con;
    SqlCommand cmd;
    SqlDataAdapter adp;
    SqlDataReader rd;
    DataSet ds;
    string query;

    public void dbcon()
    {
        string connn = (System.Configuration.ConfigurationManager.ConnectionStrings["dbcon"].ToString());
        con = new SqlConnection(connn);
        con.Open();

    }

    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void btnSave_Click(object sender, EventArgs e)
    {

        dbcon();

        if (ChkTermsCondition.Checked == true)
        {
            query = "insert into terms(name,mobile)values('" + txtName.Text + "' ,'" + txtMobile.Text + "')";
            cmd = new SqlCommand(query, con);
            cmd.ExecuteNonQuery();
            Response.Write("<script>alert('Terms & Condition Accepted')</script>");
        }
        else
        {
            Response.Write("<script>alert('Please Select Terms & Condition')</script>");
        }

    }

}




Html Coding

 <html xmlns="http://www.w3.org/1999/xhtml">
   <head>
    <title></title>     
      </head>
   <body>
    <form id="form1" runat="server">
    <div>               
          <table>

            <tr><td>
                <asp:Label ID="Label1" runat="server" Text="Name"></asp:Label>
                </td><td>
                    <asp:TextBox ID="txtName" runat="server"></asp:TextBox>
                </td></tr>
               <tr><td>
                <asp:Label ID="Label2" runat="server" Text="Mobile"></asp:Label>
                </td><td>
                    <asp:TextBox ID="txtMobile" runat="server"></asp:TextBox>
                </td></tr>
            <tr><td> Check Status:</td><td> 
                <asp:CheckBox ID="ChkTermsCondition" runat="server" />
          Agree Terms & Conditions</td></tr>
            <tr><td></td><td><asp:Button ID="btnSave" runat="server" Text="Check"  />
                </td></tr>
                            
        </table>
    </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;
using System.Data;
using System.Data.SqlClient;

public partial class Termss : System.Web.UI.Page
{
    SqlConnection con;
    SqlCommand cmd;
    SqlDataAdapter adp;
    SqlDataReader rd;
    DataSet ds;
    string query;
   
    public void dbcon()
    {
        string connn = (System.Configuration.ConfigurationManager.ConnectionStrings["dbcon"].ToString());
        con = new SqlConnection(connn);
        con.Open();

    }

    protected void Page_Load(object sender, EventArgs e)
    {

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

        dbcon();

        if (ChkTermsCondition.Checked == true)
        {
            query = "insert into terms(name,mobile)values('" + txtName.Text + "' ,'" + txtMobile.Text + "')";
            cmd = new SqlCommand(query, con);
            cmd.ExecuteNonQuery();
            Response.Write("<script>alert('Terms & Condition Accepted')</script>");
        }
        else
        {
            Response.Write("<script>alert('Please Select Terms & Condition')</script>");
        }

    }
}














                                     i think useful this post.

Check Terms and Conditions Checkbox Checked or Not Using jQuery Validation

No comments    
categories: , ,
Check Terms & Condition

 JQuery Validation for terms and conditions checkbox checked or not  check Terms and Conditions checkbox selected or not using jQuery or restrict user to accept terms and conditions using jQuery.

If  Checked Checkbox  After  Control  to Agreed  Terms and Conditions.

if  Not Checked  checkbox Control  to Not Agreed  Terms and Conditions.

                      DEMO












                           JQuery Coding


 <html xmlns="http://www.w3.org/1999/xhtml">
   <head>
    <title></title>

     <%--  Terms Condition  JQuery Coding Start--%>

    <script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>
    <script type="text/javascript">
        $(function () {
            $('#btnSave').click(function () {
                if ($('#ChkTermsCondition').is(':checked')) {
                    alert('Your Agreed Terms & Conditions')
                }
                else {
                    alert('please check terms & conditions')
                }
            })
        })
    </script>

        <%--  Terms Condition  JQuery Coding End--%>

      </head>
   <body>
    <form id="form1" runat="server">
    <div>              
          <table>

            <tr><td>
                <asp:Label ID="Label1" runat="server" Text="Name"></asp:Label>
                </td><td>
                    <asp:TextBox ID="txtName" runat="server"></asp:TextBox>
                </td></tr>
               <tr><td>
                <asp:Label ID="Label2" runat="server" Text="Mobile"></asp:Label>
                </td><td>
                    <asp:TextBox ID="txtMobile" runat="server"></asp:TextBox>
                </td></tr>
            <tr><td> Check Status:</td><td>
                <asp:CheckBox ID="ChkTermsCondition" runat="server" />
          Agree Terms & Conditions</td></tr>
            <tr><td></td><td><asp:Button ID="btnSave" runat="server" Text="Check"  />
                </td></tr>
                           
        </table>
    </div>
    </form>
</body>

</html>