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.
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 ('" & PortfoName & "','" & PortfoPage & "','" & Username & "')")
Return GeneratePortfolioContent()
End If
How can I force the javascript function to be executed?