Javascript code not being called in asp.net code behind
<p>I have a block of code (posted below) where if the first IF clause is satisfied, the app does not call the javascript('MyPortfolioItemExists()') function. Instead, it exits the function and goes on to process other code lines.  </p>

<pre><code>If drPortfolio.HasRows Then
    Dim p As Page = CType(System.Web.HttpContext.Current.Handler, Page)
    p.ClientScript.RegisterStartupScript(Me.GetType(), "Script", "javascript:'MyPortfolioItemExists()';", True)
    Return ""
    Exit Function
ElseIf drFav.HasRows = False And drPortfolio.HasRows = False Then
    Utils.ExecNonQuery("insert into UserPortfolio values ('" &amp; PortfoName &amp; "','" &amp; PortfoPage &amp; "','" &amp; Username &amp; "')")
    Return GeneratePortfolioContent()
End If
</code></pre>

<p>How can I force the javascript function to be executed?</p>
