This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Dreamweaver > August 2004 > Session Variables (Not Working)





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Session Variables (Not Working)
sully7

2004-08-02, 11:14 pm

Hi All,

This one has me stumped pretty bad. If anyone has any idea why my session
variables are not working, I would be forever in your debt.
Is it possible that I have something configured incorrectly with my server??

Anyway, here is my code for the 2 pages: (Set_Session.aspx and
Page_Manager.aspx):
Here is the Set_Session.aspx Page:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<script language="VB" runat="server">
Sub SetSessionVariable_Click(ByVal s As Object, ByVal e As EventArgs)
Session("sessDepartment") = tfDepartment.Text
Session("sessEditPages") = tfEditPages.Text
Response.Redirect("Page_Manager.aspx")
End Sub
</script>
<html>

<p align="center" class="HEADERTEXT">Authorization Test </p>
<form name="form1" method="post" action="" runat = "server">
<table width="300" border="1" cellspacing="1" cellpadding="1">
<tr>
<td class="BodyText">sessDepartment:</td>
<td><asp:TextBox ID="tfDepartment" runat="server" /></td>
</tr>
<tr>
<td class="BodyText">sessEditPages:</td>
<td><asp:TextBox ID="tfEditPages" runat="server" /></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><asp:Button ID="btSubmit" Text="Set Variables"
runat="server" onClick="SetSessionVariable_Click"/></td>
</tr>
</table>
</form>
<p align="center" class="HEADERTEXT">&nbsp;</p>



***************************************************************
And here is the Page_Manager.aspx Page:
***************************************************************

<%@ Page Language="VB" ContentType="text/html" %>
<%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls"
Assembly="DreamweaverCtrls,version=1.0.0.0,publicKeyToken=836f606ede05d46a,cultu
re=neutral" %>
<MM:DataSet
id="dsPages"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%#
System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_con
nLeanSigmaASP") %>'
DatabaseType='<%#
System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETY
PE_connLeanSigmaASP") %>'
CommandText='<%# "SELECT Department, PageID, PageTitle FROM TB_PageMgmt
WHERE Department = ?" %>'
Debug="true"
>

<Parameters>
<Parameter Name="@Department" Value='<%# IIf((Not Session("sessDepartment")
Is Nothing), Session("sessDepartment"), "") %>' Type="WChar"
/></Parameters></MM:DataSet>
<MM:PageBind runat="server" PostBackBind="true" />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>

<MM:If runat="server" Expression='<%# (session("sessEditPages") =
"True") %>'>
<ContentsTemplate>
<p align="center" class="HEADERTEXT">We're sorry. You are not
authorized to edit Internet Pages. </p>
</ContentsTemplate>
</MM:If>
<MM:If runat="server" Expression='<%# (session("sessEditPages") <>
"True") %>'>
<ContentsTemplate>
<p align="center" class="HEADERTEXT">PAGE MANAGER </p>
</ContentsTemplate>
</MM:If>
<p align="center" class="HEADERTEXT"><a href="Add_Page.aspx">Click
here</a> to add a new page. </p>
<p align="center" class="HEADERTEXT">
<form runat="server">
<asp:DataGrid AllowPaging="false"
AllowSorting="False"
AutoGenerateColumns="false"
CellPadding="3"
CellSpacing="0"
DataSource="<%# dsPages.DefaultView %>" id="dgPages"
runat="server"
ShowFooter="false"
ShowHeader="true"
>

<HeaderStyle HorizontalAlign="center" BackColor="#E8EBFD"
ForeColor="#3D3DB6" Font-Name="Verdana, Arial, Helvetica, sans-serif"
Font-Bold="true" Font-Size="smaller" />
<ItemStyle BackColor="#F2F2F2" Font-Name="Verdana, Arial,
Helvetica, sans-serif" Font-Size="smaller" />
<AlternatingItemStyle BackColor="#E5E5E5" Font-Name="Verdana,
Arial, Helvetica, sans-serif" Font-Size="smaller" />
<FooterStyle HorizontalAlign="center" BackColor="#E8EBFD"
ForeColor="#3D3DB6" Font-Name="Verdana, Arial, Helvetica, sans-serif"
Font-Bold="true" Font-Size="smaller" />
<PagerStyle BackColor="white" Font-Name="Verdana, Arial,
Helvetica, sans-serif" Font-Size="smaller" />
<Columns>
<asp:BoundColumn DataField="PageID"
HeaderText="PageID"
ReadOnly="true"
Visible="True"/>
<asp:BoundColumn DataField="Department"
HeaderText="Department"
ReadOnly="true"
Visible="True"/>
<asp:HyperLinkColumn
HeaderText="PageTitle"
Visible="True"
DataTextField="PageTitle"
DataNavigateUrlField="PageID"
DataNavigateUrlFormatString="Edit_Page.aspx?PageID={0}"/>
<asp:HyperLinkColumn
HeaderText="Delete"
Visible="True"
Text="Delete"
DataNavigateUrlField="PageID"
DataNavigateUrlFormatString="Delete_Page.aspx?PageID={0}"/>

</Columns>
</asp:DataGrid>
</form>
</p>


Any help wuold be fantastic. Thx.
Jim


sully7

2004-08-06, 4:15 am

Hi All,

Absolutely great news. I got it working. : -)
Your not going to believe what happened. I actually had everything (the code
that is) correct. I had a very good laugh when I figured out that my Firewall
was blocking any access of my session variables. I turned my Firewall off and
everything worked perfect.....absolutely perfect.

Well, I had a good laugh at myself. I should have known to turn off this
program way before I started this webpage design.
Lesson learned I guess......

I just want to say thanks to all for taking the time to help out a beginner.
Really appreciate it. I'm sure I'll get stuck on something else (hopefully not
the easy stuff). This discussion board is great. Its saving me from pulling
out my hair.

Thanks Again,
Jim




sully7

2004-08-06, 4:15 am

Hi All,

Absolutely great news. I got it working. : -)
Your not going to believe what happened. I actually had everything (the code
that is) correct. I had a very good laugh when I figured out that my Firewall
was blocking any access of my session variables. I turned my Firewall off and
everything worked perfect.....absolutely perfect.

Well, I had a good laugh at myself. I should have known to turn off this
program way before I started this webpage design.
Lesson learned I guess......

I just want to say thanks to all for taking the time to help out a beginner.
Really appreciate it. I'm sure I'll get stuck on something else (hopefully not
the easy stuff). This discussion board is great. Its saving me from pulling
out my hair.

Thanks Again,
Jim




sully7

2004-08-06, 4:15 am

Hi All,

Absolutely great news. I got it working. : -)
Your not going to believe what happened. I actually had everything (the code
that is) correct. I had a very good laugh when I figured out that my Firewall
was blocking any access of my session variables. I turned my Firewall off and
everything worked perfect.....absolutely perfect.

Well, I had a good laugh at myself. I should have known to turn off this
program way before I started this webpage design.
Lesson learned I guess......

I just want to say thanks to all for taking the time to help out a beginner.
Really appreciate it. I'm sure I'll get stuck on something else (hopefully not
the easy stuff). This discussion board is great. Its saving me from pulling
out my hair.

Thanks Again,
Jim




Les Matthews

2004-08-06, 12:15 pm

Jim,

I wouldn't recommend turning off your firewall. You should be able to
specify http://localhost/ as a trusted domain in your firewall config,
instead of turning it off.

"sully7" <webforumsuser@macromedia.com> wrote in message
news:cev4el$d7n$1@forums.macromedia.com...
> Hi All,
>
> Absolutely great news. I got it working. : -)
> Your not going to believe what happened. I actually had everything (the

code
> that is) correct. I had a very good laugh when I figured out that my

Firewall
> was blocking any access of my session variables. I turned my Firewall off

and
> everything worked perfect.....absolutely perfect.
>
> Well, I had a good laugh at myself. I should have known to turn off this
> program way before I started this webpage design.
> Lesson learned I guess......
>
> I just want to say thanks to all for taking the time to help out a

beginner.
> Really appreciate it. I'm sure I'll get stuck on something else

(hopefully not
> the easy stuff). This discussion board is great. Its saving me from

pulling
> out my hair.
>
> Thanks Again,
> Jim
>
>
>
>



Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews