|
I am using Asp.Net 2.0. How can I avoid using back button after logged out from the page. Thanks in adv.
Balasubramanian K.
|
|
|
|
|
|
madhukk wrote: Disable back button using javascript
What if the user has disabled javascript?
What if user uses Alt+LeftArrowKey?
..Go Green..
|
|
|
|
|
Just search it in CP Q&A forum. This has been asked number of times:
one of the ways: Try...In you logout event:
protected void LogOut()
{
Session.Abandon();
string nextpage = "Logoutt.aspx";
Response.Write("<script language=javascript>");
Response.Write("{");
Response.Write(" var Backlen=history.length;");
Response.Write(" history.go(-Backlen);");
Response.Write(" window.location.href='" + nextpage + "'; ");
Response.Write("}");
Response.Write("</script>");
}
|
|
|
|
|
This is the second time today when I was answering a question and as soon as I finished answering, I saw your answer above me.
*I hope you got my previous message in the notification mail.
..Go Green..
|
|
|
|
|
Done! Sure... tell me how can i help..
modified on Wednesday, June 2, 2010 5:58 AM
|
|
|
|
|
|
The best option is
(1) check for a valid session object as the first statement to be executed for your page load event handler. If there is no session (or session object is null you write code to redirect user to login and force user to create a session. Assumption is, while logging out code is written to clear Session which has been created at the time of "Login".
(2) Sometime, developer creates "Base" page class and write this kind of session checking in base page itself so that every derived page class follows the same.
This way, you can set aside any dependency of javascript.
Hope it helps you,
Thanks,
Arindam D Tewary
|
|
|
|
|
Thanks to all.
Balasubramanian K.
|
|
|
|
|
Did web service come first or Dotnet?
Regards,
netquestions
|
|
|
|
|
|
Hello.
Im having few textboxs,image button and Button in a page.
default button is set to button control and focus is on one of the textboxs but when i press enter after page loads the control shifts to image button. Why does this happen?
|
|
|
|
|
Are all the controls in the same panel of the page and panel has a defined default button?
If not, try that.
|
|
|
|
|
All controls are in same panel
|
|
|
|
|
Ok. So after page load where is the focus? on button or image-button?
If default button of panel set to button, once page loads, enter should trigger simple button click. Are you doing something different?
|
|
|
|
|
Focus is set to one of the text boxs in page..
|
|
|
|
|
Dear friend,
I am trying to fetch data from excel sheet using ASP.NET with C#. I want to get data based on one date condition. All the rows in that date column are having date only. I don't know what's wrong. I have tried in many ways. I am getting the following error.
[System.Data.OleDb.OleDbException] = {"Data type mismatch in criteria expression."}
Since last day afternoon, I am struggling for this. I have written queries in all following possible ways.
select * from [sheet1$] where [LoginDate]='21/04/10'
select * from [sheet1$] where [LoginDate]='21/04/2010'
select * from [sheet1$] where [LoginDate]='21-04-10'
select * from [sheet1$] where [LoginDate]='21-04-2010'
select * from [sheet1$] where [LoginDate]='21-Apr-10'
select * from [sheet1$] where [LoginDate]='21-Apr-2010'
select * from [sheet1$] where [LoginDate]='04/21/10'
select * from [sheet1$] where [LoginDate]='04/21/2010'
select * from [sheet1$] where [LoginDate]='04-21-10'
select * from [sheet1$] where [LoginDate]='04-21-2010'
select * from [sheet1$] where [LoginDate]='Apr-21-10'
select * from [sheet1$] where [LoginDate]='Apr-21-2010'
select * from [Sheet1$] where [LoginDate] = '"+DateTime.Parse("04-21-10").ToString()+"'"
select * from [Sheet1$] where [LoginDate] = '"+DateTime.Parse("04-21-10")+"'"
Still I am not getting. Can anyone, pls help me. It's very urgent.
Regards,
Dileep
|
|
|
|
|
There is a known issue with OleDb and dates!
It expects dates in format: "yyyy-MM-dd hh:mm:ss"
Try something like:
"SELECT * FROM [sheet1$] where [LoginDate]='" + myLoginDate.ToString("yyyy-MM-dd hh:mm:ss") + "'"
Read this thread for details and one more other option to use parameters: Data type mismatch in criteria expression[^]
|
|
|
|
|
Thanks friends,
I have got it in another way.
select * from [sheet1$] where LoginDate=#21/04/10#
It's working fine.
Thanks everyone.
Regards,
Dileep.
|
|
|
|
|
Hi Frds.......
I need to know much more detail, in deepth knowledge regarding Properties in .NET : Get and Set.
I have tried searching everywhere but couldn't find anything which let me understand this two things.
Recently also I have been asked two implement Family Structure (A simple example) with Add Family Details, List out Family Details (Single Person), List out Family Details (Whole Family), etc, by making use of Properties.
Can anyone please help me out to understand in deepth Properties in .NET, i.e., How to Use Get and Set EXACTLY!!!!
Thanks
|
|
|
|
|
|
In order to understand them, you need to understand what an accessor means. The accessor of a property contains the executable statements associated with getting (reading or computing) or setting (writing) the property. The get and set keywords are accessors to a property. The code block for the get accessor is executed when the property is read; the code block for the set accessor is executed when the property is assigned a new value. A property without a set accessor is considered read-only. A property without a get accessor is considered write-only. A property that has both accessors is read-write. Here is a simple example(not the perfect example though ) of a class that uses get and set.
class KgToLbsConverter
{
public double _qty;
public bool _isKgs;
public KgToLbsConverter(double qty)
{
_qty = qty;
}
public bool QuantityIsInKilograms
{
get { return _isKgs; }
set { _isKgs = value; }
}
public double Kilograms
{
get
{
if (_isKgs) { return _qty; }
else { return _qty * 2.20462262; };
}
}
public double Pounds
{
get
{
if (!_isKgs) { return _qty; }
else { return _qty / 2.20462262; };
}
}
}
and then in your main program, you can test the class with a code snippet something like this
KgToLbsConverter convert = new KgToLbsConverter(1);
convert.QuantityIsInKilograms = true;
You can refer to the following links for more information.
Accessors - http://msdn.microsoft.com/en-us/library/aa287786%28VS.71%29.aspx
Properties - http://msdn.microsoft.com/en-us/library/w86s7x04.aspx
Get Keyword - http://msdn.microsoft.com/en-us/library/ms228503.aspx
Set Keyword - http://msdn.microsoft.com/en-us/library/ms228368.aspx
Walter
|
|
|
|
|
Hi,
I have created login for site. I am using "UserLogin.ascx" which is placed in masterpage. Now I have to create the Login system so that the users from other sites login to my site through Http post or Get. I have created the page for sending "HTTP Post" to my site and it also login to my site, but when I click on any link it logs out also in the browser's address bar the URL of the previous site is shown.
Thanks
|
|
|
|
|
Hello,
I am a developer in ASP.NET (C#). Recently I am studying on SEO in order to upgrade my Web Application, and I learned that, Google bot reduce the rank if it finds duplicate content. thats fine, but what is bothering me, is, if I have urls as
http://myWebsite.com
http://www.myWebsite.com
http://myWebsite.com/Default.aspx
http://www.myWebsite.com/Default.aspx
Then, my site rank will be down, as Google will think that, I have same content in 4 urls. BUT, my Question is WHY!!!!, Google, the world's best search engine, does not have such intelligence to evaluate these 4 urls as single url !! ? Cant they simply add some additional if-else logic to determine these urls ? Also I learned that, the urls must be case sensitive. That means, in Windows Hosting, myWebsite.com and MyWEBSITE.COM points to the same file, but Google search engine will reduce rank for this. Again !! I dont know, cant Google bot do some case insensitive string comparison ? What a HELL !!
Also, found many upsetting topics to discuss about SEO, but for now, my question about these 2 scenarios. Would you please share your opinions ?
|
|
|
|
|
I don't think you understand what you are reading very well.
The more distinct sites that link to your site the higher the rank. If you use several different URLs then it seems like you are trying to artificially increase the number of sites that link to your content. Just because your site can be referred to that way doesn't mean you have to. If you are consistant in the way you link internally and the way you advertise your site you won't have a problem.
URLs are case sensitive. That is the way the web was built. Not everyone uses windows hosting. mywebsite.com/Thing and mywebsite.com/thinG are two completely different URLs on a Unix system.
All of these things are easily avoidable if you are consistant in how you develop and market your site. So unless you have some medical condition that causes random spasms over your caps lock key, you are doing a lot of whining over nothing.
|
|
|
|