PC Review


Reply
Thread Tools Rate Thread

Check form already open in browser

 
 
MikeTI
Guest
Posts: n/a
 
      5th Sep 2009
Sep 5, 2009

Hi all

I am new to ASP Net and am using VS2008.

On the click of a button in a form I want to:
1. Check if the second form is already on the browser, to ensure that
another instance of the form does not display.
2. Set focus to the second form without the second form doing any postback.

I have seen some codes in the internet, but the second form does a postback.

function ShowOrderForm()
{
/* If the window doesn't exist or has been closed, open it */
if((typeof newwindow == 'undefined') ||!(newwindow.open) ||
newwindow.closed)
{
newwindow=window.open("Test05.aspx", "my_order");
}

if (window.focus) {newwindow.focus()}
}

Thank you in advance.
MikeTI

 
Reply With Quote
 
 
 
 
Patrice
Guest
Posts: n/a
 
      5th Sep 2009
The second or the first ? For now I would say the button on which you click
is a submit button. The code would run but it would still does a postback.

In the code you shown there is no postback :
- opening a form is not really a post back (this is a GET request but you
have to request the page if you want to display it)
- giving the focus to a window doesn't trigger a postback

You may have something on the second form causing the postback...

So if you just create two empty forms (one wiht a non submit button) and use
this code to switch to the other form you still have the problem ?

--
Patrice

"MikeTI" <(E-Mail Removed)> a écrit dans le message de
news:576F3FAD-C917-43DC-8CD9-(E-Mail Removed)...
> Sep 5, 2009
>
> Hi all
>
> I am new to ASP Net and am using VS2008.
>
> On the click of a button in a form I want to:
> 1. Check if the second form is already on the browser, to ensure that
> another instance of the form does not display.
> 2. Set focus to the second form without the second form doing any
> postback.
>
> I have seen some codes in the internet, but the second form does a
> postback.
>
> function ShowOrderForm()
> {
> /* If the window doesn't exist or has been closed, open it */
> if((typeof newwindow == 'undefined') ||!(newwindow.open) ||
> newwindow.closed)
> {
> newwindow=window.open("Test05.aspx", "my_order");
> }
>
> if (window.focus) {newwindow.focus()}
> }
>
> Thank you in advance.
> MikeTI
>


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it possible to open IE browser in windows form? Ashima Atul Microsoft Dot NET Compact Framework 2 13th Apr 2005 01:38 PM
Check if form is open =?Utf-8?B?S2V2?= Microsoft Excel Programming 9 10th Dec 2004 12:50 PM
How to open a new web browser from a windows form Todd McCarty Microsoft Dot NET Framework 5 10th Oct 2004 10:53 AM
Re: How to open a new web browser from a windows form Shell Microsoft Dot NET Framework 0 12th Aug 2004 07:16 AM
Re: How to open a new web browser from a windows form Shell Microsoft Dot NET Framework 0 12th Aug 2004 05:13 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:26 AM.