Solved

Ajax Page Methods accessing Dropdown inside a gridview

Posted on 2009-05-06
1
749 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Enroll in July's Course of the Month

July's Course of the Month is now available! Enroll to learn HTML5 and prepare for certification. It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

jQuery is a JavaScript library that greatly simplifies JavaScript programming. AJAX is an acronym formed from "Asynchronous JavaScript and XML."  AJAX refers to any communication between client and server, when the human client does not observe a…
Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer…
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…
Suggested Courses

631 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