<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>FAQ - Frequently Asked Questions</title><link>http://forums.asp.net/13.aspx</link><description>Your question has probably already been answered. Look here for some great answers!</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Can you open a new window from a post back?</title><link>http://forums.asp.net/thread/3345292.aspx</link><pubDate>Thu, 13 Aug 2009 07:23:19 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3345292</guid><dc:creator>dhinakaranpc</dc:creator><author>dhinakaranpc</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3345292.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=13&amp;PostID=3345292</wfw:commentRss><description>&lt;p&gt;When we use update panel in the page the response.write wont&amp;nbsp; support,&amp;nbsp; where the other will support. This could be a one of the reason.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Can you open a new window from a post back?</title><link>http://forums.asp.net/thread/3341188.aspx</link><pubDate>Tue, 11 Aug 2009 11:43:02 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3341188</guid><dc:creator>nitindhiman</dc:creator><author>nitindhiman</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3341188.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=13&amp;PostID=3341188</wfw:commentRss><description>&lt;p&gt;Hi PLBlum,&lt;/p&gt;&lt;p&gt;I rarely need such kind of functionality but it is a gud topic, I agree with you that on each n every request the browser gets a new HTML based on the request made by that because HTTP is a stateless protocol n can not mentain the state.&lt;/p&gt;&lt;p&gt;And as you are saying that we can use registerClientstartUpScript to regester a script while page is loading, I hv 2 question for you, can&amp;#39;t we perform the same functionality on onLoad event of the window, Like:&lt;/p&gt;&lt;p&gt;window.onload = function() &lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;alert(&amp;#39;hello&amp;#39;);&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;and 2nd 1 is wt is the difference between registerclientstartUpScript and Response.Write.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Thnx...&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Can you open a new window from a post back?</title><link>http://forums.asp.net/thread/3340396.aspx</link><pubDate>Tue, 11 Aug 2009 05:24:51 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3340396</guid><dc:creator>dhinakaranpc</dc:creator><author>dhinakaranpc</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3340396.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=13&amp;PostID=3340396</wfw:commentRss><description>&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;We can call the javascript function in the body tag which is called every time when the page loads.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;
function  OpenPopupWindow()&lt;br /&gt;
{&lt;/p&gt;&lt;p&gt;   window.open(&amp;#39;../HelpDocs/AdmStudCenterwiseRpt.html&amp;#39;,&amp;#39;HelpDoc&amp;#39;,&amp;#39;width=600,resizable=yes,scrollbars = yes&amp;#39;);    &lt;/p&gt;&lt;p&gt;
}&lt;/p&gt;&lt;p&gt;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body onload=&amp;quot;OpenPopupWindow()&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;</description></item><item><title>Re: Can you open a new window from a post back?</title><link>http://forums.asp.net/thread/3230499.aspx</link><pubDate>Sat, 13 Jun 2009 12:48:09 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3230499</guid><dc:creator>Trelane-</dc:creator><author>Trelane-</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3230499.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=13&amp;PostID=3230499</wfw:commentRss><description>&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font size="2"&gt;Top Marks, absolutly perfectly correct:&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;this&lt;/font&gt;&lt;font size="2"&gt;.myimagebutton.Attributes.Add(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;onClick&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;, &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;this.form.target=&amp;#39;_blank&amp;#39;&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;); //opens new window from image button and casues postback&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;(C# equivilent)&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;</description></item><item><title>Re: Can you open a new window from a post back?</title><link>http://forums.asp.net/thread/2543431.aspx</link><pubDate>Thu, 07 Aug 2008 14:30:43 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2543431</guid><dc:creator>tirumal</dc:creator><author>tirumal</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2543431.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=13&amp;PostID=2543431</wfw:commentRss><description>&lt;p&gt;To open a window from Parent window and to close a child window(Pagetobeopend.html), you can use following code&lt;/p&gt;
&lt;p&gt;&amp;lt;body onload=&amp;quot;javascript: window.open(&amp;#39;pagetobeopened.html&amp;#39;,&amp;#39;&amp;#39;,&amp;#39;&amp;#39;);window.opener=&amp;#39;&amp;#39;; window.close();&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;a href=&amp;quot;javascript: window.open(&amp;quot;pagetobeopened.html&amp;quot;);window.opener=&amp;#39;&amp;#39;; window.close();&amp;quot;&amp;gt;Close Main Window without Confirmation&amp;lt;/a&amp;gt;&lt;/p&gt;</description></item><item><title>Re: Can you open a new window from a post back?</title><link>http://forums.asp.net/thread/2452668.aspx</link><pubDate>Fri, 27 Jun 2008 15:08:34 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2452668</guid><dc:creator>CHolt</dc:creator><author>CHolt</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2452668.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=13&amp;PostID=2452668</wfw:commentRss><description>&lt;p&gt;The only problem with using window.open in a startup script is that it will be blocked by a popup blocker&lt;/p&gt;</description></item><item><title>Re: Can you open a new window from a post back?</title><link>http://forums.asp.net/thread/2437822.aspx</link><pubDate>Sat, 21 Jun 2008 10:24:18 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2437822</guid><dc:creator>kathirvelmm</dc:creator><author>kathirvelmm</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2437822.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=13&amp;PostID=2437822</wfw:commentRss><description>&amp;nbsp;&lt;pre class="coloredcode"&gt;&lt;b id="1"&gt;1    &lt;/b&gt;&lt;span class="dir"&gt;&amp;lt;%@ Page Language=&amp;quot;C#&amp;quot; AutoEventWireup=&amp;quot;true&amp;quot;  CodeFile=&amp;quot;FtpUpload.aspx.cs&amp;quot; Inherits=&amp;quot;_Default&amp;quot; %&amp;gt;&lt;/span&gt;
&lt;b id="2"&gt;2    &lt;/b&gt;
&lt;b id="3"&gt;3    &lt;/b&gt;&amp;lt;&lt;span class="tag"&gt;!DOCTYPE&lt;/span&gt; html PUBLIC &amp;quot;-//W3C//DTD XHTML 1.0 Transitional//EN&amp;quot; &amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&amp;quot;&amp;gt;
&lt;b id="4"&gt;4    &lt;/b&gt;
&lt;b id="5"&gt;5    &lt;/b&gt;&amp;lt;&lt;span class="tag"&gt;html&lt;/span&gt;&lt;span class="attr"&gt; xmlns=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&lt;/span&gt; &amp;gt;
&lt;b id="6"&gt;6    &lt;/b&gt;&amp;lt;&lt;span class="tag"&gt;head&lt;/span&gt;&lt;span class="attr"&gt; runat=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;server&amp;quot;&lt;/span&gt;&amp;gt;
&lt;b id="7"&gt;7    &lt;/b&gt;    &amp;lt;&lt;span class="tag"&gt;title&lt;/span&gt;&amp;gt;Untitled Page&amp;lt;/&lt;span class="tag"&gt;title&lt;/span&gt;&amp;gt;
&lt;b id="8"&gt;8    &lt;/b&gt;    &amp;lt;&lt;span class="tag"&gt;script&lt;/span&gt;&lt;span class="attr"&gt; type=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&lt;span class="attr"&gt; language=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;javascript&amp;quot;&lt;/span&gt;&amp;gt;
&lt;b id="9"&gt;9    &lt;/b&gt;    window.close=tt();
&lt;b id="10"&gt;10   &lt;/b&gt;    function tt()
&lt;b id="11"&gt;11   &lt;/b&gt;    {
&lt;b id="12"&gt;12   &lt;/b&gt;        window.open(href=&amp;quot;http://192.168.16.30/swlc&amp;quot; ,height=&amp;quot;200&amp;quot;, width=&amp;quot;200&amp;quot;);
&lt;b id="13"&gt;13   &lt;/b&gt;        }
&lt;b id="14"&gt;14   &lt;/b&gt;    &amp;lt;/&lt;span class="tag"&gt;script&lt;/span&gt;&amp;gt;
&lt;b id="15"&gt;15   &lt;/b&gt;&amp;lt;/&lt;span class="tag"&gt;head&lt;/span&gt;&amp;gt;
&lt;b id="16"&gt;16   &lt;/b&gt;&amp;lt;&lt;span class="tag"&gt;body&lt;/span&gt;&lt;span class="attr"&gt; bgcolor=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;linen&amp;quot;&lt;/span&gt;&amp;gt;
&lt;b id="17"&gt;17   &lt;/b&gt;    &amp;lt;&lt;span class="tag"&gt;form&lt;/span&gt;&lt;span class="attr"&gt; id=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;form1&amp;quot;&lt;/span&gt;&lt;span class="attr"&gt; runat=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;server&amp;quot;&lt;/span&gt;&amp;gt;
&lt;b id="18"&gt;18   &lt;/b&gt;&amp;lt;/&lt;span class="tag"&gt;form&lt;/span&gt;&amp;gt;
&lt;b id="19"&gt;19   &lt;/b&gt;&amp;lt;/&lt;span class="tag"&gt;body&lt;/span&gt;&amp;gt;
&lt;b id="20"&gt;20   &lt;/b&gt;&amp;lt;/&lt;span class="tag"&gt;html&lt;/span&gt;&amp;gt;
&lt;b id="21"&gt;21   &lt;/b&gt;
&lt;/pre&gt;&lt;pre class="coloredcode"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="coloredcode"&gt;This has been tested and works.&lt;br /&gt;&lt;/pre&gt;&amp;nbsp;&lt;br /&gt;</description></item><item><title>Re: Can you open a new window from a post back?</title><link>http://forums.asp.net/thread/2411547.aspx</link><pubDate>Mon, 09 Jun 2008 18:43:05 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2411547</guid><dc:creator>aiasso</dc:creator><author>aiasso</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2411547.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=13&amp;PostID=2411547</wfw:commentRss><description>&lt;p&gt;I found a way to do this using JavaScript.&amp;nbsp; I&amp;#39;ve tested it with the ImageButton control&amp;nbsp;using ASP.NET 2.0.&lt;/p&gt;
&lt;p&gt;The approach is to add an onClick attribute to the tag that changes the form&amp;#39;s target to the new target:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;MyImageButton.Attributes.Add(&amp;quot;onClick&amp;quot;,&amp;quot;this.form.target=&amp;#39;&amp;quot; &amp;amp; Target &amp;amp; &amp;quot;&amp;#39;&amp;quot;)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;where Target is the target you want&amp;nbsp;(eg. &amp;quot;_self&amp;quot;,&amp;quot;_top&amp;quot;,&amp;quot;PrintPreview&amp;quot;, etc.)&lt;/p&gt;
&lt;p&gt;I would think this would also work for Hyperlinks, etc. as well, though I haven&amp;#39;t tested it.&lt;br /&gt;Note the concatenation above uses &amp;#39; quotes around the target name.&amp;nbsp; The output in HTML would look like:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;lt;input type=&amp;quot;image&amp;quot; name=&amp;quot;UserControlMenusAndToolbars1$UserControlToolbar1$ctl04&amp;quot; title=&amp;quot;Print...&amp;quot; src=&amp;quot;../images/print.gif&amp;quot; &lt;strong&gt;onclick=&amp;quot;this.form.target=&amp;#39;PrintPreview&amp;#39;;&amp;quot;&lt;/strong&gt; style=&amp;quot;border-width:0px;&amp;quot; /&amp;gt;&lt;/p&gt;</description></item><item><title>Re: Can you open a new window from a post back?</title><link>http://forums.asp.net/thread/466763.aspx</link><pubDate>Fri, 06 Feb 2004 18:22:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:466763</guid><dc:creator>PLBlum</dc:creator><author>PLBlum</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/466763.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=13&amp;PostID=466763</wfw:commentRss><description>The article makes sense although it opens a window based on a click after the page reloads, not immediately on post back.</description></item><item><title>Re: Can you open a new window from a post back?</title><link>http://forums.asp.net/thread/463924.aspx</link><pubDate>Wed, 04 Feb 2004 10:11:13 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:463924</guid><dc:creator>ariya</dc:creator><author>ariya</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/463924.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=13&amp;PostID=463924</wfw:commentRss><description>hi all , 
&lt;br /&gt;

&lt;br /&gt;
you can do it, just read this and you have done it ! 
&lt;br /&gt;

&lt;br /&gt;
http://dotnetjohn.com/articles/articleid88.aspx
&lt;br /&gt;

&lt;br /&gt;
ariya</description></item><item><title>Can you open a new window from a post back?</title><link>http://forums.asp.net/thread/431102.aspx</link><pubDate>Wed, 31 Dec 2003 17:46:26 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:431102</guid><dc:creator>PLBlum</dc:creator><author>PLBlum</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/431102.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=13&amp;PostID=431102</wfw:commentRss><description>This question has been asked time and time again. When the server sends HTML to a browser, these two rules are followed:
&lt;br /&gt;
1. The browser must have requested the page via an HTTP GET or POST. (The server cannot change a page without the browser asking for it.)
&lt;br /&gt;
2. The browser will only retrieve the HTML into the window that requested it.
&lt;br /&gt;

&lt;br /&gt;
There are only two ways to open a new window that I know about:
&lt;br /&gt;
1. The &amp;lt;a&amp;gt; tag includes a target= property specifying a new window. (The HyperLink webcontrol is simply a way to generate the &amp;lt;a&amp;gt; tag. It includes a Target property.)
&lt;br /&gt;
2. Use JavaScript such as a window.open or window.createPopup.
&lt;br /&gt;

&lt;br /&gt;
The &amp;lt;a&amp;gt; tag opens the new window before posting back and requests the new HTML from that new window.
&lt;br /&gt;

&lt;br /&gt;
The JavaScript technique requires that the original page already contains the JavaScript or when the server posts back, the browser is sent new HTML containing the new JavaScript to the original window. That means the original page's contents are replaced.
&lt;br /&gt;

&lt;br /&gt;
If you want to use the JavaScript technique to open a new window on post back:
&lt;br /&gt;
1. Prepare the HTML necessary for the original page to draw.
&lt;br /&gt;
2. Use Page.RegisterStartupScript() to call window.open. This will allow the new window to popup as the original window is loaded.</description></item></channel></rss>