Solved

Ajax Page Methods accessing Dropdown inside a gridview

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Json and ajax 1 23
Compute age Html 2 27
make control visible based off other control value 7 22
Put javascript to get dropdown value 3 22
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
This article discusses how to implement server side field validation and display customized error messages to the client.
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…

726 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