473,390 Members | 931 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,390 software developers and data experts.

Page.IsPostBack

Tim
I have dropdown list in Login page. The data is adding twice because the
Page_Load event is executing twice. But I am checking !Page.IsPostBack
property. First time the value for '!Page.IsPostBack' is 'true'. When it goes
for second time it is not setting to 'false'. Please remember the '!' before
the property. Which is means that still it is not recognizing that the page
is loaded.

Basically the Login page is redirecting from the Authenticate page.

Any help please, thanks in advance.

Jul 21 '05 #1
3 1952
It is not a post back if the page is redirected from another page.

From the login page, you should be submitting to login page (itself).
"Tim" wrote:
I have dropdown list in Login page. The data is adding twice because the
Page_Load event is executing twice. But I am checking !Page.IsPostBack
property. First time the value for '!Page.IsPostBack' is 'true'. When it goes
for second time it is not setting to 'false'. Please remember the '!' before
the property. Which is means that still it is not recognizing that the page
is loaded.

Basically the Login page is redirecting from the Authenticate page.

Any help please, thanks in advance.

Jul 21 '05 #2
It sounds like you are using C#, yes? Well, first off, the Page_Load event
only fires once for each page request so the problem must be your syntax.
Have you tried this

if(IsPostBack)
{
// This is a postback situation
}
else
{
// This is not a postback situation
}
"Tim" <Ti*@discussions.microsoft.com> wrote in message
news:4B**********************************@microsof t.com...
I have dropdown list in Login page. The data is adding twice because the
Page_Load event is executing twice. But I am checking !Page.IsPostBack
property. First time the value for '!Page.IsPostBack' is 'true'. When it
goes
for second time it is not setting to 'false'. Please remember the '!'
before
the property. Which is means that still it is not recognizing that the
page
is loaded.

Basically the Login page is redirecting from the Authenticate page.

Any help please, thanks in advance.

Jul 21 '05 #3
Tim,

You mean that you have the values twice in your dropdownlist.
This is weird, can you show some code.

Cor
Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Andre | last post by:
Hi, This is 'test.htm' --------------- <form name=totd> <input name="ud" type="hidden" value="" > </form>
5
by: Tim | last post by:
I have block of code adding values to dropdown list under if (!Page.IsPostBack) { adding items } else { refreshing data }
5
by: Tim | last post by:
To make !Page.IsPostBack to work, do I need to set any properties at page level or in the config files(Web, machine) or aspx files. Because code in under the !IsPostBack is executing twice and...
5
by: nly | last post by:
Page.IsPostBack Property "The Page_Load subroutine runs EVERY time the page is loaded. If you want to execute the code in the Page_Load subroutine only the FIRST time the page is loaded, you can...
2
by: Pravin | last post by:
Hi, I have a doubt that how does ASP.NET find out whether the page is accessed for the first time or the page is due to a post back event, and then set the IsPostBack property ? Any ideas. ...
6
by: DotNetGruven | last post by:
I've got a page that does a search... There is an ImageButton on it that allows the user to reset the search. The Click Handler for the button clears out the Data and then redirects to the same...
14
by: Mike | last post by:
I have a routine that i only want to execute if a variable is set to Y. The routine is getting some information on the screen then redirecting to a new page. How can i passed a variable to the...
5
by: tshad | last post by:
Is there a way to carry data that I have already read from the datagrid from page to page? I am looking at my Datagrid that I page through and when the user says get the next page, I have to go...
0
by: Managed Code | last post by:
Hi all, I've got a DropDownList for the connection string in a master page. Transitioning between content pages causes it to reset to the first value. Under what conditions and where should I...
6
by: anthonykallay | last post by:
Hi there, I dont this this a bug but i cant get my head around it.. I have a master page that has a login control on it, to log in i press the button and the page posts back, however on the page...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.