how to open a web page in form of a popup web page

Hello, I have two web pages, let say.

Page A : With a Button on it.

PAge B: with some info.

Now I need to: When I click on the Button of page A.

Page B must open in a pop up window. 

 

I can do this but problem is this when I clicked on the button for first time it does not show me any thing and when I clicked on the button for second time then It shows me Page B .

My code is as follow:

 

 

1     protected void Page_Load(object sender, EventArgs e)
2        {
3            if (!this.Page.IsPostBack)
4            {
5    
6            }
7            else 
8            {
9               //this.btn_ManageEvents_Click();
10           }
11       }
12   
13   
14       protected void btn_ManageEvents_Click(object sender, EventArgs e)
15       {
16           btn_ManageEvents.Attributes.Add("OnClick", "PopWin();return false;");
17       }

  

 <asp:Button ID="btn_ManageEvents" runat="server" Text="Manage Events" Width="100%" OnClick="btn_ManageEvents_Click" /><br />

 

 <script>
    function PopWin()
    {
    window.open("Event_Management.aspx","ScheduleJobs","toolbar=no, directories=no, location=no, status=yes, menubar=no, resizable=no, scrollbars=no, width=850, height=340", true);
    }
   
    </script>

 

How to fix this issue? Please help me to sort out this issue.

 

Thanks in advance,

 

junior 

0
issuemaster
3/16/2007 1:44:57 PM
asp.net.web-forms 93655 articles. 5 followers. Follow

2 Replies
2091 Views

Similar Articles

[PageSpeed] 31

Remove the below line of code from your button click event and add it on your page_load event

btn_ManageEvents.Attributes.Add("OnClick", "PopWin();return false;");

HC

----

Mark this post as answered if it helped you


Haissam Abdul Malak
MCAD.NET
| Blog |
0
Haissam
3/16/2007 3:41:40 PM

Move your code around so that you're adding the attribute to the button in page_load. You shouldn't need any server postbacks or methods to run then. The javascript should open the pop up window.

 

     protected void Page_Load(object sender, EventArgs e)
2        {
3            if (!this.Page.IsPostBack)
4            {
5   
6            }
7            else
8            {
9               //this.btn_ManageEvents_Click();
10           }
11      
12           btn_ManageEvents.Attributes.Add("OnClick", "PopWin();return false;");
13      }

0
richiej
3/16/2007 3:45:17 PM
Reply:

Similar Artilces:

Can my web page with a form submit to other web pages forms?
I was wondering if I created an aspx page that had a form on it that I could use the submit button to submit this form's contents to other web pages forms(servers accepting those form's data). I am thinking this would be a great way to update data on particular web pages without having to actually visit those similar web pages. Any ideas, examples would be much appreciated. Thanks in advance.  Yes you can.  It's called Cross Page Posting: http://msdn2.microsoft.com/en-us/library/ms178139.aspxAlso: http://msdn2.microsoft.com/en-us/library/ms178140.aspx might ...

Open web page in IE and populate fields on the form from my web form
To the dot net Knights.  Many humble thanks in advance from a dot net surf. We have an vb application that opens multiple instances of IE object, each to different web pages.  It then takes information from the current record in the app, populates fields on each of the web pages, and them submits the forms.  We are then able to look at the resulting web pages and quickly get the info we're looking for.This prevents us from having to manually navigate to each web site, enter the same information and then wait for the page to open.  If there is ...

Could PB .NET Web Form POST security Information to others web page??
This is a multi-part message in MIME format. ------=_NextPart_000_00F9_01C9C4D5.8FB45C90 Content-Type: text/plain; charset="big5" Content-Transfer-Encoding: quoted-printable Hi,=20 Have anyone came across the requesion to POST security informations from = PB .NET web form web page to other web site?? I have tried many datys, Could any kind man give me some suggessions?? thanks & Best regards Leon ------=_NextPart_000_00F9_01C9C4D5.8FB45C90 Content-Type: text/html; charset="big5" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML P...

How to open another web page from one web page
Hi, I am writing an asp.net(C#) 2.0 web page with a link to another web page by clicking a button control on the page, so how can I link it in the codes? I cannot access another aspx page class within the current aspx page class.  Thanks If you need to re-direct the user to another page after pressing your Button, then use the Response.Write method like so: Response.Redirect("~/Default.aspx")Thanks, EdMicrosoft MVP - ASP/ASP.NET 1) Response.Redirect( "Destination PageName");2) Response.Transfer("Destination PageName");3) Hyperlink(  set Url="...

Web page opens second web page, how does first page know when the second one closes?
I have an app written in ASP.NET where one of the web pages opens up a web page in a second window.  When this second web page closes, the first web page needs to update its data.  How do you do this? You can have the child window call a parent method when the user clicks a link to close it. Otherwise, you'd have to set up polling to check for the existence of the child, and refresh if it doesn't exist. Please Mark As Answer posts that helped you."If we learn from our mistakes, I should be brilliant by now." Thanks, this gives me part of the answer...

web web web
Name: bahadir Email: sensiz_olmuyor_t1_at_hotmail.com Product: Firefox 2 Beta 2 Summary: web web web Comments: web sayfası yapmak Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; tr; rv:1.8.1b2) Gecko/20060821 Firefox/2.0b2 ...

Web forms and mobile web forms
Hey everyone, I am looking to develope a web site that depending on the device connecting to it, it will display a certain page. In this case im looking to create a web and wap version of the same project. I have the Web forms version finished using ASP.NET and C# and I am wondering how to create the mobile web form and incorporate it in the project. In the project folder, can I just add a mobile web??? But what about displaying device specific pages?? Cheers -Dudach Yes, you can add mobile web forms and controls to your Web Application project. No problem. For device/br...

How to Make Web Forms from other Web Forms
In putting together an ASP.NET application for a biz application, we have come to the point where there are three different types of basic forms which have, for the most part, been perfected. Now its is a matter of cloning those forms for various uses and modifying or adding code to suit the particular need. Copy and paste works OK, but there is a lot of changing of certain words, etc. Is there a way in ASP.NET to take these basic forms, turn them into classes or templates, create forms from them, then add or overwrite code? ? (Anybody who is a Vis Fox Pro programmer would know imme...

How do you incorporate a web page in a web form without IFrame
I would like to display a web page in my web form, but don't want to use frames or I frames. Can it be done with a label? If not then any suggestions and code would be appreciated. Thanks Please describe in more detail what you are trying to achieve. Frames and IFrames are for the purpose of rendering >1 html page in a single browser window. AFAIK there is no other way to achieve this purpose, but maybe you are trying to describe a different purpose? Basically it's a search page. The search term is picked up from a text box and then a URL is called. The URL is fed with the s...

How to convert web form(web page) to a word document
Hi Guys.Can any one give me a hint on how to  convert a web form (a web page) to a word document.Thank You...

Sharepoint help! Error msg : "A Web Part or Web Form Control on this Web Part Page cannot be displayed or imported because it is not registered on this site as safe"
hihi, I have set up a testing virtual server on my local machine. I installed win server 2003, wss 2.0, sql server 2000, and visual studio .net 2003. i tried to create a project in C# but when i build it and import the web part (.dwp) into the page, there is this error msg "A Web Part or Web Form Control on this Web Part Page cannot be displayed or imported because it is not registered on this site as safe"  I seached most of the sites and they informed that the problem lies in the safe control in web.config i enter the safe control in web.config but i does not know where to put ...

Understanding Web Form System.Web.UI.Page.ProcessRequest
Hello all ... I'm working with a third-party product that monitors .NET and ASP.NET performance.  This product monitors performance times for "entry points" ... essentially how long it takes to load an .aspx page, etc.  Pretty slick. The "entry point" they use to start tracking time on a Web page is System.Web.UI.Page.ProcessRequest      I looked this up in the docs, and it says this is one of the features available in ASP.NET that really isn't intended for developers to use.  OK, fair enough.  I as a developer shouldn't use it....

Debugging exception when loading a web page in the Web Forms Designer
In a project at work I have inherited, I am getting an exception when loading an .aspx page in the Web Forms designer. The project was originally created with VS .NET 2002 and I am upgrading it to VS .NET 2003. It appears that the Web Forms designer actually attempts to instantiating an instance of the codebehind class in order to bring ou the Web Forms designer page. Why does it do this ?The codebehind class inherits from another class, which inherits from System.Web.UI.Page. It is in this other class in which the exception is occurring.Is there any way I can debug this so that I can find o...

For interrupting.web form Resized by position of the div : if div can't dispaly all (such as only top part , then web form heithten the heght),resize the web form
Web Form Resized by position of the div : if div can't dispaly all (such as only top part , then web form heithten the heght),resize the web form ! Because of my pool English, if you can't see , I will explain more ! ThanksGambler is the real life I guess you mean when form grows it also grow parent div element. This is normal. If you want div to stay fixed size and rather clip the form and maybe show a scrollbar, look at overflow property in CSS.Thanks------------------------------------------------------------This posting is provided "AS IS" with no warranties, and confers no ...

Web resources about - how to open a web page in form of a popup web page - asp.net.web-forms

Learn Chinese with Chinese Podcasts - Popup Chinese
Learn Chinese online with free Chinese podcasts and learning tools from Popup Chinese, the highest-rated online Chinese learning website

Wikipedia:Tools/Navigation popups - Wikipedia, the free encyclopedia
Quick installation: Enter Special:Preferences and click "Gadgets", check the box to enable Popups, then click save. Follow the instructions on ...

Daisy Marc Jacobs Tweet Shop Popup Store Will Only Accept ‘Social Currency’
Designer Marc Jacobs will open a popup shop in SoHo during New York Fashion Week next month, but not a single bill nor coin will be exchanged. ...

Adblock Browser - By Adblock Plus. Block ads, browse more efficiently, remove popups, disable blacklist ...
... customer ratings, see screenshots, and learn more about Adblock Browser - By Adblock Plus. Block ads, browse more efficiently, remove popups, ...

Create an easy Netflix style popup for a PDF in Adobe InDesign - YouTube
InDesign CS5+ allows us to add lots of great functionality to a PDF file to make it interactive. In this video tip, I'll show you how to show ...

Popup Audio Player - As It Happens with Carol Off and Jeff Douglas - CBC Radio
Featured Audio All show audio » Please download the latest version of Flash Player to view this content.

Beware authentication popups in iOS Mail: bug allows convincing-looking phishing attacks
If you are reading mail on your iPhone and iPad and a popup appears asking you to re-login to iCloud (or anything else), beware. Security researcher ...

Facebook Testing Home Page Video Popup Ads for the First Time - SocialTimes
... Facebook’s future plans for advertising on the home page, Facebook has started testing a new video ad unit that plays the video in a popup box ...

New Android apps worth downloading: Popup Widget, Hightail, Song Rush
Keep your Android device’s Home screen clean with today’s first app worth downloading. It’s called Popup Widget, and it allows you to turn all ...

Pantech to Take the Fight to Samsung with Upcoming Popup Note?
Ranking in at number 3 as one of Korea’s largest smartphone makers, Pantech seeks to challenge its rival Samsung. The device Pantech plans to ...

Resources last updated: 12/29/2015 12:53:26 AM