|
simply... check in page_load event is session variable is null or not if it is null redirect the page to login..thats all
Sarith...
|
|
|
|
|
Bharath.S.Ron wrote: I will logout and set the session value to null,
Wrong. You should call Session.Abandon()
Bharath.S.Ron wrote: my problem here is when i click back in browser after logging out it is going to page two this should not happen.
You are seeing cached version of your page by browser. In each page_load event you need to check session existence. If it's not exist, navigate user to login page. Your session check would be like this
if(Session["UserId"]==null)
{
Response.Redirect("Login.aspx");
}
|
|
|
|
|
When i click the browser back button the page load event is not triggered ,the page will be directly loaded over the browser.
Bharath.S Ron
|
|
|
|
|
Bharath.S.Ron wrote: When i click the browser back button the page load event is not triggered
Yes it won't be fired. But since you are checking Session on page load, he/she can't continue with any other operation. If they click on any button's or refresh the page, it will redirect to login page.
You can try disabling the caching too. But I doesn't looks like a good solution to me.
|
|
|
|
|
You have to check in each page load whether the session is null or not null.
If the session value is null means redirect to login page else to the required page.
VanithaVasu
|
|
|
|
|
Hi,
The real problem here is that the When he logout then the page is redirects to the Login page but,If he clicks the browser's back buttion then He can view the content of the page.
Your Idea --putting some code to page load event will not work here because it comes form the Browser's Cache memory. So it will display. Ok
Naresh Patel
|
|
|
|
|
You can disable caching on the client:
Response.CacheControl = "no-cache";
Response.AddHeader("pragma", "no-cache");
Response.Expires = -1;
Then the click on Back will cause a request to the server.
-^-^-^-^-^-
no risk no funk ................... please vote ------>
|
|
|
|
|
can you please brief me on this concept.??
Bharath.S Ron
|
|
|
|
|
Please refer to the MSDN for information about this methods.
The effect is that the Browser does not hold a copy of the page in its cache and therefore requests the page from the server when the user clicks on the back button. And you can react as you wish on the server side - show login screen or whatever you like.
-^-^-^-^-^-
no risk no funk ................... please vote ------>
|
|
|
|
|
Yes you are right, But this method will fail with firefox browser. Any other alternative do you know for firefox ?
|
|
|
|
|
It's new to me that this approach fails with Firefox
I'll have to check this because this is no good news for my applications!
Thanks for the hint.
-^-^-^-^-^-
no risk no funk ................... please vote ------>
|
|
|
|
|
I want the date format to be in this way like 15-jun-2005 using c# dot net
Regards,
Magi
|
|
|
|
|
DateformatFrom = datevalue.ToString("dd-MMM-yy hh:mm:ss");
you can convert the date into the format which ever you want.
I have shown you the one of the way to do that
Regards
Bharath.S Ron
|
|
|
|
|
get it Date format
---------------------------------------------------
|
|
|
|
|
Please do not cross post!
-^-^-^-^-^-
no risk no funk ................... please vote ------>
|
|
|
|
|
Can i write Multiple Select Statements in DataAdapter .
If it is Possible means How to write ?
I have written like this but it is throwing the error.
DataAdapter=new OleDbDataAdapter("select * from Table1;select * from Table2",connection);
VanithaVasu
|
|
|
|
|
No u canot write like this.. u can use join querry
Sarith...
|
|
|
|
|
VanithaVasu wrote: Can i write Multiple Select Statements in DataAdapter .
Yes you can. When you fill dataset, it will contain two datatables. But instead of separating multiple queries with ; symbol, it's better to go for store procedure's.
VanithaVasu wrote: I have written like this but it is throwing the error.
DataAdapter=new OleDbDataAdapter("select * from Table1;select * from Table2",connection);
What's the error it's throwing ?
|
|
|
|
|
The Error is : Characters found after end of SQL statement.
I want to the two tables separately in my dataset.
How to do so?
VanithaVasu
|
|
|
|
|
What is it that you are after?
If you want more than two select statements in the table use a join.
If you want different select statements for different tables or adapters,
use different querystrings...
I think for ur case u need :
DataTable dt1=new DataTable();
DataTable dt2=new DataTable();
dt1="first sql select query result";
dt2="second sql select query result";
dataset ds=new dataset();
ds.Tables.Add(dt1);
ds.Tables.Add(dt2);
Hope that helps!!!
I was born dumb!!
Programming made me laugh !!!
--sid--
|
|
|
|
|
Insetd of trying this:
DataAdapter=new OleDbDataAdapter("select * from Table1;select * from Table2",connection);
Try this:
SqlDataAdapter adpt1 = new SqlDataAdapter("Select * From Table1", con);
DataSet ds = new DataSet();
adpt1.Fill(ds);
SqlDataAdapter adpt2 = new SqlDataAdapter("Select * From Table2", con);
adpt2.Fill(ds);
return ds;
Naresh Patel
|
|
|
|
|
VanithaVasu wrote: I want to the two tables separately in my dataset.
How to do so?
As I told before, stored procedure's would be better approach for your problem. Write a stored procedure like
CREATE PROCEDURE [dbo].[MultipleSelect]
AS
SELECT * FROM FisrtTable
SELECT * FROM SecondTable
GO
Now Set command type to stored procedures for your OleDbCommand. Pass this stored procedures and fill dataset. This will give you two tables in dataset. Returning multiple recordset is a recommended practice by MSDN, which boosts performance.
|
|
|
|
|
Hi all,
I am publishing my web site by right clicking the solution - publish -
In the out put bin folder there exists around 600 files around 200 Dll's and 400 .compiled files. I dont know where these came from. Am i doing the publish right or not? By the way my application is working ok. Another question also is that if i need to change some thing do i need to upload all the bin folder again?
Thanks
|
|
|
|
|
Hello all,
I need an application which can read a given pdf (with multiple pages)and break it into multiple files on a given parameter.
The first objective is to develop and application which can read the whole pdf word by word into a stream, and writing the same stream into another pdf.
If someone has done any work on that, then please share the same or any apropos information.
|
|
|
|
|
hi all,
I want to update the body of my web page say every 10 seconds without having to reload the page i.e. no flickers. I just want any part of the page that has changed e.g. a table connected to a database to show the current data without the users clicking anything i.e. it should be automatic, using a particular time interval like I mentioned.
i tried using the setInterval('function1()',10000) and the page gets reloaded.but i want to avoid this.How can i implement the same using AJAX?
Thanks in advance.
Regards
Anuradha
|
|
|
|