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

Refresh Not Happening

I have an aspx page on which I trap a change in the selected radiobutton in
a radiobuttonlist. In that event code, I change the visibility of some
controls based on what button was selected. The change to the objects made
in that routine does not take effect until the user clicks on another
control (button or such)

How can I get those changes to be immediately visible? I don't see anything
like a Refresh?

TIA

Wayne
Nov 19 '05 #1
6 1473
Solution 1:

You need to register a javascript function for the onclick and onchange
events.

Example:

<asp:radiobuttonlist id="RadioList1" onclick="RadioList1_Click();"
onchange="RadioList1_Click();" RepeatColumns="2" RepeatLayout="Flow"
Runat="server">

In the 'RadioList1_Click' function you can then set the style.display
value to ' ' or 'none' for the controls you want to display.

Solution 2:
If you rather do this on the server side then you will need a post back
and you can just call Response.Redirect to refresh the page.

David Barkol
www.neudesic.com

Nov 19 '05 #2
> Solution 2:
If you rather do this on the server side then you will need a post back
and you can just call Response.Redirect to refresh the page.


Soultion 3:

In your class you declare a bool eg. HideMyElements = false;

In your event handler for the radiobutton list you set HideMyElements =
true;

Now the essential part. You can still manage to get your update with the
request if you declare

protected override OnPreRender(......)
{
if(HideMyElements )
{
control.visible = false;
}
}

Hope I undestood your question

Regards
Anders Jacobsen
Nov 19 '05 #3
Thanks guys. I plan to experiment with a couple of those suggestions to see
if I understand them I have very little javascript knowledge so this will be
a chance to try out some things.

Wayne

"David Barkol" <da**********@neudesic.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Solution 1:

You need to register a javascript function for the onclick and onchange
events.

Example:

<asp:radiobuttonlist id="RadioList1" onclick="RadioList1_Click();"
onchange="RadioList1_Click();" RepeatColumns="2" RepeatLayout="Flow"
Runat="server">

In the 'RadioList1_Click' function you can then set the style.display
value to ' ' or 'none' for the controls you want to display.

Solution 2:
If you rather do this on the server side then you will need a post back
and you can just call Response.Redirect to refresh the page.

David Barkol
www.neudesic.com

Nov 19 '05 #4
David;

I tried to apply the suggestion to register the JavaScript function but the
"onclick" and "onchange" clauses get flagged as "could not find any onclick
attribute for radiobuttonlist?

Wayne

"David Barkol" <da**********@neudesic.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Solution 1:

You need to register a javascript function for the onclick and onchange
events.

Example:

<asp:radiobuttonlist id="RadioList1" onclick="RadioList1_Click();"
onchange="RadioList1_Click();" RepeatColumns="2" RepeatLayout="Flow"
Runat="server">

In the 'RadioList1_Click' function you can then set the style.display
value to ' ' or 'none' for the controls you want to display.

Solution 2:
If you rather do this on the server side then you will need a post back
and you can just call Response.Redirect to refresh the page.

David Barkol
www.neudesic.com

Nov 19 '05 #5

Wayne Wengert wrote:
David;

I tried to apply the suggestion to register the JavaScript function but the "onclick" and "onchange" clauses get flagged as "could not find any onclick attribute for radiobuttonlist?

Wayne


Don't worry about the flag, it will work. Throw an alert up in the
function to confirm.

- David

Nov 19 '05 #6
Thanks - that helps!

Wayne

"David Barkol" <da**********@neudesic.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...

Wayne Wengert wrote:
David;

I tried to apply the suggestion to register the JavaScript function

but the
"onclick" and "onchange" clauses get flagged as "could not find any

onclick
attribute for radiobuttonlist?

Wayne


Don't worry about the flag, it will work. Throw an alert up in the
function to confirm.

- David

Nov 19 '05 #7

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

Similar topics

1
by: Bilal | last post by:
Hi, I'm a complete beginner in Javascript and php ... so forgive me for asking an easy/simple solution to the following problem: I'm developing an application that involves multi-screen in...
1
by: Gary W | last post by:
Hello, I have a page, thanks.asp which uses classic ASP VBSCRIPT & CDONTS to send mail, for example: <% Set bc = Server.CreateObject("MSWC.BrowserType") Set objMessage =...
10
by: tasmisr | last post by:
This is an old problem,, but I never had it so bad like this before,, the events are refiring when clicking the Browser refresh button. In the Submit button in my webform, I capture the server side...
3
by: Sameer | last post by:
I have a webpage that has a link button. This link button on click opens up a new page. This is what is happening: 1. Load the web page. 2. Click on the link. 3. Refresh the web-page. Result:...
17
by: SamSpade | last post by:
picDocument is a picturebox When I do picDocument.Invalidate() the box paints. But if instead I do picDocument.Refresh() the box does not paint. What does Refresh do. I guessed it did an...
9
by: Mr Newbie | last post by:
Before someone flames me, I know this is the VB.NET groups, nonetheless, the asp.net guys seems to have almost disapeared from the aspnet groups so I thought I would ask this here. I have a...
1
by: J055 | last post by:
Hi I have a GridView which includes the ability to delete rows. This works fine accept for when a naughty user decides to refresh the browser thereby posting the same delete command instruction....
3
by: Ned Balzer | last post by:
Hi all, I posted this question some time ago in an earlier thread but so far I still don't have an understanding of why this is happening or what I can do to fix it. I use Session variables,...
9
by: Navaneet | last post by:
Hi, Can anyone tell me how to prevent some particular POST DATA when refresh button (F5) clicked on server side(vb.net). Thanks Kumar N
3
by: =?Utf-8?B?cm9kY2hhcg==?= | last post by:
hi all, i betcha here's a question never asked before ;) i have a simple web form with a gridview and a button. the button doesn't do anything but a postback. i load up the gridview from the...
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: 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?
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
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
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.