Solved

Ajax Page Methods accessing Dropdown inside a gridview

Posted on 2009-05-06
1
691 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
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…

758 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now