Well As per your quoted comment. You want the reverse. Mean. You want to check the session. and if the session is not null than You want to call the ClientSide function(JavasSCript). RYT?
IF yes!. Dn do have a look at the posted code under Quoted Text.
Quote:
<asp:linkbutton id="lnkCRisMacSystem" cssclass="link" runat="server" xmlns:asp="#unknown">
OnClientClick="CallCRisMacSystem()" Font-Bold="True"
onclick="lnkCRisMacSystem_Click" > CRisMac System
if (Session["UserId"] == null)
{
Session.Abandon();
Server.Transfer("login.aspx");
}
Here is code but first execute java script function and then it check. and i want reverse
if (Session["UserId"] == null)
{
Session.Abandon();
Server.Transfer("login.aspx");
}
else
{
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "ClientFunc", "CallCRisMacSystem();", true);
}
ScriptManager.RegisterStartupScript
will be used to call the client side function in the ELSE block, incase the session is not null.
Hope it will help you. :)