Tuesday, 1 December 2015

Text Values Speak Using Javascript in Asp.Net

Text Values Speak Using Javascriptext 

Textbox text value Speak Automatically on Page Loading in Asp.Net Using Javascript.

                         HTML Coding

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Text Values Speak Using Javascript in Asp.Net</title>
    <script type="text/javascript">

        // Text Values Speak Using Javascript

        var text = new SpeechSynthesisUtterance('Welcome to dotnetdrizzles.blogspot.in');
        window.speechSynthesis.speak(text);


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

</html>





Textbox Text to Speech Using in Asp.Net C#

Textbox Text to Speech

Textbox control Text Value speech Async using  in Asp.net C#.

                          Download
                         
                         Video Link

                      HTML Coding

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
       
        <asp:TextBox ID="TextBox1" Text="Welcome To Dotnetdrizzles.blogspot.in" runat="server" Width="242px"></asp:TextBox>


    </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.Speech.Synthesis;

public partial class TextSpeak : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        SpeechSynthesizer spe = new SpeechSynthesizer();
        spe.SpeakAsync(TextBox1.Text);
        // Next Run Textbox text will speak
    }
}

                          














Sunday, 29 November 2015

Disable WeekEnds Using JQuery DateTimePicker Asp.Net

Disable WeekEnds Using JQuery DateTimePicker  

JQuery DatetimePicker Show WeekEnds Disable Before Showing Using Asp.Net .

                         DEMO


                    Download

                  HTML Coding

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Disable WeekEnds Using JQuery DateTimePicker Asp.Net</title>

    <link rel="stylesheet" href="http://code.jquery.com/ui/1.11.4/themes/ui-lightness/jquery-ui.css">
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
      
   
    <script type="text/javascript" lang="javascript">
        $(function () {
            $("#<%=textboxDate.ClientID %>").datepicker({
                dateFormat: "dd/mm/yy",
                changeMonth:true,
                beforeShowDay: function (DATE) {
                    var Week = DATE.getDay();
                    if (Week == 0 || Week == 6)
                    {
                        return [false];
                    }
                    else
                    {
                        return [true];
                    }
                }
           
            });
        });
    </script>

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

</html>






Monday, 16 November 2015

Ajax Updatepanel Image Upload with Triggers in Asp.Net C#

Ajax Updatepanel Image Upload with Triggers 


Ajax Update Panel Mainly Used to Avoid Whole Page Refresh With Trigger Function in Image Upload Controls 

UpdateMode="Conditional"

Two Child Tags   ContentTemplate and Triggers.

                               DEMO


                          Download 

                     HTML Coding 

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

        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
           
               <table><tr><td></td><td></td></tr>
           <tr><td>Image</td><td><asp:FileUpload ID="FileUpload1" runat="server" /></td></tr>
           <tr><td></td><td>
               <asp:Button ID="btn_Upload" runat="server" OnClick="btn_Upload_Click" Text="Upload" />
               </td></tr>
       </table>
               
    </ContentTemplate>
            <Triggers>
                <asp:PostBackTrigger ControlID="btn_Upload" />
            </Triggers>
        </asp:UpdatePanel>
    </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.SqlClient;
using System.Data;
using System.IO;

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

    }
    protected void btn_Upload_Click(object sender, EventArgs e)
    {
        SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["dbcon"].ToString());
        con.Open();
        string imagename=FileUpload1.FileName;
        FileUpload1.SaveAs (Server.MapPath ("file/"+imagename));
        SqlCommand cmd = new SqlCommand("insert into register(imgname,imgpath)values('"+imagename+"','"+"file/"+imagename+"')",con);
        cmd.ExecuteNonQuery();
        Response.Write("<script>alert('Image Uploaded')</script>");

    }

}