Friday, March 18, 2011

How to Call Client Side Script From Server Side

Here Name is Nothing You Can Give Any Name

YesNo() is the Script Name

ScriptManager.RegisterStartupScript(this, this.GetType(), "Name", "YesNo();", true);


Example

function YesNo() {
            var answer = confirm("Yes?")
            if (answer) {
                StartPrintScreen();
            }
            else {
                return false;
            }
        }


If Condition is Satisfy This Belos function will Call and Open Page In New Window


function StartPrintScreen() {
            var _Id= document.getElementById('HdnId').value;
            window.open("ashok.aspx?Id=" + _Id, '', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=800,top=0,left=100');
        }

No comments:

Post a Comment