Alert Message with Audio Play (Text Speech) on PageLoading Using Javascript in Asp.Net

Alert Message with Audio Play (Text Speech) on PageLoading


Alert Message Show with Audio Play from text speech on page loading Using Javascript in Asp.Net.

                                   DEMO



                                Download
                      
                            HTML Coding


<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Alert Message with Audio Play (Text Speech) on PageLoading Using Javascript in Asp.Net </title>
    <script type="text/javascript">

        // Alert message show with audio paly Using Javascript
        function alert_audio()
        {
            var text = new SpeechSynthesisUtterance('Welcome to dotnetdrizzles.blogspot.in');
            window.speechSynthesis.speak(text);

            alert('www.dotnetdrizzles.blogspot.in \n\r Play audio in background');          
        }
        window.onload = alert_audio;

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

</html>

                  
Add New Form - text speech & alert message at a time 




Open Popup Without User Action or Webform On Click Using JavaScript in Asp.Net

Open Popup Without User Action or Webform ClicK

If Click on Webform form Without user action popup open new tab or same page using in Asp.Net C#.

                                 DEMO



                             Download

                        HTML Coding


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

    <script type="text/javascript">


        // Open popup in Same Page without user action

        document.addEventListener('click',function()
        {
            window.open('http://www.dotnetdrizzles.blogspot.in','','width=250 height=250');

        })
     
        // Open  New Tab without user action

        document.addEventListener('click',function()
        {
            window.open('http://www.dotnetdrizzles.blogspot.in', 'width=250 height=250');
        })

    </script>

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

</html>


Add - New Form - Add Javascript AddEventListener Click Function





Asynchronous operations are not allowed in this context. Page starting an asynchronous operation has to have the Async attribute set to true and an asynchronous operation can only be started on a page prior to PreRenderComplete event.

Asynchronous operations are not allowed in this context. Page starting an asynchronous operation has to have the Async attribute set to true and an asynchronous operation can only be started on a page prior to PreRenderComplete event.




Add - Async="true"




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>


Add New - Webform - add text to SpeechSynthesis - Pageloading Paly Audio



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
    }
}

                          
First Add New webform - Add Textbox text





Next - Add Reference - System.Speech  - Ok




Next - Code Behind file - add Namespace -  textbox Call to speechsynthesize




Next - Design File - add Async="true"



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>


Add New Webform - Add Jquery Source  & Weekends Show Disable



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>");

    }

}


Create New WebForm - Add ScriptManager,Updatepanel From Toolbox





Next - Updatepanel - Property - Add Updatemode=Condotional  - Triggers- Postback= Button id





Next - Image Upload Coding to Database