Saturday, July 21, 2018

how to use dropdownlist in asp.net | Sradha WebCreations

how to use dropdownlist in asp.net

 http://sradhawebcreations.com
front end /user inter face 

="ProductOrderByCustomer.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ProductOrderByCustomer.aspx.cs" Inherits="ProductOrderByCustomer" %>

<!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>
    <style type="text/css">

        .style1
        {
            width: 100%;
        }
        .style2
        {
            height: 23px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
   
        <table class="style1">
            <tr>
                <td align="center" colspan="2">
                    PRODUCT / SERVICES ENQUIRE</td>
            </tr>
            <tr>
                <td class="style2">
                    Customer Name :</td>
                <td class="style2">
                    <asp:TextBox ID="TextBox1" runat="server" Width="216px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    Email Id :</td>
                <td>
                    <asp:TextBox ID="TextBox2" runat="server" Width="216px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    Mobile No :</td>
                <td>
                    <asp:TextBox ID="TextBox3" runat="server" Width="139px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    Land Line :</td>
                <td>
                    <asp:TextBox ID="TextBox4" runat="server" Width="138px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    State&nbsp;&nbsp;&nbsp; City&nbsp;&nbsp;&nbsp; Area&nbsp;&nbsp;&nbsp; :</td>
                <td>
                    <asp:DropDownList ID="DropDownList1" runat="server">
                        <asp:ListItem>-Slelect State-</asp:ListItem>
                        <asp:ListItem>Bihar</asp:ListItem>
                        <asp:ListItem>Odisha</asp:ListItem>
                        <asp:ListItem>West Bengal</asp:ListItem>
                        <asp:ListItem>Jharkhand</asp:ListItem>
                    </asp:DropDownList>
&nbsp;&nbsp;&nbsp;&nbsp;
                    <asp:DropDownList ID="DropDownList2" runat="server">
                        <asp:ListItem>-Select City-</asp:ListItem>
                        <asp:ListItem>Patna</asp:ListItem>
                        <asp:ListItem>Darbhanga</asp:ListItem>
                        <asp:ListItem>Madhubani</asp:ListItem>
                        <asp:ListItem>BBSR</asp:ListItem>
                        <asp:ListItem>Cuttack</asp:ListItem>
                        <asp:ListItem>Balasore</asp:ListItem>
                        <asp:ListItem>Bhadrak</asp:ListItem>
                    </asp:DropDownList>
&nbsp;&nbsp;&nbsp;&nbsp;
                    <asp:DropDownList ID="DropDownList3" runat="server">
                        <asp:ListItem>-Select Area-</asp:ListItem>
                        <asp:ListItem>Link Road</asp:ListItem>
                        <asp:ListItem>Badambadi</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    Product / Services :</td>
                <td>
                    &nbsp;&nbsp; Catagory :
                    <asp:DropDownList ID="DropDownList4" runat="server" Height="20px"
                        onselectedindexchanged="DropDownList4_SelectedIndexChanged" onclick="DropDownList4_SelectedIndexChanged"
                        Width="160px" AutoPostBack="True">
                    </asp:DropDownList>
&nbsp;<asp:Button ID="Button5" runat="server" onclick="Button5_Click" Text="Description" />
&nbsp;<asp:TextBox ID="TextBox8" runat="server" Height="57px" TextMode="MultiLine" Width="227px"
                        ></asp:TextBox>
&nbsp;&nbsp;
                    <asp:Button ID="Button4" runat="server" Text="Select" />
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <asp:TextBox ID="TextBox5" runat="server" Height="60px" TextMode="MultiLine"
                        Width="468px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    Special Interest :</td>
                <td>
                    <asp:TextBox ID="TextBox6" runat="server" Height="53px" TextMode="MultiLine"
                        Width="305px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
                <td>
                    <br />
                    <asp:Button ID="Button1" runat="server" Height="33px" onclick="Button1_Click"
                        Text="Submit" Width="92px" />
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                </td>
            </tr>
        </table>
   
    </div>
    </form>
</body>
</html>

back end /database  

ProductOrderByCustomer.aspx.cs
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;
using System.Configuration;
using System.Web.Security;
using System.Net;
using System.Net.Mail;

public partial class ProductOrderByCustomer : System.Web.UI.Page
{
    SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["dbConnection"].ConnectionString);
    protected void Page_Load(object sender, EventArgs e)
    {
        con.Open();

        if (!IsPostBack)
{
BindContrydropdown();
}
}

    protected void BindContrydropdown()
    {

        SqlCommand cmd = new SqlCommand("select DISTINCT Catagory from ProductByAdmin", con);
        SqlDataReader dr = cmd.ExecuteReader();
        if (dr.Read() == true)
        {
           DropDownList4.DataTextField = "Catagory";
            DropDownList4.Items.Add( dr["Catagory"].ToString());
           // ListBox1.DataTextField = "Catagory";
           // ListBox1.Items.Add(dr["Catagory"].ToString());
        }

        dr.Close();
    }
    protected void Button1_Click(object sender, EventArgs e)
    {

    }
    protected void DropDownList4_SelectedIndexChanged(object sender, EventArgs e)
    {
       
    }
    protected void Button5_Click(object sender, EventArgs e)
    {
        if (TextBox8.Text == "" || TextBox8.Text == null)
        {
            TextBox8.Text = DropDownList4.SelectedItem.ToString();
        }
        else
        {
            TextBox8.Text = TextBox8.Text + "\n" + DropDownList4.SelectedValue.ToString();
        }
    }
   
}


how to enscript your connection string in share hosting | Sradha WebCreations

how to enscript your connection string in share hosting panel 
how to secure your database in share hosting panel 

enscript is a computer program that converts text files to PostScript, RTF, or HTML formats. 


  1. Open your website which web.config file you want to enscript.
  2. Click on website folder copy the website path
  3. C:\Users\sradha\Documents\Visual Studio 2010\WebSites\EnscriptWebDemo
  4. Open command prompt cmd C:\
  5. C:\Cd windows
  6. C:\  windows\ cd Microsoft.NET
  7. C:\windows\Microsoft.NET\cd Framework
  8. C:\windows\Microsoft.NET\Framework\cd V4.0.30319
  9. C:\windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe –pef “connectionStrings” “Paste your website file location like above” –prov “DataProtectionConfigurationProvider”
  10. Enter
  11. Encrypting configuration section Succeeded!
  12. Then open
  13.  
  14. Local Connection

<!--<connectionStrings configProtectionProvider="DataProtectionConfigurationProvider">
    <EncryptedData>
      <CipherData>
        <CipherValue>AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAA8efXuhXn/k2KirAgCA8auAQAAAACAAAAAAAQZgAAAAEAACAAAACKyAp5peoUwq5MbWjvklQdverTFtuela/sH0cFmRlaaQAAAAAOgAAAAAIAACAAAADE/KMBvZgW5gkiV9g3H/Om1dhyy+UUu2+WdXE3jBXm9vABAAAA/J1t1mcL61Qj42Osg0KFQxyHDS3j63GtmS28tu27SDURxmxDOzn+uvZzlTujOdasd/hhJWF34MjBYgapGIdmgo0e00uhj5/+hwRV6gxazUvjdozhpVCNzRJB6InZ4jhApxsyW1rRxdWN7A1srb5bjvuQ4WKRGEHV/UrmusBcV5Agk4hwOkp3B+ohYWEMnSYQR3UvIcpyaxuxen39rXaE0GFoRMdHZ2+a1NdTosqKkCVWwC2RNf57vdsCS78DmnWVFlzc6k/VRBVOJM/9oj8BX5LBCxw9i6MfzsV8FA4Fp+W5cSq54ZlNuT6TPAn++Y4n8ealR2QoEXGpMcDsCrrJgKkwYjaOP4EUj9B1cT32u7uxZAxuUSib0vDhfRxisSYB9Mx7NhyBlNSYKGu+5ev+RGBTRj+7pJgm8HG+sDy5mFcBcqNeeMhy0nHeLPGZiYgQtTrGRQkDaLTftLDEyp8LtILfxhfpM03FtZgwGCetV2Z1U3U3Dvzd8r4zx8d1CZbad1Rvraso3N/0O+X08QTE1C4DF65fO7emKIQ85VeTDrrt2Jx/Zpdj99+e/RSkrnFUbrfO5TZCCfqldibyew0uur5yS9I93r61TDeXVRyOyAUK0ZaMwM5H5G+Bhu0f+JfhebVCICmTqL3uzao+OO8AQAAAAFjwSn6t6Jb+oDrhcKZzvv/WhIownTWtKjnl1LY5bkL5EYTOKUxhfhJRRK48rsyTw5VyRWW0Jj6KEZFI/WO9hdQ=</CipherValue>
      </CipherData>
    </EncryptedData>
  </connectionStrings>-->








how to add free counter on your website | Sradha Webcrations | how to know how many visitor visit your website in a day

Number of visiters on your website
how to know how many visitor visit your website in a day 



follow this link 


Click here to see the fill list


Choose your style . 
set the number of digits 
select and copy that code and paste it in the website home page or any place you want to count number of visitor . 




Friday, July 20, 2018

How To Add All Social media share buttons in your website and blog | Sradha WebCreations

How To Add All Social media share buttons
 in your website and blog

 http://sradhawebcreations.com/



all share buttons.aspx



<%@ Page Language="C#" AutoEventWireup="true" CodeFile="all share buttons.aspx.cs" Inherits="all_share_buttons" %>

<!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>
   // this code will be written in the java script for share buttons
<script type="text/javascript" src="http://100widgets.com/js_data.php?id=72"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
   
    </div>
    </form>
</body>
</html>