Hello friends....when I am click on Edit button in Gridtable,It will displays the Popup window with specific values in textboxes and dropdowns using Jquery in asp.net application ..but Values are not effected in Dropdown..why..?..it will displaying first value like "Select" ..why..please answer me...Code and image shown below
My code is:
window.operateEvents = {
'click .edit': function (e, value, row, index) {
//alert('You click edit icon, row: ' + JSON.stringify(row));
var region = {};
region.RegionID = row.RegionID
$('#lblvalidmsg').hide();
$("#<%=ddlCountry.ClientID%> option[value='" + row.CountryID + "']").attr('selected', 'selected');
$('#<%=txtRegionName.ClientID%>').val(row.RegionName);
$('#<%=txtRegionCode.ClientID%>').val(row.RegionCode);
$('#<%=txtContactAddress.ClientID%>').val(row.ContactAddress);
$("#dialog2").dialog({
title: "Region",
width: 600,
height: 550,
modal: false,
resizable: false,
appendTo: 'form',
buttons: {
Update: function () {
$("[id*=btnupdate]").click()
region.RegionID = row.RegionID;
region.RegionName = $("[id*=txtRegionName]").val();
region.RegionCode = $("[id*=txtRegionCode]").val();
region.ContactAddress = $("[id*=txtContactAddress]").val();
region.CountryID = $("[id*=ddlCountry]").val();
debugger;
if(region.RegionName==='' || region.RegionCode==='' || region.ContactAddress==='' || region.CountryID<=0)
{
$('#lblvalidmsg').show();
$('#lblvalidmsg').html("Please Enter all Mandatory fields");
}
else
{
$.ajax({
type: "POST",
url: "Region.aspx/updateRegion",
data: '{region: ' + JSON.stringify(region) + '}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response) {
alert("Region has been Update successfully.");
window.location.reload();
}
});
}

Rajeesh MenothRank #118 · 18.4K reputationPosted Jul 30, 2015, 9:15 PM EDT
Raja TRank #685 · 3.5K reputationPosted Jul 30, 2015, 9:28 PM EDT
Chandrakanth M53 reputationPosted Aug 2, 2015, 7:03 AM EDT
Chandrakanth M53 reputationPosted Aug 2, 2015, 7:06 AM EDT
Raja TRank #685 · 3.5K reputationPosted Aug 3, 2015, 1:29 AM EDT