{"id":1370,"date":"2022-08-30T15:15:58","date_gmt":"2022-08-30T15:15:58","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/15\/bootstrap-modal-popup-not-working-properly-in-aspx-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:15:58","modified_gmt":"2022-08-30T15:15:58","slug":"bootstrap-modal-popup-not-working-properly-in-aspx-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/bootstrap-modal-popup-not-working-properly-in-aspx-collection-of-common-programming-errors\/","title":{"rendered":"Bootstrap modal popup not working properly in aspx-Collection of common programming errors"},"content":{"rendered":"<p>i have this button B1 (say) when i click on this B1 a modal popup appears with buttons \/ links<\/p>\n<p>when i click the button \/ link a new popup <strong>should<\/strong> appear but i dont get the Modal window but i do get the values in <code>firebug<\/code><\/p>\n<p>Here is the code to the Button B1<\/p>\n<pre><code><img decoding=\"async\" src=\"..\/Images\/pix\/B1.png\" href=\"#B1Market\" data-toggle=\"modal\" \/> \n<\/code><\/pre>\n<p>which then calls this modal popup which contains the content from the div <code>divB1Market<\/code><\/p>\n<pre><code>\n\n    \n        \n        \u00d7\n        <\/code><\/pre>\n<h3><code>Heading<\/code><\/h3>\n<pre>\n          \n        \n        \n        \n        \n        Done\n        \n    \n\n<\/pre>\n<p><code>The code below is the link \/ content inside the <code>divB1Market<\/code><\/code><\/p>\n<pre><code>Link here\n<\/code><\/pre>\n<p>which inturn calls the ajax call<\/p>\n<pre><code>PlayerMP.getFunctionDetails = function (type, UserID, SessionID, SessionNo) {\n$.ajax({\n    type: \"GET\",\n    url: PlayerMP.URL,\n    data: \"rt=4&amp;type=\" + type + \"&amp;UserID=\" + UserID + \"&amp;SessionID=\" + SessionID + \"&amp;SessionNo=\" + SessionNo,\n    success: function (FinancialSplitsJS) {\n        if (FunctionalSplitsJS.indexOf(\"SessionExpired=1\", 0) == -1) {\n\n            $(\"#divFunctionalDetails\").html(FunctionalSplitsJS);\n            switch (type) {\n                case 1:\n                    $(\"#divFunctionalsSplit\"); \n                    break;\n                            }                \n\n                    $(\"#divFunctionalsSplit\").show();        \/* calling the div with this id in the aspx page *\/\n        }\n        else\n            window.location.href = \"..\/Login.aspx?SessionExpired=1\";\n    }\n});}\n<\/code><\/pre>\n<p>This is the modal-popup content in the aspx page<\/p>\n<pre><code>  \n        \n            \n                  \n                        <\/code><\/pre>\n<h3><code>Content<\/code><\/h3>\n<pre>      \n                   \n                  \n                    \n                   \n            \n        \n    \n<\/pre>\n<p><code>This is what i get when i openup firebug and hover around with my cursor<\/code><\/p>\n<p><code><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/QPTaV.jpg\" \/><\/code><\/p>\n<p><code>But when i try to debug the code with firebug i get the responses (in the console) perfectly. I'm not able to figure out where the error might be.<\/code><\/p>\n<p><code>This is the order of my importing the packages (posted this because i got this error while using )<\/code><\/p>\n<pre><code><code>$(\"#divFunctionalsSplit\").modal().show();\n<\/code><\/code><\/pre>\n<p><code>Uncaught TypeError: Object # has no method 'modal'<\/code><\/p>\n<pre><code>\n\n\n\n<\/code><\/pre>\n<ol>\n<li>\n<p>All I needed to add was <code>jQuery.noConflict();<\/code> before <code>$('#divID').modal('show')<\/code> it had to something to do with with other plugins conflicting.<\/p>\n<\/li>\n<li>\n<p>It would appear that the id of your modal is getting overwritten by ASP. It changes from #B1Market to #divFunctionalSplit. I assume your button still has an href of #B1Market. Simple solution would be to change the href to match the div id. Better solution would be to prevent ASP from replacing the id.<\/p>\n<\/li>\n<\/ol>\n<p id=\"rop\"><small>Originally posted 2013-11-15 02:45:53. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>i have this button B1 (say) when i click on this B1 a modal popup appears with buttons \/ links when i click the button \/ link a new popup should appear but i dont get the Modal window but i do get the values in firebug Here is the code to the Button B1 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1370","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1370","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1370"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1370\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1370"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1370"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1370"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}