<body>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<link href="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.3/css/bootstrap.min.css"
rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.3/js/bootstrap.min.js"></script>
<link href="http://cdn.rawgit.com/davidstutz/bootstrap-multiselect/master/dist/css/bootstrap-multiselect.css"
rel="stylesheet" type="text/css" />
<script src="http://cdn.rawgit.com/davidstutz/bootstrap-multiselect/master/dist/js/bootstrap-multiselect.js"
type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$('#<%= lstFruits.ClientID %>').multiselect({
includeSelectAllOption: true
});
});
</script>
<form id="form1" runat="server">
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<contenttemplate>
<asp:ListBox ID="lstFruits" runat="server" SelectionMode="Multiple">
<asp:ListItem Text="Mango" />
<asp:ListItem Text="Apple" />
<asp:ListItem Text="Banana" />
<asp:ListItem Text="Guava" />
<asp:ListItem Text="Orange" />
</contenttemplate>
<asp:Button ID="Button1" Text="Submit" runat="server" OnClick="Submit" />
</form>
</body>
CS Code :
protected void Submit(object sender, EventArgs e)
{
string message = "";
foreach (ListItem item in lstFruits.Items)
{
if (item.Selected)
{
message += item.Text + ",";
}
}
message = message.Substring(0, message.Length - 1);
ScriptManager.RegisterClientScriptBlock((sender as Control), this.GetType(), "a", "alert('" + message + "')", true);
}
From above code i placed button out from update panel then it working fine.
When i placed inside update panel,
When submit button, then drop down looking like list box from next request.
Can you please help me to come out from this issue.
Is there any possibility / shall i continue the same.
Please copy the code and try you can get more clarification.
Thanks
Its very important to me.