Exit code and prompting message box

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Jun 2007
Posts: 19
Reputation: ruhi is an unknown quantity at this point 
Solved Threads: 0
ruhi ruhi is offline Offline
Newbie Poster

Exit code and prompting message box

 
0
  #1
Jun 16th, 2007
hello everyone,
how to write exit code in visual studio.Net so that whole program closes on button click event?
And how Message box is created, also how to take input from user as we do in javascript using prompt command?
Can anyone help me in this.....
Thanx in advance.
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 19
Reputation: ruhi is an unknown quantity at this point 
Solved Threads: 0
ruhi ruhi is offline Offline
Newbie Poster

Re: Exit code and prompting message box

 
0
  #2
Jun 18th, 2007
i got the exit code. i am writing here if it helps anyone..
this will be written within button click event
  1. Response.Write("<script>window.close();</script>")
And also like below we can write by assigning attribute.
This we will write in page load event
  1. Button1.Attributes.Add("OnClick", "window.close();")
This both codes will close the window we are using on clicking the exit button.

But still i dont noabout message box with taking the input from user can anyone help me in that...
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 2
Reputation: naman sisodia is an unknown quantity at this point 
Solved Threads: 1
naman sisodia naman sisodia is offline Offline
Newbie Poster

Re: Exit code and prompting message box

 
0
  #3
Jun 18th, 2007
Originally Posted by ruhi View Post
hello everyone,
how to write exit code in visual studio.Net so that whole program closes on button click event?
And how Message box is created, also how to take input from user as we do in javascript using prompt command?
Can anyone help me in this.....
Thanx in advance.

hi ruhi
this is naman.
well your quest is very nice.

if you r talking about vb.net then there is one function "END()"
write it in to the button click event.
and for the message box.
there is one function "msgbox("your message")" write it anywhere in any button click or the page load event.
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 19
Reputation: ruhi is an unknown quantity at this point 
Solved Threads: 0
ruhi ruhi is offline Offline
Newbie Poster

Re: Exit code and prompting message box

 
0
  #4
Jun 18th, 2007
Actually i m using visual studio .net but thanks for your reply naman and i just got the answer.If any one would like to refer...
In the parent page we will have say one textbox and one button then the code for it is
parent.aspx
in html code we have
  1. <asp:TextBox id="first" style="Z-INDEX: 101; LEFT: 16px; POSITION: absolute; TOP: 24px" runat="server"></asp:TextBox>
  2. <asp:Button id="Input" style="Z-INDEX: 102; LEFT: 176px; POSITION: absolute; TOP: 24px" runat="server" Text="Open..."></asp:Button>
and parent.aspx.vb
in page load event we will write
  1. Input.Attributes.Add("onclick", "var strReturn; strReturn=window.showModalDialog('child.aspx',null,'status:no;dialogWidth:370px;dialogHeight:220px;dialogHide:true;help:no;scroll:no');if (strReturn != null) document.getElementById('first').value=strReturn;")

And suppose child page
child.aspx
if it contains one textbox and two buttons again in html window
  1. <asp:TextBox id="second" style="Z-INDEX: 101; LEFT: 16px; POSITION: absolute; TOP: 24px" runat="server"></asp:TextBox>
  2. <asp:Button id="btnOK" style="Z-INDEX: 103; LEFT: 48px; POSITION: absolute; TOP: 56px" runat="server" Text="Ok" Width="56px"></asp:Button>
  3. <asp:Button id="btnCancel" style="Z-INDEX: 102; LEFT: 112px; POSITION: absolute; TOP: 56px" runat="server" Text="Cancel"></asp:Button>
and child.aspx.vb will have in the page load event
  1. btnOK.Attributes.Add("onclick", "window.returnValue = document.getElementById('second').value; window.close();")
  2.  
  3. btnCancel.Attributes.Add("onclick", "window.close();")
Complete.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the ASP.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC