TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Chandrakanth M
NA
21
12.3k
How to shows selected option in dropdown in a popup window.?
Jul 30 2015 2:02 PM
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();
}
});
}
Reply
Answers (
5
)
using captcha.Mvc.Mvc4 but image not display.
Export nested gridview