Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

User control issue

Status
Not open for further replies.

Mdiaz

Programmer
Jul 8, 2002
32
0
0
US
I have created an *acsx file for my navigation. In it there is some logic for the log in button. In the old asp version I checked a session variable to see if user was logged in and if so to replace the log-in button with a log-out button. I am having problem trying to do the same in the asp.net version. Below is the navigation.acsx page.

You will notice that there are no
Code:
<Form runat=&quot;server&quot;>
tags around the imagebutton tag. When I do add it, it crashes and tells me that I cannot have two
Code:
<form>
tags. naturally, I am importing the navigation.acsx page to the main page and it already has a
Code:
<form.
tag within it.

So, How do I get this code to work on the navigation page?

Any help would be appriciated!!

########### Navigation.acsx #############
Code:
<%@ Control %>
<script runat=&quot;server&quot;>

    Sub Page_Load
        If Session( &quot;logged&quot; ) = &quot;&quot; Then
            imgLogin.ImageURL = &quot;/EStation/Graphics/logoff.gif&quot;
        Else
            imgLogin.ImageURL = &quot;/EStation/Graphics/login.gif&quot;
        End If
    
    End Sub
    
    Sub Log_click(Sender As Object, E As ImageClickEventArgs )
       If Session( &quot;logged&quot; ) = &quot;&quot; Then
        Response.redirect ( &quot;/EStation/pages/login.asp&quot; )
       Else
        Response.redirect ( &quot;/EStation/pages/logoff.asp&quot; )
       End If
    End Sub

</script>
<p>
    <a href=&quot;/index.asp&quot;><img height=&quot;30&quot; alt=&quot;Back to home page&quot; src=&quot;/EStation/Graphics/Home.gif&quot; width=&quot;125&quot; border=&quot;0&quot; /></a> 
</p>
<p>

<asp:Imagebutton id=&quot;imgLogin&quot; runat=&quot;server&quot;
           AlternateText=&quot;Log On&quot;
           ImageUrl=&quot;/EStation/Graphics/Home.gif&quot;
           onclick= &quot;Log_click&quot;/>
</P>
<p>
    <a href=&quot;/EStation/Pages/Apparatus.asp&quot;><img height=&quot;30&quot; alt=&quot;Apparatus status, repairs, maintanance&quot; src=&quot;/EStation/Graphics/Apparatus.gif&quot; width=&quot;125&quot; border=&quot;0&quot; /></a> 
</p>
<p>
    <a href=&quot;/EStation/EMS/ems.asp&quot;><img height=&quot;30&quot; alt=&quot;&quot; src=&quot;/EStation/Graphics/EMS.gif&quot; width=&quot;125&quot; border=&quot;0&quot; /></a> 
</p>
<p>
    <a href=&quot;/EStation/Supplies/supplies.asp&quot;><img height=&quot;30&quot; alt=&quot;&quot; src=&quot;/EStation/Graphics/Supplies.gif&quot; width=&quot;125&quot; border=&quot;0&quot; /></a> 
</p>

Mike Diaz...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top