Solved

Problem to Popup

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

Accepted Solution

by:
Daniel Van Der Werken earned 500 total points
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to count occurrences of each item in an array.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

743 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now