Problem with Popup

Posted on 2014-08-10
Last Modified: 2014-08-12
Having these codes below
    <link rel="stylesheet" type="text/css" href="" />
    <script type="text/javascript" src=""></script>
    <script type="text/javascript" src=""></script>
    <script type="text/javascript">
        $(function () {
                autoOpen: false,
                autoResize: true,
                resizable: false,
                title: "Confirmation",
                open: function (event, ui) {


        function closePopup() {

        function openPopup() {
	<script language="C#" runat="server">
        private void clickOK(object sender, EventArgs e)
            ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "ClosePopup", "closePopup();", true);
    <cc1:ToolkitScriptManager runat="server"></cc1:ToolkitScriptManager>
	<asp:panel id="myPanel" runat="server">
		<input type="textbox" id="tb_msg" style="height:20px; width:116px; border:inherit; background-color:#F0FAF9;" runat="server" />
		<br /><br />
        <div style="text-align:center;">
		    <asp:Button id="OKButton" OnClick="clickOK" runat="server" Text="OK"/>
                        tb_msg.Value = "Testing 2";
                        ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "OpenPopup", "openPopup();", true);

Open in new window

the last line above is not able to show the Popup within Code-behind. why?
Question by:HuaMinChen
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
  • 2
LVL 16

Expert Comment

ID: 40253748
I am not sure if this is related, but at you see

    protected void btnShowPopup_Click(object sender, EventArgs e)
        string message = "Message from server side";
        ClientScript.RegisterStartupScript(this.GetType(), "Popup", "ShowPopup('" + message + "');", true);

where is uses RegisterStartupScript and not RegisterClientScriptBlock
LVL 10

Author Comment

ID: 40254524
Thanks. even if I have these instead

                        tb_msg.Value = "Testing 2";
                        ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "openPopup", "openPopup();", true);

Open in new window

I still get no message prompted, when running the re-deployed project.
LVL 16

Accepted Solution

hjgode earned 225 total points
ID: 40254833
Then I would start over and test the code at . If that works, I would change that in small pieces to get to the function that you need.
LVL 10

Author Comment

ID: 40254871
Thanks. I get some other problem when using your sample code.

The point is, why my original codes do not work as expected.

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PHP: Filling Out/Creating a PDF 29 107
Popup write two lines 3 22
Prevent certain words from being typed in a form 6 31
Import a excel sheet in a grid 2 13
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
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)
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

726 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