Solved

Ajax Page Methods accessing Dropdown inside a gridview

Posted on 2009-05-06
1
714 Views
Last Modified: 2012-05-06
Hi Experts,

I had a dropdownlist inside a gridview, i need to know how can i get the value of dropdownlist in javascript.
i used the below... but the dropdownlist1 is inside my Gridview1.
var selectedvalue = $get("DropDownList1").value;

please help me how can i do this,,,a dropdown inside a gridview1...
<script type="text/javascript">  
     function Validate() {
   var selectedvalue = $get("DropDownListHWComponent").value;
   PageMethods.Dropdownselectunitcose(selectedvalue,OnSucceeded, OnFailed);
    }
 
function OnSucceeded(value) {
   // Dispaly "thank you."
   alert("success");
}
 
function OnFailed(error) {
   // Alert user to the error.
   alert(error.get_message());
}

Open in new window

0
Comment
Question by:Deathrace
1 Comment
 
LVL 9

Accepted Solution

by:
tetorvik earned 500 total points
ID: 24319582
the link below gives you an idea how to access dropdownlist properties with javascript
http://weblogs.asp.net/farazshahkhan/archive/2008/02/27/javascript-enable-disable-dropdown-in-gridview-using-checkboxes.aspx
0

Featured Post

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
Introduction HyperText Transfer Protocol (http://www.ietf.org/rfc/rfc2616.txt) or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question