Solved

Problem to Popup

Posted on 2016-10-27
2
85 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
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
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?
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

765 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