Friday, 4 September 2015

Enlarge Image From Datalist With Database Using Jquery Asp.Net C#

Enlarge Image From Datalist  With Database Using Jquery 

Image Enlarge From DataList Using Jquery Plugin in Asp.Net C#.

                               DEMO


                                         Download Coding

                           HTML Coding

<html xmlns="http://www.w3.org/1999/xhtml"> 
<head id="Head1" runat="server"> 
    <title>Enlarge an Image from Datalist Using Jquery in Asp.Net C#</title> 

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> 
    <style type="text/css"> 
        .imgt { 
            height: 100px; 
            width: 100px; 
        } 
    </style> 
    <script type="text/javascript">
        $(function () {
            $("img.imgt").click(function (e) {
                var enlarge = '<img src='<%#Eval("imgpath") %> + $(this).attr("alt") + '></img>';
                $('#ImgEnlarge')
                   .html($(enlarge)
                   .animate({ height: '360', width: '870' }, 1500));
            })
        })
    </script> 
</head> 
<body>
    <form id="form1" runat="server"> 
        <table cellpadding="1" cellspacing="2" width="880px" align="center" class="BlueBorder" 
            style="background: White;"> 
            <tr> 
                <td style="height: 50px;"> 
                </td> 
            </tr> 
            <tr> 
                <td> 
                    <asp:DataList ID="dListImages" runat="server" RepeatColumns="10"> 
                        <ItemTemplate> 
                            <table border="1"> 
                                <tr> 
                                    <td>
                                        <img alt='<%#Eval("imgpath") %>' src='<%#Eval("imgpath") %>' class="imgt" /></td> 
                                </tr> 
                            </table> 
                        </ItemTemplate> 
                    </asp:DataList> 
                </td> 
            </tr> 
            <tr> 
                <td style="text-align: center; vertical-align: central;">  
                    <div id="ImgEnlarge"></div> 
                </td> 
            </tr> 
        </table> 
            </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.IO;
using System.Data;
using System.Data.SqlClient;


public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["dbcon"].ToString());
        con.Open();
        SqlCommand cmd = new SqlCommand("select imgpath from reg", con);
        SqlDataAdapter adp = new SqlDataAdapter(cmd);
        DataTable dt = new DataTable();
        adp.Fill(dt);
        dListImages.DataSource = dt;
        dListImages.DataBind();
    }


}







 







Get Count Of A Substring In A String Using Asp.Net C#

No comments    
categories: , , , ,
Get Count Of A Substring In A String Using Asp.Net C#

Give Input String To Textbox Get Count Without Using Loop Condition in Asp.Net C#.

                         DEMO


                               Download

                   HTML Coding

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Get Count Of A Substring In A String Using Asp.Net C#</title>
</head>
<body>
    <form id="form1" runat="server">
    <div align="center">
   
        Input String
        <asp:TextBox ID="txtInput" runat="server"></asp:TextBox>
        Count String
        <asp:TextBox ID="txtCount" runat="server"></asp:TextBox>
       
        <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Count" />
        <asp:Label ID="lblCount" runat="server" Font-Size="Large" ForeColor="#FF0066"></asp:Label>
        <br />
   
    </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.Text.RegularExpressions;

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

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        int c = Regex.Matches(txtInput.Text.ToUpper(),txtCount.Text.ToUpper()).Count;

        lblCount.Text = c.ToString();
    }

}













Thursday, 3 September 2015

Select Multiple Dates in jQuery Date Picker Using Asp.Net

Select Multiple Dates in Textbox jQuery Date Picker Using Asp.Net

Multiple Date Select in Textbox Using Jquery Data Picker  Asp.Net

                               DEMO


                                       Download Coding

                           HTML Coding

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Select Multiple Dates in jQuery Date Picker Using Asp.Net</title>

    <link  rel="stylesheet" type="text/css" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css"> 
   <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script> 
   <script type="text/javascript" src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
           <script type="text/javascript" src="http://multidatespickr.sourceforge.net/jquery-ui.multidatespicker.js"></script>

    <script type="text/javascript" lang="javascript">
        $(function () {
            $("#<%=textboxDate.ClientID %>").multiDatesPicker
                ({
                dateFormat: 'dd/mm/yy',
            });
        });
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div align="center"> 
        <br />
        <br />
        <br />
        <table><tr><td>
            <asp:Label ID="Label1" runat="server" Text="Select Date"></asp:Label>
            </td><td>
                <asp:TextBox ID="textboxDate" runat="server" Width="213px"></asp:TextBox>
            </td></tr></table>  
    </div>
    </form>
</body>

</html>