|
I was given the task to take several websites and add login authentication to them. Currently, they are using Apache to login then it redirects to the site if their login was valid.
What I was going to do, or did, was create a login page and use their custom authenticator class (which they wanted me to use) to validate then if successful redirect to the home page...simple enough.
What I have a question on is if I am using this very basic (and probably old way) of doing this, can I add a session object "Authenticate" and set it to true if success, false if not. Then on the other pages during Page_Load check this session if authenticated and if not redirect to login page? Is this valid? Seems outdated and I know I can use the new Login Controls for .Net 3.5 but wasn't sure if I could or not.
They are not using Windows Authentication or anything, it's what is typed in txtbox and validated in sql. The authentication class does this.
Would appreciate any suggestions on how I could validate on each page if they were logged in or not.
Thanks
|
|
|
|
|
Hi
It is valid to use session for that.
Mohammad Khansari
|
|
|
|
|
How do i change the title of the webpartzone. It keeps the
id of the webpartzone as the title
|
|
|
|
|
NETLearning wrote: How do i change the title of the webpartzone. It keeps the
id of the webpartzone as the title
Why are you asking same question again and again ?
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
hi, i have page with content place holder and in that i have multiview and in that i have a html tabel and i am wondering if is it possible to make a row hide(visible=false), or that cant be done????
|
|
|
|
|
to hide a row .. in html Table,
You might use :
td.style.visibility = 'hidden';
and to show it again use :
td.style.visibility = 'visible';
You need to use Javascript to do this.
|
|
|
|
|
Give div tag give it an id make it run at = server and in the programming give id.visible =false.
<div id ="ssd" runat="server">
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:FileUpload ID="FileUpload1" runat="server" />
</div>
protected void Page_Load(object sender, EventArgs e)
{
ssd.Visible = false;
}
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
Hi
If you want other elements fill the row's room you must use
obj.style.display="none";
Mohammad Khansari
|
|
|
|
|
I Want to check client brwoser setting if client browser cookie option block/disable then I want to enable it....
Thanks to all
|
|
|
|
|
|
I am using IE6 and writng fallowing code code
<html><head>
<title>detect browser cookies</title>
<script language="javascript" type="text/javascript">
function detect()
{
if(navigator.cookieEnabled)
{
alert('Your browser has cookies enabled.');
}
else
{
alert('Your browser has cookies disabled.');
}
}
</script></head>
<body onload="detect();"></body>
</ht
but result is 'Your browser has cookies enabled'
whether it is block or not
|
|
|
|
|
You cannot change the browser settings to enable/disable cookie support. You can only check whether browser supports cookie or not [^]
|
|
|
|
|
I am using IE6 and writng fallowing code code
<html><head>
<title>detect browser cookies</title>
<script language="javascript" type="text/javascript">
function detect()
{
if(navigator.cookieEnabled)
{
alert('Your browser has cookies enabled.');
}
else
{
alert('Your browser has cookies disabled.');
}
}
</script></head>
<body onload="detect();"></body>
</ht
but result is 'Your browser has cookies enabled'
whether it is block or not
|
|
|
|
|
This is because IE6 supports Cookies...
|
|
|
|
|
Hi, I have a MVC application and I have to logout. To logout from the application I have created a link on te master page
[ <a id="A2" name="lnkLogout" href="http://localhost:1234/Home/LogOut" >Logout</a> ]
and created the LoutOut action in the controller page
public ActionResult LogOut()
{
Session.Clear();
Session.Abandon();
Redirect("http://AnotherApplicaton/Home/LogOut");
}
Now when I click on the LogOut link its redirect to the LogOut action and in the LogOut action its delete all the session, but when I click on the back button of the browser its get back to the previous page and sessions are still alive. Does anyone have the solution of this problem.
Pankaj
|
|
|
|
|
hi
<script type="text/javascript" language="javascript">
javascript: window.history.forward(1);
</script>
|
|
|
|
|
No need to think about the browser back button...
If there is no session, every request that is made from the client in the cached page will generate errors.
Also if possible place
history.go(1);
in the masterpage or every page. So that whenever the back button is clicked, it will automatically forward to the latest page.
|
|
|
|
|
Thanks for you replay. Back button is not my problem. The problem is sessions are not expiring. When I go back to previous page and refresh the browser, I get all the information from the database again, this should not happen. Because before every database request its checks whether session is exist or not. If session is not exists then no database call will be fired. But this is not happening after the logout.
Pankaj
|
|
|
|
|
I think it is better to check a Session value on every call to the server. Like :
try{
if(Convert.ToBoolean(Session["IsAuthenticated"]) != true)
Server.Transfer("loginpage.aspx");
}
catch{
Server.Transfer("loginpage.aspx");
}
During Login put this Session Value and In Logout clear out this value.
|
|
|
|
|
Hi
i am novice(know nothing) in Cristal report application.
Could any one suggest any helping tutorial link that cover full tutorial from beginning
on version .net 3.5
|
|
|
|
|
|
I want to make an event calendar, i want that when i click on any date in calendar then submit any types of eventand date color will change???
|
|
|
|
|
i think the Normal Calender control does that , you don't need to write code for this. Mybe you dont explain clearly what is your problem ?
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
I have already told you, you need to build a scheduler to show events and dates ..
|
|
|
|
|