Hi,
you can add Option List into HTML String as
string ChoiceHtml = "";
for(var i=0;i<dataPO.Tables[2].Rows.Count;i++)
{
var valField = dataPO.Tables[2].Rows[i]["ValueField"];
var txtField = dataPO.Tables[2].Rows[i]["TextField"];
if(dataPO.Tables[2].Rows[i]["add_less"]==1)
{
ChoiceHtml += "<option selected = 'true' value="+ valField +"> " + txtField +" </option>";
}
else
{
{
ChoiceHtml += "<option value="+ valField +"> " + txtField +" </option>";
}
}
}
at the time of re select exchange "Selected" property for option , and re assign html string as
tblString.Append(" <select value='" + dataPO.Tables[2].Rows[i]["add_less"].ToString().TrimStart().TrimEnd() + "' id='ddlAddLess_Row1' TabIndex='" + (++ddlindex) + "' runat="'server'" style='width:10%;height:23px;' onkeyup='toUnicode(this,event)' class='Assettextbox'>"+ ChoiceHtml +"</select>");
tblString.Append(" ");
bindHTMLhere.InnerHtml = tblString.ToString();
Thanks