473,516 Members | 3,064 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Javascript in ASP.net page

I have 2 .net radio buttons on my page.

When the user clicks a button I want to change the contents/source of a drop
down box on my page without doing the round trip to the server.

E.g.

If radio button 1 clicked then
call poDropDown1()
else
call dropdown2()
End if

Can anyone point me in the right direction ?
The dropdown must be populated from 1 or other of the .net methods.

Thanks in Advance

Nov 18 '05 #1
2 781
you could potentially write your own javascript and add it to the page using
Page.RegisterClientScriptBlock

you can either hardcode the onClick="javascript:myfunc();" in your aspx
page...
or you can user
chkOpt1.attributes.Add("onClick", "javascript:myfunc();"); to the same
effect from code behind

HTH

--

Regards,

HD
"Poppy" <pa**********@NOSPAMthemedialounge.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
I have 2 .net radio buttons on my page.

When the user clicks a button I want to change the contents/source of a drop down box on my page without doing the round trip to the server.

E.g.

If radio button 1 clicked then
call poDropDown1()
else
call dropdown2()
End if

Can anyone point me in the right direction ?
The dropdown must be populated from 1 or other of the .net methods.

Thanks in Advance

Nov 18 '05 #2
You can certainly do this with JavaScript. However, you should be aware that
because of ViewState issues, changing the contents of a drop-down Server
Control on the client side without doing a PostBack may cause some
unexpected results/issues.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Poppy" <pa**********@NOSPAMthemedialounge.com> wrote in message
news:#G**************@TK2MSFTNGP11.phx.gbl...
I have 2 .net radio buttons on my page.

When the user clicks a button I want to change the contents/source of a drop down box on my page without doing the round trip to the server.

E.g.

If radio button 1 clicked then
call poDropDown1()
else
call dropdown2()
End if

Can anyone point me in the right direction ?
The dropdown must be populated from 1 or other of the .net methods.

Thanks in Advance

Nov 18 '05 #3

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

Similar topics

0
7276
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...
0
7182
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...
0
7408
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. ...
0
7581
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...
0
7548
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5714
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...
0
4773
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...
0
3259
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
825
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.