No luck. Here is the exact code in use now...
<%If HttpContext.Current.Session("dept_id") Is Nothing Then%>
<a href="logon.aspx?ErrorCode=Session"><asp:Label runat="server"
ForeColor="Blue" Font-Bold=True Font-Size="14px" ID="Home"
Text="HOME"/></a>
<%else%>
<a
href="dept_cycles.aspx?dept_id="<%=HttpContext.Cur rent.Session("dept_id")%>"><asp:Label
runat="server" ForeColor="Blue" Font-Bold=True
Font-Size="14px" ID="Home2" Text="HOME"/></a>
<%end if%>
The link shows up as ...
dept_cycles?dept_id=
The code for the header of the page includes the code...
<%if session("FullName") <> "" then
response.write(session("FullName"))
else
response.write("Not Logged On")
end if%>
<br>
Dept:
<%if session("dept_name") <> "" then
response.write(session("dept_name"))
end if%>
The header works fine. I cannot understand why the footer cannot access the
values of session variables. Very Strange.
Basically, if the session has expired, then I would like for the link to
take them to the logon page
"Peter Bromberg [C# MVP]" <> wrote in message
news:A5045E14-5F64-4615-BF46-...
> Lee,
> Try using:
>
> If Not HttpContext.Current.Session("dept_id") Is Nothing Then
> If HttpContext.Current.Session("dept_id") =0 then
>
> ' your cool code here
>
> End if
> End if
>
>
> if it still comes up empty, then most likely the Session item is null.
> Peter
>
> --
> Co-founder, Eggheadcafe.com developer portal:
> http://www.eggheadcafe.com
> UnBlog:
> http://petesbloggerama.blogspot.com
>
>
>
>
> "Lee Moore" wrote:
>
>> To follow up. Here is the example from my footer. Like I said, the
>> usercontrol works fine, but the session variables are empty.
>>
>>
>> <%@ Control Language="VB" EnableViewState="False" %>
>> </td>
>> </tr>
>> </table>
>> <img src="images/index_01.jpg" width=100% height=6><br>
>> <table border="0" width="100%" id="table1" cellspacing="0"
>> cellpadding="0">
>> <tr>
>> <td align="center">
>> <%if Session("dept_id") = 0 then %>
>> <a href="logon.aspx?ErrorCode=Session"><asp:Label runat="server"
>> ForeColor="Blue" Font-Bold=True Font-Size="14px" ID="Home"
>> Text="HOME"/></a>
>> <%else%>
>> <a
>> href="dept_cycles.aspx?dept_id="<%=session("dept_i d")%>"><asp:Label
>> runat="server" ForeColor="Blue" Font-Bold=True Font-Size="14px"
>> ID="Home2"
>> Text="HOME"/></a>
>> <%end if%>
>>
>>
>> </td>
>> <td align="center"><asp:Label runat="server" ForeColor="Blue"
>> Font-Bold=True Font-Size="14px" ID="Plans" Text="PLANS"/></td>
>> <td align="center"><asp:Label runat="server" ForeColor="Blue"
>> Font-Bold=True Font-Size="14px" ID="Summ" Text="EXEC SUMMARY"/></td>
>> <td align="center"><asp:Label runat="server" ForeColor="Blue"
>> Font-Bold=True Font-Size="14px" ID="Fund" Text="FUNDING"/></td>
>> <td align="center"><asp:Label runat="server" ForeColor="Blue"
>> Font-Bold=True Font-Size="14px" ID="Goals" Text="GOALS"/></td>
>> </tr>
>> </table>
>> </td>
>> </tr>
>> </TABLE>
>>
>> "Lee Moore" <> wrote in message
>> news:...
>> >I have some user controls defined that represent a common header and
>> >footer
>> >for a particular site. the footer contains links with querystring
>> >parameters based on session variables. The problem is, I cannot access
>> >the
>> >session variables within my user control. The user controls work
>> >perfectly
>> >otherwise. Example code included.
>> >
>> >
>> >
>>
>>
>>