.NET Forum / Languages / JScript / April 2004
Close window
|
|
Thread rating:  |
ruca - 05 Apr 2004 10:54 GMT Hi,
I have a popup (child) window that it is called by a button in my main (parent) window. How can I set the child window for not closing before the parent window? What do I have to do?
 Signature Programming ASP.NET with VB.NET Thank's (if you try to help me) Hope this help you (if I try to help you) ruca
Klaus L?ffelmann - 05 Apr 2004 11:14 GMT Ruca,
bind the OnClosing event or overwrite OnClosing of the form's base class. With the EventArgs, use the Cancel property to prevent the form from closing.
Klaus
> Hi, > > I have a popup (child) window that it is called by a button in my main > (parent) window. > How can I set the child window for not closing before the parent window? > What do I have to do? ruca - 05 Apr 2004 11:39 GMT Hi
that event don't appear in my list of page events. What do I have to do? I have another question. How can I open only one popup at a time, ie, when I click to open one popup, if another is open this one closes. I have a funtion but only works if it is called by an link and not a button.
I have this in JavaScript: --------------------- begin java code-------------------------- var popup = null;
//destroy popup if aleady opened function DestroyWnd () { // close the current window if(popup != null) { popup.close(); popup = null; } }
function pick(Src) { if((popup == null) || popup.closed) {
var url = "xpto.aspx?srcA=" + Src popup = window.open(url, "_blank", "height=200, width=200, left=250, top=200, " + "location=no, menubar=no, resizable=no, " + "scrollbars=no, titlebar=no, toolbar=no", true); } else { DestroyWnd(); pick(Src); } } --------------------- end java code--------------------------
In my page_load i Have this --------------------- begin vb code--------------------------
Sub Page_Load(...) ... Button1.Attributes.Add("OnClick","pick('textbox1');") ... End Sub
--------------------- end vb code--------------------------
 Signature Programming ASP.NET with VB.NET Thank's (if you try to help me) Hope this help you (if I try to help you) ruca
Klaus L?ffelmann - 05 Apr 2004 11:55 GMT Are you talking WinForms or ASP.NET - because that's different? If ASP.NET, you're in the wrong group. Make sure to not crosspost the next time.
Klaus
> Ruca, > [quoted text clipped - 10 lines] > > How can I set the child window for not closing before the parent window? > > What do I have to do? Cor - 05 Apr 2004 12:09 GMT Hi Klaus,
Why is this the wrong group for VB.net development for webapplications, that is normally done here?
There is no other international newsgroup for that.
I know that this is not as in the German newsgroups, but there is a newsgroup entwickler.dotnet.asp)
I hope this makes it more clear?
Cor
Klaus L?ffelmann - 05 Apr 2004 12:24 GMT Cor,
you're absolutely right. Sorry for that. I really thought, there was not only microsoft.public.dotnet.framework.asp.net, but that group also seperated in VB and C#. (Why isn't that so, by the way, would make sense, wouldn't it?)
Klaus
> Hi Klaus, > [quoted text clipped - 9 lines] > > Cor Cor - 05 Apr 2004 12:09 GMT Hi Klaus,
Rucca does vb.net webforms (I know this) but he has that too in the footer from his message.
Cor
Cor - 05 Apr 2004 12:21 GMT Hi Claus,
I saw I forgot to send this message (pusch the send button) an hour ago.
Sorry
:-) Cor
Klaus L?ffelmann - 05 Apr 2004 12:33 GMT Cor,
funny, the whole thread is messed up... :-) I just noticed, that I actually answered myself in the first branch. I guess, I'm confused today. Should get more sleep.
Klaus
> Hi Claus, > [quoted text clipped - 5 lines] > > Cor Cor - 05 Apr 2004 11:44 GMT Hi Ruca,
When you make a webform in his self container, the page is disconnected as soon as you have showed it.
There are posibilities to prevent that from closing, I hope you are not making such an terrible webform.
When you want what you ask, why than not just use a large label on your form in a very different colour, the only problem is that the user cannot move it. (Although with some Javascript and the style possitition absolute that should be possible too)
Just my thought,
Cor
ruca - 05 Apr 2004 14:47 GMT Sorry Cor, but maybe I don't understand what you trying to say me.
My popup window have some fields (but it is not terrible, heheh) that when closed return to main window if user change one of them. I can't understand whne you says: "...why than not just use a large label on your form in a very different colour, the only problem is that the user cannot move it."
Sorry not understand the idea, but I'll glad if you explain to me again.
Thank you very much.
 Signature Programming ASP.NET with VB.NET Thank's (if you try to help me) Hope this help you (if I try to help you) ruca
> Hi Ruca, > [quoted text clipped - 12 lines] > > Cor Cor - 05 Apr 2004 15:19 GMT Hi Ruca,
I can be wrong, but when I see that code is what I think happening that you open an assynchonous window in another window.
You have in my opinion no control anymore over that window.
Therefore I said, can you not better create a label, and now I know there are fields in it, create a panel in your main form with the information you want. That is than full controlled from the Server side. That panel can you show and hide any time you want. The fields on it you can even create dynamicly.
However just my thought,
Cor
ruca - 06 Apr 2004 15:39 GMT Ok, I already understand your point. But one moe questio if you know How to answer:
If I have a link (not link button) calling the popup window, I can have only and only one popup window at a time. With the exactly the same code in VB and JavaScript, if I have a button or linkbutton the same code don't work and opens so many popup's as the clicks that I do.
 Signature Programming ASP.NET with VB.NET Thank's (if you try to help me) Hope this help you (if I try to help you) ruca
> Hi Ruca, > [quoted text clipped - 12 lines] > > Cor Cor - 07 Apr 2004 06:41 GMT Hi Ruca,
Can you not disable that A object in its onclick event?
Cor
ruca - 08 Apr 2004 11:39 GMT How come?
 Signature Programming ASP.NET with VB.NET Thank's (if you try to help me) Hope this help you (if I try to help you) ruca
> Hi Ruca, > > Can you not disable that A object in its onclick event? > > Cor Cor Ligthert - 08 Apr 2004 11:51 GMT Maybe to cryptic
A link is normaly an A object if another word for it is an HREF.
I thought you did only want to open your window once.
So when you try to write a piece of java in the onclick of that A object to disable it, I thought it would not open that window anymore.
Not that I did do it ever in this way, therefore was it more as a question.
:-) Cor
ruca - 05 Apr 2004 14:43 GMT Thank you guys for your help. I only was enable to see all your messages now, and I must say that this is the most funny thread that I ever participate. Sorry I'm posting this message in a group of work, but I can't resist. :)
 Signature Programming ASP.NET with VB.NET Thank's (if you try to help me) Hope this help you (if I try to help you) ruca
> Hi, > > I have a popup (child) window that it is called by a button in my main > (parent) window. > How can I set the child window for not closing before the parent window? > What do I have to do?
Free MagazinesGet these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...
|
|
|