Open popup window on click of button event from code behind side

 Hi friends
I have one button called Preview which is placed in upadate panel.
Now I want to open popup window on click of that button.
I can call javascript onclientclick event but before open popup window i want to get some values from current window.I dont want to pass that value in query string.
Here is my code

<pre>
ClientScript.RegisterStartupScript(this.GetType(), "JS", "javascript:window.open('PreviewPop.aspx?DesignID=" + txtImageHide.Value + "','MyTitle','height=250,width=505, top=100, left=100, scrollbars=yes, resizable=yes, status=no')", true);</pre>

but popup window is not open.If I remove update panle then it works fine.

can anybody give me solution for this.

thanks in advance


Click on 'Mark as Answer' if this post is helpful.

ImranKhan pathan
-1
impathan
11/6/2007 12:09:25 PM
asp.net.client-side 24353 articles. 0 followers. Follow

3 Replies
2391 Views

Similar Articles

[PageSpeed] 11

I doubt if that will work in an update panel, which I assume is an AJAX control. It would need to be rendered on a PostBack event.

NC...

1
NC01
11/6/2007 1:52:19 PM

Hi,

I am not very sure what you are saying.

Maybe you can use endrequest event to do it.

Best Regards,


Sincerely,
Jin-Yu Yin
Microsoft Online Community Support
1
Jin
11/12/2007 7:53:58 AM

What I am saying is that you can only run startup code with a page refresh/reload and an asynchroneous refresh (AJAX) only does a partial refresh.

NC...

1
NC01
11/12/2007 2:54:23 PM
Reply:

Similar Artilces:

executing server side code and client side (javascript) code simultaneously while clicking a button
how to execute server side code and client side (javascript) code simultaneously while clicking a button in asp.net. You can't. When clicking a button: the client-side executes, the page does a PostBack, then the server-side executes.NC... what if i want to update a database and then open a new windows is it possible with Jscript.net?...

Firing both Client side event and server side event for server side button
I am having some difficulties getting this to work.. I have button_click (Asp.net) and ClientClick (Javascript).  Javascript is firing fine.  Server script is not. may be you have return return false in the in the javascript which is why its not firing server side event.You should add javascript evelt like thisbutton1.onclientclick = "functionname" Function should nopt return false. Vikram www.vikramlakhotia.comPlease mark the answer if it helped you...

Calling Button Click Event From Another Event With Client Side Code
Hi All,I am trying to call a (server control) button's click event from another event where the button has a client side code as well. I defined my button as: <asp:Button runat="server" id="button1" onclick="button1_Click" onclientclick="someJSFunction(); return false;" text="..." />  The button1_Click event does not contain any server side code, I just need a reference for my other event to call to, like so: void OtherEvent(object sender, EventArgs e) { button1_Click(sender, e);}  What happens is that button1_Click is being fired but the client side code ...

How to access Client Side control in server side button click event?
Hi all, I need to access client side control from server side code. For an example <form id="form1" runat="server"> <table> <tr> <td>UserName:</td> <td><input type="text" id="textBoxUserName" /></td> <td><asp:Button ID="buttonShow" runat="server" Text="show" OnClick="buttonShow_Click" /></td> </tr> </table>   </form> I need to access the textBoxUsername in the server side button click event. How to do that? Than...

javascript window.open via button click event in code behind
Hello! I'm trying to open a new window on a click event. If I use the attributes.add in the Page_Load, then pop-up window gets hit before an update occurs...hence, the pop-up window is just a little too early. I'm trying this in my button click event, but it's not bringing up the new window: Response.Write("<script language=""javascript"">window.open('UpdateBudgetConfirm.aspx?UBID=" + strSAID + "','','width=500,height=320,left=200,top=200');"")</script>") Thanks! You wanna use Page.Client...

Opening a modal popup before running server-side code on button click
I have a button that I want to use to open a modal popup before I run any further server-side code.  I want to the popup to return a value that dictates whether any further server-side processing is necessary.  I don't really know how to go about this.  I've tried adding an attribute to the buttons onclick and launching the popup with window.open, but that isn't working.  Any suggestions? Are you wanting just a "OK/Cancel" button?  If so i is easy <asp:Button ID="btn_ClickMe" runat="server" onClientClick="ret...

button click event : how to prevent service code fire from client side script
Button have client side click event and server side click event, my question is: how can I prevent server side click event code execute in conditional from client side script code below: <script language="javascript" type="text/javascript">function Client_onclick() { if (cb.checked == false) do not execute service side code.... elseexecute service side code..... } </script> <form id="form1" runat="server"> <input id="cb" type="checkbox" /><asp:Button ID="Button1" runat="serv...

Calling server side sub from client side button click
Hi, I have some javascript in my asp.net page, and a function within that, which is run when the client side form is submitted. What I need is for that function to run, which updates a server side variable, then following that a server side sub should run, using that (newly updated) variable. I have currently set it up with the  onsubmit= tag of the client side form running the first (JavaScript) function, and then the submit button at the bottom of the client side form calling the server side sub with its onClick property. The (probably quite daft!) thinking behind that was that the on...

open window from server side button click
Hi, I want to open new window and write HTML content to it on sever side button click event. I have written following code:   protected void btnClick_Click(object sender, EventArgs e) { Response.Write("<SCRIPT LANGUAGE=\"JavaScript\"&gt;\n"); Response.Write("window.open( '','popup','toolbar=no,menubar=no,scrollbars=1,width=750,height=800')"); Response.Write("<script>"); Response.Write("<html><head>"); Response.Write("<head><...

open a popup window from.net code behind
Hi I am trying to open a new window from a button in my aspx side. This works, but I have to push the button 2 times before it open. Any idea? Public Shared Sub OpenPopUp(ByVal opener As System.Web.UI.WebControls.WebControl, ByVal PagePath As String) Dim clientScript As String 'Building the client script- window.open clientScript = "window.open('" & PagePath & "')" 'register the script to the clientside click event of the opener control opener.Attributes.Add("onClick", clientScript) End Sub Sub Button1_Click(sender As...

Call server-side page function from client-side button click
I have an existing ASP application that I am migrating to ASP.net. In the ASP app I was using the Microsoft.XMLHTTP on a the client-side of a ASP page to retrieve data from another asp page using the Microsoft.XMLDOM object. The client page passes 3 tags columns, table and Criteria. The receiving page builds the SQL statement executes the query and returns the row with all the column data. I am trying to convert it over to ASP.NET and I am getting errors on the xmlDOM.Load(Request.InputStream) on DLookup.aspx, the code is listed below. Someone suggested to use System.Net HTTP classes su...

what client-side and server-side events are fired when button X is hit?
Folks,In a web aspx page, I use a client-side (javascript) button named "Cancel" so when users hit it, if the data they enter is not saved yet, then this client-side button prompts users to save data before the page is closed. I code this client-side button with event "onclick" and thing like <input type=button ... onclick="btnCancelClick();" >   My question is if users hit the right top corner button X (next to the maximize and minimize buttons also on the top right corner of the aspx web window page), then what client-side (javascript) and serv...

I need to get a server side button to run this client side code?
I need to get a server side button to run this client side code when the server button is clicked and then subsequently called by the server. Is it possible? The problem is that the print control is a client side activex. I can call it normally using a client side button but this is no good when I need to print more then one page. Any help would be great. Thanks. The code: function PrintProc(){ var MyPrinter; MyPrinter = new ActiveXObject("ImgXPrint6.ImgXPrint"); MyPrinter.PageFrom = 1; MyPrinter.PageTo = 1; MyPrinter.PageM...

client side code & server side code
what is the difference between client side coding & server side coding ? when to use client side & server side code? Client side code runs on the user's browser and includes languages such as javascript and vbscript. Server side code runs on the web server and can be written in languages such as ASP.NET, PHP, ASP, ColdFusion etc. Website Design Darlington - http://mdssolutions.co.ukhttp://lessthandot.com - Experts, Information, Ideas & Knowledgehttp://aspnetlibrary.com - An online resource for professional ASP.NET developersPlease remember to click "Mark as Answer...

Web resources about - Open popup window on click of button event from code behind side - asp.net.client-side

Window - Wikipedia, the free encyclopedia
This article is about the part of a building. For the Microsoft operating system, see Microsoft Windows . For other uses, see Window (disambiguation) ...

Microsoft Windows Information, Solutions, Tools - Windows IT Pro
Microsoft Windows information and solutions for IT pros. Topics include cloud computing, Windows Server, Exchange, Outlook, PowerShell, virtualization, ...

The Windows Blog
The Windows Blog is Microsoft's Official Blog for the Windows Operating System.

Reliable window washers a godsend in the booming service industry
Tidy your room, put on your pants &ndash; or at least pull the curtains. The window cleaner sees everything, and sometimes it's not pretty

Dick Smith float looks like window dressing
There are plenty of questions to be answered about the failed chain's financial health when it was sold to shareholders.

Chrome picks up bonus security features on Windows 10
(credit: Moyan Brenn ) The Windows 10 November update (version 1511, build 10586) included a handful of new security features to provide protection ...

Microsoft: Windows 10 will keep you safe, and this is how
The reason Microsoft has given for pushing Windows 10 so aggressively is it wants to get users to a "safe place" . Very altruistic. Although ...

North Korea moves up rocket launch window - Story
Copyright 2016 Cable News Network/Turner Broadcasting System, Inc. All rights reserved. This material may not be published, broadcast, rewritten, ...

Here's why Microsoft wants everyone to get Windows 10 by July — and what happens if they don't
Microsoft is giving away Windows to any existing customers for free until July 29, 2016. This is a dramatic shift from how previous versions ...

Seoul: North Korea moves up rocket launch window
Outside governments suspect planned rocket launch is a banned test of ballistic missile technology

Resources last updated: 2/7/2016 6:50:45 AM