473,797 Members | 2,934 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.IsPostBac k
property. First time the value for '!Page.IsPostBa ck' 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 1981
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.IsPostBac k
property. First time the value for '!Page.IsPostBa ck' 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*@discussion s.microsoft.com > wrote in message
news:4B******** *************** ***********@mic rosoft.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.IsPostBac k
property. First time the value for '!Page.IsPostBa ck' 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
1507
by: Andre | last post by:
Hi, This is 'test.htm' --------------- <form name=totd> <input name="ud" type="hidden" value="" > </form>
5
2922
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
2414
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 adding data twice to dropdown list control. any help please..Tim
5
2560
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 use the Page.IsPostBack property. If the Page.IsPostBack property is false, the page is loaded for the first time, if it is true, the page is posted back to the server (i.e. from a button click on a form)..." Let's say we have this in a "body"...
2
14354
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. Pravin.
6
16060
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 page with Response.Redirect("Search.Aspx", true); Sometimes the code in Page_Load within the IsPostBack part of the if statement runs and sometimes it doesn't. IN other words, sometimes IsPostBack is true and sometimes it is not!
14
1742
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 Page.IsPostBack routine on the page_load event? this is what I'm trying to do/ sub page_load if page.ispostback then dim value as string = CType(Session("quesiton"), string)
5
2795
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 to the database to get the next page. Is there a way to use the dataset to allow us to read back and forth in it instead of going back to the database to get it? Thanks,
0
1349
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 do the following? 1 - Initialize the DropDownlist. 2 - Set the default SelectedIndex value.
6
15856
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 that is derived from the master page (default.aspx) i have code that i dont want to run after the login button is pressed so i used the standard if(!Page.IsPostBack) {}
0
9685
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9536
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10468
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10245
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9063
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6802
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5458
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2933
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.