Posts

Showing posts from January, 2012

Konami Code

Here is the source code to put in your website to enable konami code sequence
On your keyboard press (in this order): Up, Up, Down, Down, Left, Right, Left, Right, B, A … then wait a sec.


            <html>
<head>
<!-- Konami Code -->
<script type="text/javascript">
function onKonamiCode(fn) {
    var codes = (function(){
            var c = [38,38,40,40,37,39,37,39,66,65];
            onKonamiCode.requireEnterKey && c.push(13);
            return c;
        })(),
        expecting = function(){
            expecting.codes = expecting.codes || Array.apply({}, codes);
            expecting.reset = function() { expecting.codes = null; };
            return expecting.codes;
        },
        handler = function(e) {
            if (expecting()[0] == (e||window.event).keyCode) {
                expecting().shift();
                if (!expecting().length) {
                    expecting.reset();
                    fn();
                }
            } else { expecting…

VB.Net : Send Email with attachment

VB.Net : Send Email with attachment


Private Function SendEmail(ByVal mailfrom As String, ByVal mailto As String, ByVal cc As String, ByVal bcc As String, ByVal subject As String, ByVal message As String, ByVal attach1 As String, ByVal attach2 As String, ByVal userid As String, ByVal pwd As String) As String
        Try
            'create the mail message
            Dim mail As New MailMessage()


            'set the addresses
            mail.From = New MailAddress(mailfrom)
            mail.To.Add(mailto)
            ' mail.CC.Add(cc)
            'mail.Bcc.Add(bcc)


            'set the content
            mail.Subject = subject
            mail.Body = message


            'add an attachment from the filesystem
            mail.Attachments.Add(New Attachment(attach1))


            'to add additional attachments, simply call .Add(...) again
            '  mail.Attachments.Add(New Attachment(attach2))
            ' mail.Attachments.Add(New Attachment("c:\temp\exam…

ASP.Net control contains code blocks (i.e. <% ... %>) Error

ASP.Net control contains code blocks (i.e. <% ... %>) Error

My page was having few javascript in head tag...
when creating a combobox with sqldatasource in modalpopup extender i got above error at runtime.

Fix: Move all javascript code from head tag to inside body tag just before < / body>

Google+ Followers