Solved

Problem to Popup

Posted on 2016-10-27
2
96 Views
Last Modified: 2016-10-31
Hi,
I do not know why I cannot show the popup as expected, by these codes below. Why?
$(function () {
    $("div[id$='Panel_Msg']").dialog({
        autoOpen: false,
        autoResize: true,
        resizable: false,
        title: "Error",
        appendTo: "form"
        //open: function (event, ui) {
        //    $(this).parent().appendTo("form");		//allow .Net buttons to post back
        //}
    });

});

function closePopup0() {
    $("div[id$='Panel_Msg']").dialog("close");
}

function openPopup0() {
    $("div[id$='Panel_Msg']").dialog("open");
}
...
    <div class="right up">
    <cc1:ToolkitScriptManager runat="server"></cc1:ToolkitScriptManager>
	<asp:panel id="Panel_Msg" style="display:none;" runat="server">
		<asp:Literal id="L_Msg" runat="server"/>
		<br /><br />
        <div style="text-align:center;">
		    <asp:Button id="OKButton" OnClick="closePopupMsg" runat="server" Text="OK"/>
        </div>
	</asp:panel>
    </div>
    ...

                    L_Msg.Text = "Invalid User ID and Password have been entered or you're disallowed to access!";

                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "call", "$(function () {openPopup0();});", true);

Open in new window

The details are now being shown on the Web page but I expect that the Popup would appear while now it does not.
0
Comment
Question by:HuaMinChen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 20

Accepted Solution

by:
Daniel Van Der Werken earned 500 total points
ID: 41864175
Why are you selecting for the "ends with" type of selection?

First off, the examples I've seen and used reverse the quotes:

Try
$('div[id$="Panel_Msg"]')

Open in new window

instead of what you have.  
$("[id$=Panel_Msg]")

Open in new window

might be another option.

Second, try
$('#Panel_Msg')

Open in new window

if you're not needing the ability to just find ID's ending with.

It's just my guess that the issue is with the selector here, though.
0
 
LVL 10

Author Comment

by:HuaMinChen
ID: 41864855
But using the same codes on other Web project, everything is fine.

The problem is why the prompt message is now being shown on Web page and no Popup is shown.
0

Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Expanding/Collapsing Tree on SharePoint List 29 62
Easiest intro into .NET CORE? 2 32
Natural height and jquery 6 39
Delete command SQLdatasource in asp.net, vb 2 18
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Australian government abolished Visa 457 earlier this April and this article describes how this decision might affect Australian IT scene and IT experts.
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question