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 !.......


Deepak RawatRank #646 · 3.7K reputationPosted Jul 3, 2023, 6:08 AM EDT
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.Sachin SinghRank #66 · 26.2K reputationPosted Jul 3, 2023, 8:22 AM EDT
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 MohantyRank #112 · 20K reputationPosted Jul 3, 2023, 6:40 AM EDT
Add the below code to your script and try:
$(function () { //Initialize Select2 Elements $('.select2').select2(); $('.select2bs4').select2({ theme: 'bootstrap4' }); });Jaya PrakashRank #1,293 · 1.3K reputationPosted Jul 19, 2023, 5:16 AM EDT
function fnprint() { var trid = document.getElementById(""); window.open("../DMTReceipt.aspx?TransID=" + trid.value, "myWindow", "status = 1, height = 900, width = 900, resizable = 0"); return false; } function fngotoDMT() { location.href = 'SendMoney.aspx'; return false; } function fnDashboard() { location.href = 'Dashboard.aspx'; return false; }Cr BhargaviRank #420 · 5.9K reputationPosted Sep 20, 2023, 12:14 PM EDT
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.