asp.net javascript
<p>I am writing a javascript in asp.net server side (with in a button click event), this script is called if the user id and password matches and it supposed to close current window and open welcome page, but it is not happening. Below is my code, can anyone help me figure out what is the problem?</p>

<pre><code>protected void okbtn_Click(object sender, EventArgs e)
    {
        account.txtuser = txtuid.Text;
        account.txtpwd = txtupwd.Text;
        account.login();
        if (account.data == true)
        {
            string script = "&lt;script language='javascript' type='text/javascript'&gt;function f11(){window.close();var strLocation ;var strProfileID ;if (top.opener == null){strLocation = 'YourAccount.aspx';window.location = strLocation;}else{strLocation = 'http://' + top.opener.location.hostname+':'+ window.location.port + '/SendMail/' + 'YourAccount.aspx';top.opener.location = strLocation;top.opener.focus();}}&lt;/script&gt;";
            ClientScript.RegisterStartupScript(GetType(),"abc", script, true);

        }
        else
        {
            Label1.Text = "Invalid user name or password";
        }
    }
</code></pre>
