Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Ajax Page Methods accessing Dropdown inside a gridview

Posted on 2009-05-06
1
Medium Priority
?
760 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 1500 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

[Webinar] Cloud Security

In this webinar you will learn:

-Why existing firewall and DMZ architectures are not suited for securing cloud applications
-How to make your enterprise “Cloud Ready”, and fix your aging DMZ architecture
-How to transform your enterprise and become a Cloud Enabler

Question has a verified solution.

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

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
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

971 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