|
Hi,
After clicking the logout button,the all the cookies will be cleared... and when you click on back button it shows only UI and links...
if you want you can test it by clicking any link (button/link),you will not get any user information and automatically it will redirects to your redirected page..
if not like that,you have to clear all the cookies and abonden all the session variables
S Kumar
|
|
|
|
|
How can i clear all cookies when we click on logout.
|
|
|
|
|
Hi,
'clears formsauthentication cookies
Response.Cookies.Remove(FormsAuthentication.FormsCookieName)
'clears all sessions variables of application
Session.RemoveAll()
Session.Abandon()
S Kumar
|
|
|
|
|
Hi Friend,
I Given the code but it willnot cleared the cookie and i can took all datas,it willnot ask again to login.
|
|
|
|
|
HI,
Are you redirecting from that page to some other page (generally login page) whenever page losses cookie value...?
S Kumar
|
|
|
|
|
Hi,
Actually i put a login control in masterpage enabled page and i put menu in masterpage.in the menu i put a menuitem logout and in the menu item click event i given formsauthentication.signout and the above given code.and i retdirect the page to home page where the login control, is situated.This is the flow of login and logout.After logout i checked username is null or not in another menuitem page.but i can easily access the page because the username still exists.What is the problem.
|
|
|
|
|
HI,
you can check the formsauthentication cookie information in the masterpage's page_load event.. if the cookies value is nothing simply redirect to login page
|
|
|
|
|
Hi,
you can do like this also ...just by using javascript you can disable back button (but this is not good practice)....
S Kumar
|
|
|
|
|
Not when i click the back button when i click any menu link also i can easily access the datas without logged in.
|
|
|
|
|
hi,
what are modifications that you are done?
S Kumar
|
|
|
|
|
Hi,
just check the cookie information is either available or not in master page's page load event,if values are nothing just redirect to login page...
S Kumar
|
|
|
|
|
Hi,
In your first page, paste this code in pageload
Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1));
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetNoStore();
|
|
|
|
|
Sorry to say again it works wrongly.the user can access pages after paster the page in pageload of first page.
|
|
|
|
|
Hi Kumar Sir,
I got it sir.Actually we have to given Formsauthentication.LoginUrl then it cleanely works.
|
|
|
|
|
Thanks for your corordination sir...
|
|
|
|
|
Hi,
I want to export an image field from sql 2005 to excel. This is with vb.net.
Is there anybody who knows if this is possible? And how to do this?
T.
|
|
|
|
|
How is this an asp.net question ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I have the Following code that runs inside loops
if (txt != array[p].ToString())
{
cycleGrid.Rows[i].Cells[j].Style.BorderColor = System.Drawing.Color.DarkGray;
cycleGrid.Rows[i].Cells[j].Style.ForeColor = System.Drawing.Color.DarkGray;
cycleGrid.Rows[i].Cells[j].Style.Cursor = Infragistics.WebUI.Shared.Cursors.Wait;
}
else
{
cycleGrid.Rows[i].Cells[j].Style.ForeColor = System.Drawing.Color.Black;
cycleGrid.Rows[i].Cells[j].Style.Cursor = Infragistics.WebUI.Shared.Cursors.Auto;
cycleGrid.Rows[i].Cells[j].Style.Font.Bold = true;
}
Now as you can see am disabling cells by turing the color to be gray and by making sure that its not selectable. Now this will work perfectly if the array has a single value in the Array, but when the Value is like this
1 2 3 4 5 6 7 8 9 10 11 12 13 14 17 18 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
i need to Disable the values that does not appear in the array like the above example 15,16,19 will be missing from the list, so in the grid they should be gray and the other should be bold and black. Mybe there is something wrong here , because it only make the 35 im the list and it made it bold and it made others bold to but they are grey but bold. like this
http://www.vbforums.com/attachment.php?attachmentid=69654&stc=1&d=1236926456[^]
Thank you
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
www.ITS.co.za
|
|
|
|
|
What we're not seeing is the loop that iterates over i and j.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
The Method with loops look like this
protected void setupGrid()
{
if (((int)Session["numCycles"]) > 0)
{
UltraWebGrid cycleGrid = ultraGridCycles;
int numCols = 0;
int numRows = 0;
if (((int)Session["numCycles"]) >= 13)
{
numCols = 13;
}
else
{
numCols = ((int)Session["numCycles"]);
}
if ((((int)Session["numCycles"]) % 13) == 0)
{
numRows = (int)(((int)Session["numCycles"]) / 13);
}
else
{
numRows = (int)((((int)Session["numCycles"]) / 13) + 1);
}
cycleGrid.Height = Unit.Pixel(20 * numRows + 6);
for (int i = 0; i < numCols; i++)
{
UltraGridColumn col = new UltraGridColumn(true);
col.Width = Unit.Pixel(10);
col.Key = i.ToString();
cycleGrid.Columns.Add(col);
}
for (int i = 1; i <= numRows; i++)
{
UltraGridRow row = new UltraGridRow(true);
row.Key = i.ToString();
for (int j = 1; j <= numCols; j++)
{
UltraGridCell cell = new UltraGridCell(true);
cell.Style.HorizontalAlign = HorizontalAlign.Center;
cell.Style.Padding.Left = 0;
cell.Style.Padding.Top = 0;
cell.Style.Padding.Bottom = 0;
cell.Style.Padding.Right = 0;
cell.Value = (int)((13 * (i - 1)) + j);
if (((13 * (i - 1)) + j) > ((int)Session["numCycles"]))
{
cell.Value = null;
cell.Style.BackColor = System.Drawing.Color.Gray;
cell.AllowEditing = AllowEditing.No;
}
row.Cells.Add(cell);
}
cycleGrid.Rows.Add(row);
}
ArrayList array = (ArrayList)Disable_Grid();
int u = cycleGrid.Rows.Count;
for (int i = 0; i < cycleGrid.Rows.Count; i++)
{
UltraGridRow g = cycleGrid.Rows[i];
for (int j = 0; j < g.Cells.Count; j++)
{
for (int p = 0; p < array.Count; p++)
{
string txt = g.Cells[j].Text;
if (txt != array[p].ToString())
{
cycleGrid.Rows[i].Cells[j].Style.BorderColor = System.Drawing.Color.DarkGray;
cycleGrid.Rows[i].Cells[j].Style.ForeColor = System.Drawing.Color.DarkGray;
cycleGrid.Rows[i].Cells[j].Style.Cursor = Infragistics.WebUI.Shared.Cursors.Wait;
}
else
{
cycleGrid.Rows[i].Cells[j].Style.ForeColor = System.Drawing.Color.Black;
cycleGrid.Rows[i].Cells[j].Style.Cursor = Infragistics.WebUI.Shared.Cursors.Auto;
cycleGrid.Rows[i].Cells[j].Style.Font.Bold = true;
}
}
}
}
}
}
Thanks
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
www.ITS.co.za
|
|
|
|
|
Lot of code here. What happens when you step through it ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Good Morning Chris
Thanks for your help, i have added an extra if statement like this and it worked
protected void setupGrid()
{
if (((int)Session["numCycles"]) > 0)
{
UltraWebGrid cycleGrid = ultraGridCycles;
int numCols = 0;
int numRows = 0;
if (((int)Session["numCycles"]) >= 13)
{
numCols = 13;
}
else
{
numCols = ((int)Session["numCycles"]);
}
if ((((int)Session["numCycles"]) % 13) == 0)
{
numRows = (int)(((int)Session["numCycles"]) / 13);
}
else
{
numRows = (int)((((int)Session["numCycles"]) / 13) + 1);
}
cycleGrid.Height = Unit.Pixel(20 * numRows + 6);
for (int i = 0; i < numCols; i++)
{
UltraGridColumn col = new UltraGridColumn(true);
col.Width = Unit.Pixel(10);
col.Key = i.ToString();
cycleGrid.Columns.Add(col);
}
for (int i = 1; i <= numRows; i++)
{
UltraGridRow row = new UltraGridRow(true);
row.Key = i.ToString();
for (int j = 1; j <= numCols; j++)
{
UltraGridCell cell = new UltraGridCell(true);
cell.Style.HorizontalAlign = HorizontalAlign.Center;
cell.Style.Padding.Left = 0;
cell.Style.Padding.Top = 0;
cell.Style.Padding.Bottom = 0;
cell.Style.Padding.Right = 0;
cell.Value = (int)((13 * (i - 1)) + j);
if (((13 * (i - 1)) + j) > ((int)Session["numCycles"]))
{
cell.Value = null;
cell.Style.BackColor = System.Drawing.Color.Gray;
cell.AllowEditing = AllowEditing.No;
}
row.Cells.Add(cell);
}
cycleGrid.Rows.Add(row);
}
ArrayList array = (ArrayList)Disable_Grid();
int u = cycleGrid.Rows.Count;
for (int i = 0; i < cycleGrid.Rows.Count; i++)
{
UltraGridRow g = cycleGrid.Rows[i];
for (int j = 0; j < g.Cells.Count; j++)
{
for (int p = 0; p < array.Count; p++)
{
string txt = g.Cells[j].Text;
if (txt != array[p].ToString())
{
cycleGrid.Rows[i].Cells[j].Style.ForeColor = System.Drawing.Color.Gray;
}
else
{
cycleGrid.Rows[i].Cells[j].Style.Cursor = Infragistics.WebUI.Shared.Cursors.Auto;
cycleGrid.Rows[i].Cells[j].Style.ForeColor = System.Drawing.Color.Black;
cycleGrid.Rows[i].Cells[j].Style.Font.Bold = true;
}
}
if (cycleGrid.Rows[i].Cells[j].Style.Font.Bold == true)
{
cycleGrid.Rows[i].Cells[j].Style.ForeColor = System.Drawing.Color.Black;
}
else
{
cycleGrid.Rows[i].Cells[j].Style.ForeColor = System.Drawing.Color.Gray;
cycleGrid.Rows[i].Cells[j].Style.BackColor = System.Drawing.Color.DarkGray;
cycleGrid.Rows[i].Cells[j].Style.Cursor = Infragistics.WebUI.Shared.Cursors.Wait;
}
}
}
}
}
And its working thank you
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
www.ITS.co.za
|
|
|
|
|
I have a Web Service that is receiving a file, and putting into a SQL Database. For some reason this method gets an error, while all the others work. Through searching the web all the results say I need to change my IIS setup, which I did not do because it is already setup the way they want.
So, any ideas why I can't call this method:
public void AddSong(string Name, string Artists, string Album, string Genre, int YearPublished, string Path, DateTime DateAdded, byte[] FileData, string MD5)
Without this error:
The request failed with HTTP status 400: Bad Request.
I can post any code you think is relavant, but with my searches it seems like it isn't a code issue. Am I doing something not allowed?
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
It can be cause of Access Permission. Seem, the file need to write in your system so its required permission. Did you create Application Pool on IIS. Create New Application Pool, Change the Identity of Application pool to local system, then assign the application pool to that Virtual Directory then Try test. Hope this will resolve your issue.
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
I am not writing it to the file system, straight to SQL...
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|