You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Code i have used to bind the value for the dropdown
For ddlSubProgramName Dropdown:
using (Programs programs = new Programs())
{
dtSubProgram = programs.SubProgramName_SelectActive();
ddlSubProgramName.Items.Clear();
foreach (DataRow dr in dtSubProgram.Rows)
{
ddlSubProgramName.Items.Add(new ListItem(dr["SubProgramName"].ToString(), dr["Id"].ToString()));
}
}
For ddlYear Dropdown
private void LoadYear()
{
//var startYear = DateTime.Now.Year - 2;
var startYear = 2017;
var endYear = DateTime.Now.Year + 3;
for (int i = startYear; i <= endYear; i++)
{
// Now just add an entry that's the current year minus the counter
ddlYear.Items.Add(Convert.ToString(startYear));
startYear = startYear + 1;
}
ddlYear.Items.Insert(0, (new ListItem("", "-1")));
}
The Problem I am facing is the value which i select in the ddlSubProgramName dropdown is not persisted on AJAX postback.
But ddlYear dropdown is persisting the value which i selected on AJAX postback.
i have made same implementation for both ddlSubProgramName and ddlYear dropdown. but ddlYear dropdown is persisting the value in the postback. and ddlSubProgramName is not persisting the value in the postback.
Please guide me to resolve this issue.
Thanks in Advance.
The text was updated successfully, but these errors were encountered:
Guys,
I have implemented editable select for two dropdown in a page in the below manner
Dropdown Code in ASPX Page
In Javascript:
$(document).ready(function () {
$('#<%=ddlYear.ClientID%>').editableSelect({ effects: 'slide' });
$('#<%=ddlSubProgramName.ClientID%>').editableSelect({ effects: 'slide' });
});
function endRequest(sender, args) {
$('#<%=ddlYear.ClientID%>').editableSelect({ effects: 'slide' });
$('#<%=ddlSubProgramName.ClientID%>').editableSelect({ effects: 'slide' });
}
Code i have used to bind the value for the dropdown
For ddlSubProgramName Dropdown:
using (Programs programs = new Programs())
{
dtSubProgram = programs.SubProgramName_SelectActive();
ddlSubProgramName.Items.Clear();
foreach (DataRow dr in dtSubProgram.Rows)
{
ddlSubProgramName.Items.Add(new ListItem(dr["SubProgramName"].ToString(), dr["Id"].ToString()));
}
}
For ddlYear Dropdown
The Problem I am facing is the value which i select in the ddlSubProgramName dropdown is not persisted on AJAX postback.
But ddlYear dropdown is persisting the value which i selected on AJAX postback.
i have made same implementation for both ddlSubProgramName and ddlYear dropdown. but ddlYear dropdown is persisting the value in the postback. and ddlSubProgramName is not persisting the value in the postback.
Please guide me to resolve this issue.
Thanks in Advance.
The text was updated successfully, but these errors were encountered: