hello,
i am trying to create a request form using asp.net where when a user selects a checkbox, a dropdown should appear dynamically. I have seen few java-scripts in web, but I was wondering if I can achieve this without java-script.
I tried to make the control invisible(<asp: DropDownList ID="DropDownLis t1" runat="server" AppendDataBound Items="True" Visible="False">) and in the onselectedindex changed event, tried to make the invisible property to true. But it did not help me.
Also, I was trying to use postback for the page when a checkbox is selected(asp:Ch eckBoxList ID="chckbx" runat="server" AutoPostBack="t rue" onselectedindex changed="chckbx _SelectedIndexC hanged") and it throws me an error in IE saying the object does not support this property.
Can somebody please help me with this. Thanks in advance.
Dec 7 '09
27 7929 - function window_open()
-
{
-
window.open("Codes.aspx","","menubar=no,status=no,scrollbars=yes,resizable=yes,toolbar=no,top=180,left=250,width=750,height=600");
-
}
the ap.net control that calls it, - <asp:Button runat="server" ID="btnlookup" Text="Code" OnClientClick="window_open()" CausesValidation="false" Width="90px" />
Frinavale 9,735
Recognized Expert Moderator Expert
I don't see anything wrong with this JavaScript.
I'm going to ask that a JavaScript expert take a look at this.
Does this problem prevent your code from being executed?
If so, could you remove it while we are fixing your current problem with dynamically populating the DropDownList?
-Frinny
Dormilich 8,658
Recognized Expert Moderator Expert
I'm going to ask that a JavaScript expert take a look at this.
I can’t find anything wrong, works as expected when inserted in plain text HTML.
my page executes normally. but I just wanted to get rid of the error and also wanted to postback the page when I check the checkbox.
Frinavale 9,735
Recognized Expert Moderator Expert
Well enable autopostback for the checkbox.
Put a break point on the method that handles the event and run the application.
Do you hit the break point?
-Frinny
ah..it does not hit the breakpoint. and the script error is displayed only when I try to check the checkbox, not when the page loads.
Frinavale 9,735
Recognized Expert Moderator Expert
Okay, it sounds like the JavaScript that preforms the AutoPostback is not working.
I don't know why this would be the case. The only thing that I can think of is that your JavaScript is somehow invalid (maybe you didn't close the <script> tag?) But your JavaScript looks fine.
Try removing your JavaScript from the page.
Do you get the same error?
What web browser are you using? What version is it?
Are you using Ajax?
If so are you using any Ajax enabled controls?
These may be causing a problem...
-Frinny
Hi Frinny
Thank you for your quick responses.
I did try to remove the javascript from the page. it still gives me the error. I am currently using IE7 and I do not have any ajax controls.
I did try to create a new checkbox list and even that gives me the same error.
I created a new page and could figure out the how to create a dropdown when a checkbox is selected. It works fine. But my original page still has the error for the autopostback.
Your help is greatly appreciated.
Thank you...
Frinavale 9,735
Recognized Expert Moderator Expert
It's too bad that you were having such a hard time with your original page.
At least the error isn't happening on your new aspx page.
So, in the method that handles the AutoPostback for the CheckBoxList (list??) you need to create list items for your DropDownList based on what was checked/selected.
(I'm not sure what language you're using.)
There are two ways to do this. You can create generate ListItem objects and add them to your DropDownList's "Items" property. Or you can bind your DropDownList to a data source.
-Frinny
yeah. I did use the items property to make my dropdowns work and it works fine, but still could not figure out what is wrong with original page.
Anyway thanks a lot for your help and support.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: DotNetJunky |
last post by:
I have built a control that runs an on-line help system. Depending on the
category you selected via dropdownlist, it goes out and gets the child
subcategories, and if there are any, adds a new dropdownlist to the screen
for selection. This continues until there are no children, and then it
checks for a help article list based on that last selection and displays
actual articles for display.
Adding the controls and getting everything...
|
by: theo |
last post by:
Hello..I have a similar issue as yesterday but the situation has
slightly changed so perhaps someone can shed some more light on the
issue...
Program flow - load file,extract xml text tags from file,then depending
on the number of Xml tags retrieved from the file determines the number
of dropdownlist controls instanciated in the placeholder,the user
selects the required tags from the
dropdownlists (if 5 Xml tags,then 5 dropdownlists...
|
by: Thomas Due |
last post by:
Hello,
I am in the process of making my asp.net form to validate as xhtml 1.0
strict. So far I am doing well, but now I have a problem. The problem
concerns specifically DropDownList and ListBox, but other controls
might result in the same problem.
When AutoPostBack is enabled on these controls, two hidden input fields
are created on the form (__EVENTTARGET and __EVENTARGUMENT),
furthermore a "postback" javascript is embedded, this...
|
by: Daniel |
last post by:
Is there any other way can override this event, like javascript onchange
added to the attribute of this dropdownlist?
Thanks
|
by: bryanp10 |
last post by:
I have a page that is almost entirely dynamically created. Textboxes
and checkbox are working fine, firing events, and persistent their
state. DropDownList is giving me a major headache.
All my controls are created in CreateChildControls() for my custom
control. Here's a snippet of code:
DropDownList dd = new DropDownList();
dd.ID = "DropDown1";
if( !Page.IsPostBack )
| |
by: Wim |
last post by:
Hi Everyone,
I'm trying to speed up a Asp.net 1.1 applications' performance. The
application needs to run in an environment with little bandwith and
therefore pagesizes and roundtrip times shoud be brought back to a
minimum.
The application suffered from relatively large screens. A typical aspx
page was 500 Kbyte so page load times were in the order of 40 - 50
seconds. After unsufficient loading improvement using .net caching
|
by: Santosh |
last post by:
Dear all ,
i am writting following code.
if(Page.IsPostBack==false)
{
try
{
BindSectionDropDownlist();
|
by: eurorscg |
last post by:
Hi,
i have this dropdownlist that breaks xhtml w3c validation.because it
generates a select tag with a javascript property. this only happens
when autopostback is set to true.
so the the validation error that i get is this:
# Error Line 263 column 86: there is no attribute "language".
|
by: asmx126453 |
last post by:
Hey mensen
I am having some big troubles here i tryd solving it myself with internet for 2 days but i kind fix it.
Its about this i have a DotNet project that alrydi is online and working for almost everything.
but it whas made in Visual Studio 7 and i converted it to 2005. in version 7 it works almost perfect but in 2005 i am having some errors.
becase all the code i am using is very long i am trying to post the nesecery code only if...
|
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
| |
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 launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| | |