function pageLoad(sender, args) {
$("[id*=ddlBeneficiaryBank]").select2();
}
var prm = Sys.WebForms.PageRequestManager.getInstance();
if (prm != null) {
prm.add_endRequest(function (sender, e) {
if (sender._postBackSettings.panelsToUpdate != null) {
$("[id*=ddlBeneficiaryBank]").select2();
}
});
};
But Search Box is not come why Please Help !.......
5 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.

Cr BhargaviPosted Sep 20, 2023, 4:14 PM
You must be getting some JS errors, so open you page on chrome and click f12, then from console tab share us the errors you are getting.Select2 is not getting initialized properly.
Jaya PrakashPosted Jul 19, 2023, 9:16 AM
Sachin SinghPosted Jul 3, 2023, 12:22 PM
You must be getting some JS errors, so open you page on chrome and click f12, then from console tab share us the errors you are getting.
I think , you are not referencing some library on your page causing the issue, or Select2 is not getting initialized properly.
Amit MohantyPosted Jul 3, 2023, 10:40 AM
Add the below code to your script and try:
Deepak RawatPosted Jul 3, 2023, 10:08 AM
it appears that you are using the Select2 library to enhance the functionality of the DropDownList control in your ASP.NET web application. The Select2 library provides features such as search boxes, allowing users to easily search and select options from a dropdown list.
To troubleshoot why the search box is not appearing, you can try the following steps:
Ensure that you have included the necessary CSS and JavaScript files for Select2 in your web page. Make sure the file paths are correct and that the files are being loaded without any errors.
Check if the Select2 library is compatible with the version of jQuery you are using. Make sure you have included the correct version of jQuery required by Select2.
Verify that you have the latest version of the Select2 library. There might be updates or bug fixes that could resolve the issue you're experiencing.
Inspect the HTML markup generated by the DropDownList control and ensure that it matches the expected structure required by Select2. Check if the necessary CSS classes and attributes are present on the elements.
Check for any JavaScript errors in the browser's console. If there are any errors related to Select2 or other libraries, address them accordingly.
Ensure that the
pageLoadfunction is being called correctly. You can add aconsole.logstatement inside thepageLoadfunction to verify if it is being executed when the page loads or after a postback.If you are using an older version of ASP.NET WebForms, make sure that the
AutoPostBackproperty of the DropDownList control is set totrueto trigger the postback and ensure that theBank_SelectedIndexChangedevent handler is being called correctly.