some code::
list.aspx:: (this is the page that timeouts early)
<%@ Page Language="JScript" debug='true' Strict="true" Explicit="true"
Trace="false" enableSessionState="true" EnableViewState="true" Buffer="true"
%>
<script runat='server'>
var user : String;
function Page_Load(src : Object, e : EventArgs) {
user = String(Session("loggedIn"));
if (user == null || user == "null" || user == "" || user == "undefined") {
Response.Redirect("mailing_login.aspx?authorised=n o");
Response.End();
}
//some data display
}
</script>
<form runat='server'>
<%=mailingListName%> subscribers:<br />
<br />
<span id="subscribersMsg" runat='server' /><br />
<asp:DataList id='subscribers' runat='server'>
<ItemTemplate>
<a href='deleteSubscriber.aspx?subscriberId=<%#
Int32(Container.DataItem("SubscriberID"))
%>&mailingListId=<%=mailingListID%>' onClick='return(confirm("Are you
sure you want to delete subscriber <%#
String(Container.DataItem("SubscriberEmail")) %> (no undo
possible)?"));'>delete</a>
<%# String(Container.DataItem("SubscriberEmail")) %><br />
</ItemTemplate>
</asp:DataList>
</form>
<input type='button' value='add subscriber' runat='server'>
----------------------------------------------------------------------------
---------------------------------------------------------
mailing_login.aspx:: (login page)
<%@ Page Language="JScript" debug='false' Strict="true" Explicit="true"
Trace="false" EnableSessionState="true" EnableViewState="false"
Buffer="true" %>
<HTML>
<head>
<script language='JScript' runat='server'>
function Page_Load() {
if (Request.QueryString("authorised") != null) {
Msg.Text = "You must login to access this site.<br />"
}
}
function LoginBtn_Click(sender : Object, e : EventArgs) {
//get user from database
if (userFound) {
Session("loggedIn") = UserName.Text;
Response.Redirect("default.aspx");
} else {
Msg.Text += "Invalid Credentials: Please try again.<br />";
}
}
</script>
<form runat="server">
<h2>Mailing List :: Login Page</h2>
<hr size="1" />
<table>
<tr>
<td>Username:</td>
<td><asp:TextBox id="UserName" runat="server" /></td>
<td><asp:RequiredFieldValidator id="userRequired" runat="server"
ControlToValidate="UserName" Display="Static" ErrorMessage="Missing!"
/></td>
</tr>
<tr>
<td>Password:</td>
<td><asp:TextBox id="UserPass" runat="server" TextMode="Password"
/></td>
<td><asp:RequiredFieldValidator id="passRequired" runat="server"
ControlToValidate="UserPass" Display="Static" ErrorMessage="Missing!"
/></td>
</tr>
</table>
<asp:button id="LoginBtn" onclick="LoginBtn_Click" runat="server"
text="Login" />
<p><asp:Label id="Msg" runat="server" ForeColor="red" /></p>
</form>
</head>
<body>
</body>
</HTML>
--
Jure Spik
".NET Follower" <am*************@SoftHome.net> wrote in message
news:eC****************@tk2msftngp13.phx.gbl...
hi,
that is not possible ..
and no need to specify timeout to be 300.
just 10 or 20 will do...
try to find the exact reason why sessio is not mantained..
plz send some snippet of code...
--
Thanks and Regards,
Amit Agarwal
Software Programmer(.NET)
"Carpe Diem" <we*******@carpediem.si> wrote in message
news:eu****************@TK2MSFTNGP11.phx.gbl... Hello I have an aspx page that loses Session("user") value after a few
minutes even after I set
<sessionState mode="InProc" cookieless="false" timeout="300"> in
web.config and wrote
function Session_Start() {
Session.Timeout = 3000;
}
in global.asax
Can you give me pointers on how to achieve the required functionality?
--
Jure Spik,
Carpe Diem d.o.o., Kranj
http://carpediem.si/
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.593 / Virus Database: 376 - Release Date: 2/20/2004