Showing posts with label Page_Load. Show all posts
Showing posts with label Page_Load. Show all posts

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 




Enquiry Form Open Page Load and Send Email Using in Web Service,HtmlPage Using Asp.Net C# JQuery

Enquiry Form Open Page Load and Send Email Using in Web Service,HtmlPage

Enquiry Form Open Page Load - Email Send To Users  Using Web Service & HtmlPage.html  in JQuery,JavaScript With GoogleApis in Asp.Net C#(Without Using WebForm).

                             Download Coding
                                                 Download

                                      DEMO



                       HTML CODING(HtmlPage.html)


<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Enquery Form Open Page Load and Send Email Using in Web Service,HtmlPage Using  Asp.Net C# JQuery</title>

    <script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>
<style type="text/css">

.popup{
width: 100%;
margin: 0 auto;
display: none;
position: fixed;
z-index: 101;
}
.bor{
min-width: 600px;
width: 600px;
min-height: 350px;
margin: 100px auto;
background: #808080;
position: relative;
z-index: 103;
padding: 10px;
border-radius: 5px;
}
.bor .clo{
float: right;
height: 35px;
left: 22px;
position: relative;
top: -25px;
width: 34px;
}
#drizz {
position: fixed;
width: 100%;
height: 100%;
background-color: #FF9933;
display: none;
}
</style>
<script type='text/javascript'>
    $(function () {
        var overlay = $('<div id="drizz"></div>');
        overlay.show();
        overlay.appendTo(document.body);
        $('.popup').show();
        $('.close').click(function () {
            $('.popup').hide();
            overlay.appendTo(document.body).remove();
            return false;
        });
        $('.clo').click(function () {
            $('.popup').hide();
            overlay.appendTo(document.body).remove();
            return false;
        });

    });
</script>

    <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/themes/base/jquery-ui.css"
        rel="stylesheet" type="text/css"/>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js"></script>
    <script>
        function SendMail() {
            $("#Button1").click(function () {
                $.ajax({
                    url: "WebService.asmx/MailSend",
                    data: "{ 'To': '" + $('input[id$=Text1]').val() +
                  "', 'Message': '" + $('input[id$=Text2]').val() + "' }",
                    dataType: "json",
                    type: "POST",
                    contentType: "application/json; charset=utf-8",
                    success: function (data) {
                        if (data.d == 1) {
                            alert('Success');

                            $('.popup').hide();
                            overlay.appendTo(document.body).remove();
                            return false;
                        }
                      
                    }
                });
            });
        }
</script>  
 
</head>
<body>

    <div class='popup'>
<div class='bor'>
<img src='drop.gif' alt='quit' runat="server" class='clo'  id='x' />

     <table><tr><td>To</td><td>
    <input id="Text1" type="text" /></td></tr>
        <tr><td>Message</td><td>
    <input id="Text2" type="text" /></td></tr>
        <tr><td colspan="2">    
    <input id="Button1"  type="button"  onclick ="SendMail();" value="SEND MAIL"  /></td></tr>

    </table>
    <a href="" class='close'>Hide</a>
</div>
        </div> 
  
</body>

</html>

                           Web Service.asmx


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Net.Mail;

/// <summary>
/// Summary description for WebService
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
[System.Web.Script.Services.ScriptService]
public class WebService : System.Web.Services.WebService {  
    [WebMethod]
    public  int MailSend(string To, string Message)
    {      
        MailMessage Msg = new MailMessage();
        Msg.From = new MailAddress("SenderMail@gmail.com"); // Sender e-mail address.
        Msg.To.Add(To);// Recipient e-mail address.
        Msg.Subject = "Send Mail Using WebServices";
        Msg.Body = Message;
        Msg.IsBodyHtml = true;     
        SmtpClient smtp = new SmtpClient();
        smtp.Host = "smtp.gmail.com";
        smtp.Port = 587;
        smtp.Credentials = new System.Net.NetworkCredential("YourMailId@gmail.com""Password");
        smtp.EnableSsl = true;
        smtp.Send(Msg);
        return 1;      
    }
   
}



First - Add New HtmlPage.html Form  






Next - Add Input Button.Button From ToolBox






Next - Add - Web Service.asmx From Solution Explorer






Next Add - Enquiry Form Open & Close JavaScript Add 





Next - Add JQuery,GoogleApi  &  JQuery Function From WebService.asmx






Next - Add - NameSpace(using System.Net.Mail)Email Send Coding  in WebService.asmx  Input Call From HtmlPage.html








Show Popup Window on Page Load Using JQuery in Asp.Net C#

Show Popup  Window on Page Load


Open Website Show Popup Window  on Page _Load Function Without Button Click Event Using in JQuery Asp.Net C#.

                                              DEMO




HTML CODING

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>
<style type="text/css">

.popup{
width: 100%;
margin: 0 auto;
display: none;
position: fixed;
z-index: 101;
}
.bor{
min-width: 600px;
width: 600px;
min-height: 350px;
margin: 100px auto;
background: #808080;
position: relative;
z-index: 103;
padding: 10px;
border-radius: 5px;
}
.bor .clo{
float: right;
height: 35px;
left: 22px;
position: relative;
top: -25px;
width: 34px;
}
#drizz {
position: fixed;
width: 100%;
height: 100%;
background-color: #FF9933;
display: none;
}
</style>
<script type='text/javascript'>
    $(function () {
        var overlay = $('<div id="drizz"></div>');
        overlay.show();
        overlay.appendTo(document.body);
        $('.popup').show();
        $('.close').click(function () {
            $('.popup').hide();
            overlay.appendTo(document.body).remove();
            return false;
        });
        $('.clo').click(function () {
            $('.popup').hide();
            overlay.appendTo(document.body).remove();
            return false;
        });
       
    });
</script>
</head>
<body>
<div class='popup'>
<div class='bor'>
<img src='~/image/drop.gif' alt='quit' runat="server" class='clo' id='x' />
<h2 align="centre" >
dotnetdrizzles.blogsopt.in Asp.Net C# Tutorials<br />
    C#<br />
    DataBase connection<br />
    GridView Control<br />
    Calender Control<br />
    Image Control<br />
    Data Controls<br />
    JQuery <br />
    JavaScripts<br />
    SQL Server
    <br/>
<br/>
<a href="" class='close'>Hide</a>
</h2>
</div>
</div>
</body>
</html>


First - Add New Web Form - Add Html Coding For  PopUp  & JQuery  For Close





Next - Run[F5]  Show Popup PageLoad