|
hello friends,
In my app, i have a logout buton for which i have written the following code.
Session.Remove("UserID");
Session.RemoveAll();
Session.Abandon();
Response.redirect("home.aspx");
But when i press logout button i come back to the last page.
that should not be happen bcoz i am having a logincheck usercontrol on that page that cheks wheither Session("UserID") is null or not.......
Deepak Nigam
|
|
|
|
|
As per your comments
When User clicks log out button you are clearing Session and redirecting user to Home Page this what you have implemented ...
But it is behaving relatively against it
Deepak Nigam wrote: But when i press logout button i come back to the last page.
How are you going again back to last page ?
If you saying by clicking back Button then Page might be coming from browser Cache
Deepak Nigam wrote: bcoz i am having a logincheck usercontrol on that page that cheks wheither Session("UserID") is null or not.......
As Good practice you should check user credentials in every page
By creating a base which will check User Credentials in every Page LOad
This Page need extend from System.Web.UI.Page and your all Page should extends this Page
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
I come back to last page by clicking the Back button on the browser.
Deepak Nigam
|
|
|
|
|
Deepak Nigam wrote: I come back to last page by clicking the Back button on the browser.
This will come from Cache. If you are checking the Credentials in every page then this should not cause any problem. e.g If user is in My Application Page where there are many controls like buttons etc to retrive some data. Now if i click Sign Out from this Page I will get redirect to Home Page ok Its fine
Now When user click back button browser will show My Application Page from Cache . Now if User clicks any server control in that page like button now Page Load will occure if you are checking Any user Credentials in My Application Page User wont be able to do anything he will get redirected to
Home Page
So its better to create a base class that will check user Credentials in its Page Load(What you are doing in user control) and your pages should extent this base page
Any how if you don't want ot Cache your page you will have to write this lines
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetExpires(DateTime.Now); //or a date much earlier than current time
Add at the every page
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Thanks Sandeep..........
It works.
Deepak Nigam
|
|
|
|
|
hi,
how can we write codes inside a gridview. i want to check some conditions before displaying data. how can i do it.
|
|
|
|
|
Be Specific take a look,Here you will get many articles related with GridView
which may help you
http://gridviewguy.com/CategoryDetails.aspx?categoryID=7[^]
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
modified on Tuesday, April 22, 2008 2:55 AM
|
|
|
|
|
i tried every thing..... if i use refresh button it is not working..
i have given the Lblnote.text=""; in my reset button .. in reset button it is working nice... but if i press refresh icon in the browser it is not working...
|
|
|
|
|
ARGH !!! WHAT IS YOUR PROBLEM ???
If you can't work out what a 'reply' button is for, I doubt you're up to writing any code.
yardly wrote: have given the Lblnote.text=""; in my reset button ..
The core problem here is one of literacy. Perhaps if you just set enableviewstate="false" so the label does not remember it's text, you may be able to handle that ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
If you have already posted back then the refresh button will not work properly and will only refresh the content that has been brought back and not the orginal page
|
|
|
|
|
Hi,
I have a requirement in my asp.net page. Page contains some validation controls. am validating those controls on client side using CustomValidator. If I didn't select any radio button and click "Next" button, it is displying message on top of the page "Please select value". Its fine. but my problem is the page is not going to top position. Is there any tag in HTML to meet my requirement?
Thanks
|
|
|
|
|
You can set tags in your html and browse to them via anchor tags, I believe you use # as the start of the placemarker.
http://www.w3schools.com/tags/tag_a.asp[^]
Here is the HTML from the w3schools example:
<html>
<body>
<p>
<a href="#C4">See also Chapter 4</a>
</p>
<p>
<h2>Chapter 1</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 2</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 3</h2>
<p>This chapter explains ba bla bla</p>
<h2><a name="C4">Chapter 4</a></h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 5</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 6</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 7</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 8</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 9</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 10</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 11</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 12</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 13</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 14</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 15</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 16</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 17</h2>
<p>This chapter explains ba bla bla</p>
</body>
</html>
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi thanks for your reply. I know that one. Is there any solution for Button tag? if there is no validation errors it redirect to other page.
so with out using anchor tag is there any other solution?
Thanks.
|
|
|
|
|
|
Currently i m using ASP.NET with C#
(.net 2005, 2.0 framework)
When user enter some raw data in the address bar of IE, then it should redirect to a page.
for example,
If user enter "GOTO MY FIRST PAGE" and press enter, then the page should redirect to "first_page.aspx".
how to accomplish this?
is it possible one? - KARAN
|
|
|
|
|
I guess you don't understand what ASP.NET is and does ? You need to write an internet explorer add in toolbar to change how the browser behaves when given an english string like this. If you do some reading on ASP.NET, you'll come to understand why ASP.NET cannot make IE do what you want.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hi,
lblnote.Text = "Your Profile Was Updated";
i using label to the show message...
but if i press refresh button in the browser, the error message should disable from my aspx page...
and also i tried in script:
Page.RegisterStartupScript("as", " alert('Your Profile Was Updated')");
but it is showing exclamation symbol.....
i dont want this symbol in my popup message box. plzany one tell me the answer...
sorry to ask this tell how to replay message for u
|
|
|
|
|
Please answer within the same thread that you are already being helped.
Set the lblnote.Text to be string.Empty before the event handler that resets it to the text you want.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hi
in my propject i want to show some data without gridview control. also i want to include paging in it. is there any third party controls for it. please help me to do it.
thanks in advance
|
|
|
|
|
Yes, there are third party controls. Or, you could write your own. An obvious way is to write a proc that returns one page at a time, and put the page number on the URL.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
i have created one. but it shows some difficulties in paging. if there is 40 pages in that i want to show first 10 indexes in the paging. and when the user clicks on 10, i want to show from 10 to 15. how can i do it.
|
|
|
|
|
Yes you can creat a custom control for it.
I think it is better option instead of using 3 party tool
You can have all the functionality that you required as you(custom control) would be responsible rendering the page.
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
All,
I am getting follwing error while reading my XML file directly returned from web service. This occurs normally when XML have some misplaced node, but my XML is returned from webservice with few chances to have node errors.
Can any one help me regarding this problem.
My error page is:
Server Error in '/portal' Application.--------------------------------------------------------------------------------
This is an unexpected token. The expected token is 'NAME'. Line 778, position 626.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Xml.XmlException: This is an unexpected token. The expected token is 'NAME'. Line 778, position 626.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
And my stack trace is:
[XmlException: This is an unexpected token. The expected token is 'NAME'. Line 778, position 626.]<br />
System.Xml.XmlTextReader.SetAttributeValues() +323<br />
System.Xml.XmlTextReader.ParseElement() +138<br />
System.Xml.XmlTextReader.Read() +94<br />
System.Xml.XmlValidatingReader.ReadNoCollectTextToken() +38<br />
System.Xml.XmlValidatingReader.Read() +14<br />
System.Xml.XmlLoader.LoadCurrentNode() +612<br />
System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc) +49<br />
System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace) +102<br />
System.Xml.XmlDocument.Load(XmlReader reader) +72<br />
System.Xml.XmlDocument.LoadXml(String xml) +163<br />
AI.Portal.Web.UI.RailBooking.ProcessGet()<br />
AI.Portal.Web.UI.BaseDialog.ProcessRequest()<br />
AI.Portal.Web.UI.HttpHandler.ProcessRequest(HttpContext context)<br />
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() +179<br />
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +87
I am using Microsoft .NET Framework Version:1.1.4322.2407; ASP.NET Version:1.1.4322.2407
Thanks in advance for any help.
Anand
|
|
|
|
|
I'd say there is an unexpected token, which is 'NAME'. I'm not sure what else you'd like us to tell you. You haven't posted code or anything, so you can't want to know how to fix the error ?
Have you looked at the XML that causes this error ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi Anand,
the line numbers mentioned in the error message might not be exact, but check if there are elements in the xml file having multiple attributes but without space between each attribute & value pair i.e. some spacing error.
|
|
|
|