This should be easy,
How do I reload a page so that it makes the server think it's the first
time the page has been loaded?
Thanks 10 1651
Servers don't think.
What are you trying to accomplish?
--
I hope this helps,
Steve C. Orr, MCSD, MVP http://SteveOrr.net
<ri**********@hotmail.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com... This should be easy,
How do I reload a page so that it makes the server think it's the first time the page has been loaded?
Thanks
how ? do you want do reload and try to hidde this from the server ?
you mean, the page can reload just one time ? next time doesn't count, not ?
you can create a variable of int type = 0 and when reload i++
page_load event
int i = 0;
if (i > 1) //0 is the first time and 1 ist the second time{
do nothing
}else{
do your code
i++;
}
I don't know if it gonna work, but try...and i also don't know if that's the
best way!
see ya!
--
Atenciosamente,
Daniel Groh
CTF Technologies do Brasil Ltda.
Analista Programador
Fone: 11 3837-4203
E-mail: dg***@ctf.com.br
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> escreveu na mensagem
news:OW**************@TK2MSFTNGP15.phx.gbl... Servers don't think. What are you trying to accomplish?
-- I hope this helps, Steve C. Orr, MCSD, MVP http://SteveOrr.net
<ri**********@hotmail.com> wrote in message news:11*********************@z14g2000cwz.googlegro ups.com... This should be easy,
How do I reload a page so that it makes the server think it's the first time the page has been loaded?
Thanks
I have a bunch of Grids on a page that have their CurrentPageIndex set
at various positions. If a user reloads the page so that smaller
datasets come back those page sizes are still the same and are causing
errors. I simply need to clear the CurrentPageIndex and then reload
the page.
Make sense?
No, still doesn't make much sense.
What is CurrentPageIndex? Is that a variable of yours where are you storing
it?
So the only thing you're trying to accomplish is to clear CurrentPageIndex?
Or you have a some kind of a page or grid sizing problem?
Please be a little more specific.
--
I hope this helps,
Steve C. Orr, MCSD, MVP http://SteveOrr.net
<ri**********@hotmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com... I have a bunch of Grids on a page that have their CurrentPageIndex set at various positions. If a user reloads the page so that smaller datasets come back those page sizes are still the same and are causing errors. I simply need to clear the CurrentPageIndex and then reload the page.
Make sense?
Ok,
Here is what is happening.
1. I have a page with a datagrid. This datagrid enables paging which
is accomplished through the following line of code:
grdADData.CurrentPageIndex = e.NewPageIndex (this happens in the
Grid's PageIndexChanged event)
2. Now lets assume that when my grid is originally bound to a dataset,
it's a very large dataset so the user could likely page through it a
lot. To be more specific, let's say they page to the end. That grid
now holds a number reprenting how many pages it has iterated
over...remember, we are talking paging, not pages in the .aspx sense.
That page value is in the CurrentPageIndex property.
3. Now let's say the user wants to load that grid again with different
data, only this time there is a much smaller dataset. When Databind is
called, an error is thrown because the new dataset doesn't have as many
pages to go through so the index of the CurrentPageIndex is out of
bounds.
4. So, what needs to happen is that I need to do is clear that grid's
CurrentPageIndex should the user databind to a smaller dataset than the
one they had been paging through before.
5. At this point I realize that this is tedious.
6. The easiest way around this seems to me to just simply set the
CurrentPageIndex to 0 in an error handler and then reload the page. I
realize that I may not need the server to think it's the first load, I
just want to reload the page.
Hope that helps
Thanks for looking at this
You could use Response.Redirect("yourpagename.aspx"), though I'm sure
there's a better solution than this.
Mun
--
Munsifali Rashid http://www.munit.co.uk/blog/
<ri**********@hotmail.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com... This should be easy,
How do I reload a page so that it makes the server think it's the first time the page has been loaded?
Thanks
I think you just want a Response.Redirect(Request.Path)
-Brock
DevelopMentor http://staff.develop.com/ballen This should be easy,
How do I reload a page so that it makes the server think it's the first time the page has been loaded?
Thanks
Hello Riversmith -
If I understand your problem correctly, the following may be of help:
Private Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal
e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
dgDataGrid1.CurrentPageIndex = 0
FillDataGrid()
End Sub
Sub FillDataGrid()
'This is where you do the connection and dataset stuff to fill the grid
from the item selected in the DropDownList
End Sub
Sub NewPage(sender as Object, e As DataGridPageChangedEventArgs)
dgDataGrid1.CurrentPageIndex = e.NewPageIndex
FillDataGrid()
dgDataGrid1.DataBind
End Sub
Sandy
"ri**********@hotmail.com" wrote: Ok,
Here is what is happening.
1. I have a page with a datagrid. This datagrid enables paging which is accomplished through the following line of code: grdADData.CurrentPageIndex = e.NewPageIndex (this happens in the Grid's PageIndexChanged event)
2. Now lets assume that when my grid is originally bound to a dataset, it's a very large dataset so the user could likely page through it a lot. To be more specific, let's say they page to the end. That grid now holds a number reprenting how many pages it has iterated over...remember, we are talking paging, not pages in the .aspx sense. That page value is in the CurrentPageIndex property.
3. Now let's say the user wants to load that grid again with different data, only this time there is a much smaller dataset. When Databind is called, an error is thrown because the new dataset doesn't have as many pages to go through so the index of the CurrentPageIndex is out of bounds.
4. So, what needs to happen is that I need to do is clear that grid's CurrentPageIndex should the user databind to a smaller dataset than the one they had been paging through before.
5. At this point I realize that this is tedious.
6. The easiest way around this seems to me to just simply set the CurrentPageIndex to 0 in an error handler and then reload the page. I realize that I may not need the server to think it's the first load, I just want to reload the page.
Hope that helps
Thanks for looking at this
Duh,
Thank you Sandy for reminding me to look in the most obvious place for
an answer first! This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: David MacQuigg |
last post by:
I'm going to be teaching EEs some basic Python using the first few
chapters of Learning Python, 2nd ed. by Mark Lutz. The discussion on
Reloading Modules starting on page 266 is confusing and I...
|
by: Cooper |
last post by:
Hello,
is possible to disable the reload (or update, for ie) of the a web page? If
yes, what i do? Otherwise if isn't possible, what i do for to set the
default value of a form when a user do a...
|
by: sentinel |
last post by:
Hi all,
I'm trying to reload a frame from a pop-up, but really cannot figure
this out.
Within my index.htm file, I make a link to call a pop-up frame with a
javascript function that calls the...
|
by: Darren |
last post by:
I have a page that opens a popup window and within the window, some databse
info is submitted and the window closes. It then refreshes the original
window using window.opener.location.reload(). ...
|
by: N. Demos |
last post by:
Hello,
I'm learning ASP.NET, and am having a strange problem with some example
code from the book I'm using. The code increments and displays the value
stored in a session variable when the "Add"...
|
by: fh |
last post by:
hello!
I 've a found way to reload my page automatically every n seconde using
this code
Response.AppendHeader("Refresh", "4");
it works fine but I wish to do the same with only a part of my...
|
by: T. Wintershoven |
last post by:
Hi all,
Is there a simple way in php to reload a page coded within an if
statement.(see code below)
It's very important that the session stays intact.
The filename is RCStudent.php
...
|
by: Max |
last post by:
Is it possible to reload a web page on user browser when an event occurs at
server side?
For example when user A places an order, user B should be notified of that
and should see that order on his...
|
by: ericisjusteric |
last post by:
I have a page with multiple iframes and need to have the user (ie6) be able to click a button to refresh any one of the iframes - but also to click another button at the top of the page to refresh...
|
by: =?Utf-8?B?UGF1bA==?= |
last post by:
Hi I tried a google search but could not find anything. I am trying to cause
one webpage to reload when a second web page is closed. The second webpage
loads data into a session variable and when...
|
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$) {
}
...
|
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...
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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: 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...
| |