maintain js/div popup and button click / postback ASP.net

I have a div class that I am displaying as a javascript popup. This displays fine, but I need to be able to post back to the server without the popup closing, and the second I click the submit button, the popup disapears.  See my attached code (sorry it's bulky--just didn't want to cut out too much)
<form class="create_blurp_form" method="post" action="" id="respond" >
                            	<table cellpadding="0" cellspacing="0" border="0">
                                	<tr style="padding-bottom:7px;">
                                    	<td width="90"><asp:Label ID="nameLabel" runat="server" Text="Name:" /></td>

                                        <td width="275">
                                            <asp:TextBox ID="TextBox2" class="create_blurp_form_txt required"  runat="server"</asp:TextBox>
                                        </td>
                                        <td>
                                        	<div class="blurb_alert_right" id="blub_respond_username"  >
                                                <div class="blurb_alert">
                                                </div>
                                                <div class="blurb_alert_left"></div>
                                            </div>

                                        </td>
                                    </tr>
                                    <tr>
                                    	<td><asp:Label ID="ageLabel" runat="server" Text="Age:" /></td>
                                        <td>
                                            <asp:TextBox ID="TextBox3" style="width:80px;" runat="server"></asp:TextBox>
                                        </td>
                                        <td>

                                        	<div class="blurb_alert_right" id="blub_respond_age" >
                                                <div class="blurb_alert">
                                                    </div>
                                                <div class="blurb_alert_left"></div>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                    	<td><asp:Label ID="blurbTextLabel" runat="server" Text="Blurb Text:" /></td>

                                        <td>
                                                 <asp:TextBox ID="BlurbText" runat="server" Text="blurb text should be here" 
                                                Enabled="false" style="width:265px; height:90px; margin-bottom:7px;" cols="25" rows="10" TextMode="MultiLine" ></asp:TextBox>
                                        </td>
                                        <td></td>
                                    </tr>
                                    <tr>

                                    	<td></td>
                                        <td>
                                        <asp:TextBox ID="contactMeText" runat="server" MaxLength="100"
                        TextMode="MultiLine" style="width:265px; height:90px; margin-bottom:7px;" cols="25" rows="10"></asp:TextBox>
                                       </td>
                                        <td>
                                        	<div class="blurb_alert_right" id="blub_respond_interested">
                                                <div class="blurb_alert">
	                                      </div>
                                                <div class="blurb_alert_left"></div>

                                            </div>
                                        </td>
                                    </tr>
                                </table>
                                <p style=" border-bottom: 1px solid #979899; height:1px;"></p>
                               <asp:Button ID="RespondButton" runat="server" Text="Respond" 
                onclick="RespondButton_Click" ValidationGroup="responseGroup" />
                               </form>

Open in new window

cmushaunAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Alfred A.Commented:
Hi,

Try using UpdatePanel to prevent popup from closing.
0
cmushaunAuthor Commented:
Just at first couple trys with UpdatePanel    ... I'm getting a bunch of errors about how tables and forms aren't valid public properties of update panel
0
Alfred A.Commented:
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

ddayx10Commented:
Since the popup is being called/shown by javascript my suggestion is you set your popup function to be called after the button has been clicked by registering a clientscriptblock that calls your popup function after the postback has completed.

In essense the postback occurrs, but since it was caused by the "respond" button, it puts javascript on the page that will call your popup back into existence after the page is finished posting back.

Protected Sub RespondButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles RespondButton.Click
        Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), "script", String.Format("Call_JS_Popup_Function_Here();"), True)
End Sub

Another solution might be to assign your JS popup event to the body onload event when the "response" button is pressed.

Another solution would be to put an asp:literal control on the page, assign it javascript text to call your popup function when the "response" button is pressed.

Another solution is to use the AJAX modal popup which can be called to pop or hide from code-behind.

Hope some of this helps.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
himabinduCommented:
We have an option for creating modal popup control in Ajax extensions tool box.

But the popup appears on firing an event like on clicking any button or linkbutton.

You can check this website for your reference

http://www.codeproject.com/KB/ajax/ASPModalInAction.aspx
0
cmushaunAuthor Commented:
Is anyone able to provide an example that I could try?

Thanks,
Mike
0
ddayx10Commented:
Not having your CSS or Javascript to see how your popup/modal/thing interacts I can make a simple sample just showing and hiding your table. When you click the Respond button the table is still showing because the JS function is called after the postback.
.ASPX PAGE (sample)
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default7.aspx.cs" Inherits="Default7" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
    <script type="text/javascript">
		
		function showTable()
		{
			document.getElementById('ImATableAlright').style.display = 'block';
		}
    
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <a href="http://www.google.com" onclick="showTable(); return false;">Show Table</a>
	<table id="ImATableAlright" cellpadding="0" cellspacing="0" border="0" style="display:none;">
		<tr style="padding-bottom: 7px;">
			<td width="90">
				<asp:Label ID="nameLabel" runat="server" Text="Name:" />
			</td>
			<td width="275">
				<asp:TextBox ID="TextBox2" class="create_blurp_form_txt required" runat="server"></asp:TextBox>
			</td>
			<td>
				<div class="blurb_alert_right" id="blub_respond_username">
					<div class="blurb_alert">
					</div>
					<div class="blurb_alert_left">
					</div>
				</div>
			</td>
		</tr>
		<tr>
			<td>
				<asp:Label ID="ageLabel" runat="server" Text="Age:" />
			</td>
			<td>
				<asp:TextBox ID="TextBox3" Style="width: 80px;" runat="server"></asp:TextBox>
			</td>
			<td>
				<div class="blurb_alert_right" id="blub_respond_age">
					<div class="blurb_alert">
					</div>
					<div class="blurb_alert_left">
					</div>
				</div>
			</td>
		</tr>
		<tr>
			<td>
				<asp:Label ID="blurbTextLabel" runat="server" Text="Blurb Text:" />
			</td>
			<td>
				<asp:TextBox ID="BlurbText" runat="server" Text="blurb text should be here" Enabled="false"
					Style="width: 265px; height: 90px; margin-bottom: 7px;" cols="25" Rows="10" TextMode="MultiLine"></asp:TextBox>
			</td>
			<td>
			</td>
		</tr>
		<tr>
			<td>
			</td>
			<td>
				<asp:TextBox ID="contactMeText" runat="server" MaxLength="100" TextMode="MultiLine"
					Style="width: 265px; height: 90px; margin-bottom: 7px;" cols="25" Rows="10"></asp:TextBox>
			</td>
			<td>
				<div class="blurb_alert_right" id="blub_respond_interested">
					<div class="blurb_alert">
					</div>
					<div class="blurb_alert_left">
					</div>
				</div>
			</td>
		</tr>
	</table>
	<p style="border-bottom: 1px solid #979899; height: 1px;">
	</p>
	<asp:Button ID="RespondButton" runat="server" Text="Respond" OnClick="RespondButton_Click"
		ValidationGroup="responseGroup" />
    </form>
</body>
</html>



************************************

.ASPX.CS (CODE BEHIND)
NOTE: The actual call to RegisterStartupScript is identical is VB and C# except for the keyword "this" would be changed to "Me". You didn't specify which you were using.

public partial class Default7 : System.Web.UI.Page
{

    protected void RespondButton_Click(object sender, EventArgs e)
    {
        Page.ClientScript.RegisterStartupScript(this.GetType(), "someScript", "showTable();", true);
    }
} 

Open in new window

0
cmushaunAuthor Commented:
Used Modal Popup Extender
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.