473,386 Members | 1,795 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,386 software developers and data experts.

F5 reresh problem

1
Hello all,

I'm creating a creating a web page with C# and ASP.NET where I have a dataGrid with names. It works OK but every time I push on the F5 key reloads all the page again and duplicates the names that I have in the dataGrid. I tested it with IsPostBack but it doesn't work.
Does anybody knows how to overcome to this problem?

Thanks anyway

YKI
Aug 3 '07 #1
8 1724
Floydan
24
Hello all,

I'm creating a creating a web page with C# and ASP.NET where I have a dataGrid with names. It works OK but every time I push on the F5 key reloads all the page again and duplicates the names that I have in the dataGrid. I tested it with IsPostBack but it doesn't work.
Does anybody knows how to overcome to this problem?

Thanks anyway

YKI
Hi,
IsPostBack wont become true when you refresh.

To make sure you dont get duplicates you can either clear the datagrid before you start adding values to it.

But what amazes me is the fact that the DataGrid retains it values even though you refresh the page...
Aug 3 '07 #2
radcaesar
759 Expert 512MB
Write ur Dtabind code inside the

If ! (IsPostback)
{

}
Aug 3 '07 #3
Floydan
24
Write ur Dtabind code inside the

If ! (IsPostback)
{

}
But hitting refresh wont fire the PostBack event...
Aug 3 '07 #4
Plater
7,872 Expert 4TB
But hitting refresh wont fire the PostBack event...
Correct, which is why the !isPostBack is used
Aug 3 '07 #5
Floydan
24
Correct, which is why the !isPostBack is used
Forgive my ignorant question. But how can the DataGrid retain its previous state and content between refreshes?

In his question he states that after hitting F5 refresh the datagrids items are doubled. I just dont see how that is possible.
Hitting refresh should refresh the browser and fire off the Page_Load event as if it is the first time the browser is loaded.
Ergo (advanced words here ;) ) the DataGrid should be cleared on the refresh and then refilled when the Page_Load event is fired. !IsPostBack wont affect his issue at all.

or have i missunderstood the question entirely?
Aug 3 '07 #6
Frinavale
9,735 Expert Mod 8TB
But hitting refresh wont fire the PostBack event...
Just to clarify.....

When you hit F5 you get this message saying:

"To display the webpage again, blabla needs to Resend the information you've previously submitted.

If you were making a purchase, you should click cancel to avoid a duplicate transaction."


The information is resubmitted...

I just checked if a PostBack is caused upon refresh using the debugger and sure enough it does happen :D


Cheers!

-Frinny
Aug 3 '07 #7
Frinavale
9,735 Expert Mod 8TB
Forgive my ignorant question. But how can the DataGrid retain its previous state and content between refreshes?

In his question he states that after hitting F5 refresh the datagrids items are doubled. I just dont see how that is possible.
Hitting refresh should refresh the browser and fire off the Page_Load event as if it is the first time the browser is loaded.
Ergo (advanced words here ;) ) the DataGrid should be cleared on the refresh and then refilled when the Page_Load event is fired. !IsPostBack wont affect his issue at all.

or have i missunderstood the question entirely?
He could possibly be using some sort of concatenation when storing the data source for the DataGrid.

Floydan has a point here....we don't really know what you're trying to do without seeing the code that handles your data source for the DataGrid.

YKI, could you please provide us with this snippet of code so that we can help you better.

Thanks!

-Frinny
Aug 3 '07 #8
Floydan
24
Just to clarify.....

When you hit F5 you get this message saying:

"To display the webpage again, blabla needs to Resend the information you've previously submitted.

If you were making a purchase, you should click cancel to avoid a duplicate transaction."


The information is resubmitted...

I just checked if a PostBack is caused upon refresh using the debugger and sure enough it does happen :D


Cheers!

-Frinny
Good point, forgot all about the reposting data question.
Aug 3 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Bruce Davis | last post by:
I'm having a problem on windows (both 2000 and XP) with a multi-threaded tkinter gui application. The problem appears to be a deadlock condition when a child thread pops up a Pmw dialog window in...
11
by: Kostatus | last post by:
I have a virtual function in a base class, which is then overwritten by a function of the same name in a publically derived class. When I call the function using a pointer to the derived class...
0
by: Refky Wahib | last post by:
Hi I need Technical Support I finished a Great project using .Net and SQL Server and .Net Mobile Control My Business case is to implement this Program to accept about 1 Million concurrent...
117
by: Peter Olcott | last post by:
www.halting-problem.com
28
by: Jon Davis | last post by:
If I have a class with a virtual method, and a child class that overrides the virtual method, and then I create an instance of the child class AS A base class... BaseClass bc = new ChildClass();...
6
by: Ammar | last post by:
Dear All, I'm facing a small problem. I have a portal web site, that contains articles, for each article, the end user can send a comment about the article. The problem is: I the comment length...
16
by: Dany | last post by:
Our web service was working fine until we installed .net Framework 1.1 service pack 1. Uninstalling SP1 is not an option because our largest customer says service packs marked as "critical" by...
2
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was...
2
by: svbc | last post by:
Hi, I am facing a problem with refreshing parent: Parent window : A From A I am opening a child window B using...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...

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.