|
Hi All...
I have a login page(page1) that checks the user name and his password for a user, when the authorized user goes into the next page(page2)-I initialize an (ID session) and then when he loggs off I empty the session...
but, by the back button he could return back again to the 2nd page (and this is the problem )...
Could you help me..
Thanks alot...
Nour
|
|
|
|
|
All your pages should check if the user is logged in, and if not, deny access.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
I did that...
But what I need is not to allow the user to go back when back button is pressed...
Thanks
|
|
|
|
|
Well, to do that, you simply need to not serve the page if the security check fails. If they are not logged in, your base page should redirect to the login page.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
I do that
but the problem is:
when an autherized user loggen in, and the logged out, he can press the back button and go again to the pages, although the sessions are empty...
regards
|
|
|
|
|
Well, then you don't 'do that' at all. If the session is empty, then the only way they can see the page is from the cache. And there's nothing you can do about that.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
|
you can design a base class to check the session is null or not, then all the pages you use to inherit the base class
|
|
|
|
|
I did that...
But what I need is not to allow the user to go back when back button is pressed...
Thanks
|
|
|
|
|
add following code in body tag
onload="history.forward(-1);"
|
|
|
|
|
I am using a datalist to easily display my data in 7 columns, but I can't seem to get the alignment correct. After a few tries i opened up the HTML and found border-collapse:collapse in the table's style. I used IE7s DevToolBar DOM viewer to remove it on the fly and everything looks and works great. So now my question is how do I get ASP.NET not to add it? I have tried using a CssClass, but the class option gets overwrote by the inline one. I also have tried to remove it after the fact with a little JavaScript (document.GetElementByID("elementID").style="" or document.GetElementByID("elementID").style.border-collapse="") both don't work. Thanks for any help.
|
|
|
|
|
Did you try the CellSpacing property?
Setting it to a positive value should remove the border-collapse style.
By the way, your javacript code is slightly wrong, try this:
document.getElementById("elementID").style.borderCollapse=""
But before doing such javascript stuff better try playing around with the border-related members of the DataList class.
Hope that helps
Klaus
|
|
|
|
|
Thanks, I've played with all the spacing and cell properties but none just remove the collapse (normally they added extra space I didn't want). Thanks for the javascript correction, I hate when javascript and CSS use different property names.
|
|
|
|
|
The exact effects of the ASP Class members to html output is poorly ducumented. Perhaps I'll find sth more exactly on google. I'll let you know.
Good Luck
Klaus
|
|
|
|
|
my windows dos not have IIS - (its not listed at Control Pannel/Add or Remove Programs/Add-Remove Windows Components/Windows Components Wizard list)
its Windows-Home edition service pack 2 -
can i install IIS from any where or i should shift to another windows? - if so,what version?
tx.
|
|
|
|
|
Running IIS on Windows Home Edition is not "officially" supported by Microsoft however it is possible to run it if you tweak some settings.
Please know however that tweaking these settings can severely cripple your machine so be prepared to reinstall your machine if anything goes wrong.
Check out this site for more info:
http://adamv.com/dev/articles/iis-on-xp-home[^]
If you don't want to get into messing around with registry files however, Windows Professional Edition is the version you'll want to get. It has IIS installed (which is the only way to run asp.net web sites on your local machine).
Good luck.
-Goalie35
|
|
|
|
|
This is not what you asked for, but perhaps the information you need...
If you are using Visual Studio 2005 you don't need IIS to test your web applications. It comes with a built in web server that is used when you start the application from Visual Studio.
---
Year happy = new Year(2007);
|
|
|
|
|
Hello folks,
I have a problem using ASP.NET 2.0 on IIS 6. I use a self made login routine using session variables. An object is stored in Session["user"] for this purpose. While on a test system everything works fine, on the real server the session variable disapears. This can happen within seconds or a few minutes while clicking around on the web site. Can't say anything more spcific. Does anyone know what can cause this problem?
Perhaps wrong server settings? If so, which?
Thx Klaus
|
|
|
|
|
|
Nope, definitely not. It's a proper server (Not just web hosting or something like that). Any Ideas nonetheless?
Why do you ask, did you experience similar problems?
One difference between test and productivity server exists. On the "real" server there is a http-auth based password check.
Thx for any help
Klaus
|
|
|
|
|
The reason I asked was that you have to change the StateServer with web farms.
|
|
|
|
|
Session variables does not disappear from a session by themselves. Write out the Session.SessionID value somewhere so that you can see if your session ends and you get a new one. If you don't get a new session, there is most likely something in your code that removes the session variables.
---
Year happy = new Year(2007);
|
|
|
|
|
4 All who may have the same problem in the future:
The problem is fixed!
The number of worker processes had been increased to 12 by our administrator. Resetting this value to 1 solves the problem.
Thx Klaus
|
|
|
|
|
Can someone please tell why the list box is not updating?
I have the following procedure to load my list box:
Protected Sub Load_Listbox()
'Purpose: Loads Listbox1 Control with the company titles from
' the AdeptMediaEmployees SQL Server DB
'Parameters: None
'Returns: Nothing
Dim dr As SqlDataReader
Dim cn As SqlConnection = New SqlConnection(MRMFunctions.WebConfigConnString)
Dim ID As String
Dim Title As String
cn.Open()
Try
Dim cd As SqlCommand = New SqlCommand("mrmsp_TitleList", cn)
cd.CommandType = Data.CommandType.StoredProcedure
cd.ExecuteNonQuery()
dr = cd.ExecuteReader
While (dr.Read)
ID = dr("TitleID")
Title = dr("Title")
ListBox1.Items.Add(New ListItem(dr("Title"), dr("TitleID")))
'ListBox1.Items.Add(New ListItem(Title, ID))
End While
Catch ex As Exception
If cn.State <> Data.ConnectionState.Open Then
Msg = "Could not open a connection to the SQL database."
lblErr.Visible = True
lblErr.ForeColor = Drawing.Color.Red
lblErr.Font.Bold = True
lblErr.Text = Msg
End If
Finally
dr.Close()
cn.Close()
End Try
End Sub
The procedure is called from the Page_Load event when the form is first opened.
The problem I have is when I make a change to the data listed in the list box. I call the same procedure from my update event:
Protected Sub btnUpdate_Click(ByVal sender As Object, _
ByVal e As System.EventArgs) _
Handles btnUpdate.Click
If (txtID.Text <> Nothing) And (txtTitle.Text <> Nothing) Then
lblErr.Visible = False
Dim bCont As Boolean = Update_Titles(CDec(txtID.Text), txtTitle.Text)
If Not bCont Then
Msg = "Update_Titles function failed."
lblErr.Visible = True
lblErr.ForeColor = Drawing.Color.Red
lblErr.Font.Bold = True
lblErr.Text = Msg
Else
lblErr.Visible = False
lblErr.ForeColor = Drawing.Color.Red
lblErr.Font.Bold = False
lblErr.Text = Nothing
Call Load_Listbox()
End If
Else
Msg = "Either the ID# or the Title box is empty. " & _
"Both boxes must be populated before I can " & _
"proceed with the update."
lblErr.Visible = True
lblErr.ForeColor = Drawing.Color.Red
lblErr.Font.Bold = True
lblErr.Text = Msg
End If
End Sub
I know the data is being updated, because I can see the updates in the SQL database. I also know the Load_Listbox procedure is being fired, because I stepped through the process and saw the update take place, but the listbox control was not updated.
Can anyone explain why?
Thank you,
Quecumber256
|
|
|
|
|
Hi
It is simple
Just refresh the page or after you add the fields write this:
response.redirect("the page itself")
Ok...
Love All
|
|
|
|