Results 1 to 2 of 2

Thread: How do i calling a javascript in an IF statsment.

  1. #1
    Member
    Join Date
    Feb 11
    Posts
    48

    How do i calling a javascript in an IF statsment.

    Hi

    I have this link

    Code:
    <a id="yesnocancelbuttons" runat="server">Message in modal view.</a>
    Thats open a popup box.

    My question is, how can i call that id in an If statsment !?
    if i have something like this

    Code:
    if session("activ") = "Y" Then
     Do nothing
    Elseif session("activ") = "N" Then
     CALL THE ID, Javascript and show the popup.
    End if

  2. #2
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 04
    Location
    The Granite City
    Posts
    21,738

    Re: How do i calling a javascript in an IF statsment.

    Hello,

    Ok, first question...

    How exactly is that anchor element calling some JavaScript? Have yo omitted some code?

    What I would suggest is that you do this work in the code behind, before it actually gets to the server.

    If the Session variable is set, make an anchor element visible on the page. If the session variable is not set, then make a little text element visible on the page, and hide the anchor tag. That way, you are displaying HTML content that actually makes sense. If the link it not clickable, then you used render a link.

    Gary

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •