Script not working when called from .cs file
<p>I am tryong to do the following in  a Row_Command event of a gridview. But the the pop up box never comes up, I have tried it in so many different ways.. but yet no luck. Please if someone can see the issue i would really appreciate a pointer.</p>

<pre><code>protected void Gridview_RowCommand(object sender, GridViewCommandEventArgs e)
{
    if(e.CommandName == "Merchant")
    {
        if (ItemsAvailable)
        {
            StringBuilder sb = new StringBuilder();
            MyClass class = new MyClass();
            TList&lt;LineItems&gt; otherItems = MyClass.GetItems(id);
            bool IsNotAvailable = false;

            foreach (LineItems item in otherItems)
            {
                Merchandise skuMerchandise = skuMerchandise.GetMerchandise(otherItems.mid);
                if (skuMerchandise  != null)
                {
                    if (skuMerchandise.AvailableItems &lt;= 0)
                    {
                        sb.Append(OtherItems.Name);
                        sb.Append(Environment.NewLine);
                        IsNotAvailable = true;
                    }
                }
            }

            if (IsNotAvailable)
            {
                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "key", 
                    "function Redirect() {location.href = 'homePage.aspx';} 
                    if(confirm('The items : "+sb.ToString()+" will arrive in 1 month. 
                    Do you wish to continue?') == true){Redirect();};", true);
            }
        }
    }
</code></pre>

<p>Everytime i click the button, it just passes like nothing.. never prompts eveb though IsNotAvailable is true when I add a breakpoint.</p>
