473,325 Members | 2,480 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,325 software developers and data experts.

URL Refresh Problem on .NET aspx page

Hi all,

I have an aspx page that opens with some parameter (mypage.aspx?idclient=1).
Next, I have a dropdown list on this page that lets select the new value of
parameter idclient. Than I just want to reload the same page with the new
parameter:

response.redirect(mypage.aspx?idclient=" +
mydropdownlist.SelectedValue.ToString)

that makes refresh the page avec "?idclient=2" (for exemple)

Everything is going well, except a little thing: in the URL address of t he
page it is steel shown the old address with old value of parameter idclient
("mypage.aspx?idclient=1"). That means if user clicks on internet explorer
"Refresh button" the page will be re-generated with an old parameter!

Could you advise me how could I change not only the page but also the URL
address to be corresponding to new parameter value?

Thank you very much in advance for code exemple,

Anna

Nov 7 '06 #1
4 1860
Hi,

Anna S wrote:
I have an aspx page that opens with some parameter (mypage.aspx?idclient=1).
Next, I have a dropdown list on this page that lets select the new value of
parameter idclient. Than I just want to reload the same page with the new
parameter:

response.redirect(mypage.aspx?idclient=" +
mydropdownlist.SelectedValue.ToString)

that makes refresh the page avec "?idclient=2" (for exemple)

Everything is going well, except a little thing: in the URL address of t he
page it is steel shown the old address with old value of parameter idclient
("mypage.aspx?idclient=1"). That means if user clicks on internet explorer
"Refresh button" the page will be re-generated with an old parameter!

Could you advise me how could I change not only the page but also the URL
address to be corresponding to new parameter value?
you'll need to set your DropDownList's ViewState-property to <False>.

Cheers,
Olaf
--
My .02: www.Resources.IntuiDev.com
Nov 7 '06 #2
Thank you for response, but it does not solve the problem : the
SelectedIndexChanged event is not even raised for dropdownlist ...
"Olaf Rabbachin" wrote:
Hi,

Anna S wrote:
I have an aspx page that opens with some parameter (mypage.aspx?idclient=1).
Next, I have a dropdown list on this page that lets select the new value of
parameter idclient. Than I just want to reload the same page with the new
parameter:

response.redirect(mypage.aspx?idclient=" +
mydropdownlist.SelectedValue.ToString)

that makes refresh the page avec "?idclient=2" (for exemple)

Everything is going well, except a little thing: in the URL address of t he
page it is steel shown the old address with old value of parameter idclient
("mypage.aspx?idclient=1"). That means if user clicks on internet explorer
"Refresh button" the page will be re-generated with an old parameter!

Could you advise me how could I change not only the page but also the URL
address to be corresponding to new parameter value?

you'll need to set your DropDownList's ViewState-property to <False>.

Cheers,
Olaf
--
My .02: www.Resources.IntuiDev.com
Nov 8 '06 #3
Salut Anna,

Anna S wrote:
Thank you for response, but it does not solve the problem : the
SelectedIndexChanged event is not even raised for dropdownlist ...
did you set the DDL's AutoPostback-property to <True>? I repro'ed your
scenario here and it worked like a charm, but the forementioned property
will have to be set as well in order for the control to fire its
SelectedIndexChanged-event right away.
That is, a page that will load its data according to an ID that's being
taken from the QueryString while the DDL on that same page itself causes
the page to reload using the SelectedValue-portion of the DDL, passed on by
means of the QueryString again. Does that reflect your scenario ..?

Cheers,
Olaf
--
My .02: www.Resources.IntuiDev.com
Nov 8 '06 #4
Hi Olaf,

Thank you very much of thinking about my problem.

The "AutoPostback" property was set to true... You are right as for
scenario, but
meanwhile I understood the reason of the problem : that comes from
"response.redirect" method. So, it redirects without refershing of url of
page. Then I replaced this method with the javascript that just recall the
same page as follows :

MyJavascript = "<script language=JavaScript>top.location=" & """" &
"frameset.aspx?idclient=" & mydropdownlilst.SelectedValue.ToString
& "&client=" & mydropdownlist.SelectedItem.Text &
"&contentpage=blank.htm" & """" & "</script>"

Than the javascript is executing as follows :

If (Not IsClientScriptBlockRegistered("clientScript")) Then
Page.RegisterStartupScript("clientScript", MyJavascript)
End If

And that just works..
Best Regards,

Anna


"Olaf Rabbachin" wrote:
Salut Anna,

Anna S wrote:
Thank you for response, but it does not solve the problem : the
SelectedIndexChanged event is not even raised for dropdownlist ...

did you set the DDL's AutoPostback-property to <True>? I repro'ed your
scenario here and it worked like a charm, but the forementioned property
will have to be set as well in order for the control to fire its
SelectedIndexChanged-event right away.
That is, a page that will load its data according to an ID that's being
taken from the QueryString while the DDL on that same page itself causes
the page to reload using the SelectedValue-portion of the DDL, passed on by
means of the QueryString again. Does that reflect your scenario ..?

Cheers,
Olaf
--
My .02: www.Resources.IntuiDev.com
Nov 9 '06 #5

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

Similar topics

4
by: Andrew Alger | last post by:
ok i have two forms. Customer.aspx and Parent_Searh.aspx. There is a button on Customer.aspx that when executed runs javascript code to open up parent_search as a popup. After the user searches...
2
by: Jeronimo Bertran | last post by:
Hi, I have a page with a very data intensive grid which needs to be automatically refreshed constantly if a change is detected. In order to not refresh the complete page so often, I created an...
8
by: Judy Ward | last post by:
I have an index.aspx with frames. The top frame has a navigation bar with a "Login" hyperlink. If the user has already logged in I want this link to change to "Logout". I am using forms-based...
2
by: Just D. | last post by:
All, How should we refresh the current aspx frame? I disabled caching using this command on Page_Load(): Response.Cache.SetCacheability(HttpCacheability.NoCache); but it didn't help. The...
5
by: Peter | last post by:
1) I have a C# web application and what I am trying to do is create a popup window from a link on the parent window 2) the popup window will have a button and when a user clicks on the button the...
1
by: IkBenHet | last post by:
Hello, Currently I am using a large input form on a website that is based on ASP and JavaScript. Depending on the values that are filled in by the user the forms does a refresh and makes...
3
by: Kevin | last post by:
Hi guys, I want to refresh some pages every 2 seconds. however, these html pages are not in my site, they could be any pages from yahoo.com or msn.com. I can create a page, which redirect to...
2
by: Charles A. Lackman | last post by:
Hello, I have an ASPX page that is storing data into a session Variable: Session("Name") = "Chuck" When the User clicks "Next" on the page, it naviages to "Details.aspx", Details.aspx has two...
5
by: =?Utf-8?B?Sm9obg==?= | last post by:
Hi, I used the following code to refresh the parent page, and it works very well (Thanks to Peter Bromberg "). Response.Write("<script language='javascript' type='text/javascript'{...
7
by: seanmatthewwalsh | last post by:
Hi I have a page (default.aspx) that pulls it's HTML from a database. I then have a "content management" page (editpage.aspx) that allows the user to edit the HTML in the database. When the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.