943,987 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Marked Solved
  • Views: 13185
  • ASP.NET RSS
You are currently viewing page 2 of this multi-page discussion thread; Jump to the first page
Feb 19th, 2009
0

Re: MessageBox in C#

So this is a Web application in c#.net
Well then you cannot use the Messagebox. This function / method
is used within an windows application
As mention earlier , you can solve this by using Javascript or ms.Ajax (Popup /modalpopup)
Reputation Points: 10
Solved Threads: 1
Newbie Poster
frank@furnes.nu is offline Offline
12 posts
since Feb 2009
Feb 19th, 2009
0

Re: MessageBox in C#

Hmmm Fine....
In C# we have to use script for messageBox.Okay let me do.
Tnx...
Reputation Points: 10
Solved Threads: 1
Light Poster
sonakrish is offline Offline
34 posts
since Dec 2008
Feb 19th, 2009
0

Re: MessageBox in C#

Select the function name "MsgBox", right click and from the menu select Go to Defenition and post the fuction defenition here. I suppose its a user defined function
Reputation Points: 16
Solved Threads: 18
Junior Poster
Aneesh_Argent is offline Offline
104 posts
since Dec 2008
Feb 19th, 2009
0

Re: MessageBox in C#

Hi again

I yust wonder who this could be done..
Do as i told over.. in button click method
ASP.NET Syntax (Toggle Plain Text)
  1. System.Windows.Forms.MessageBox.Show("This is a message");

then select: project -> add reference
Then scroll down to System.Windows.Forms and select this.
Press ok
Reputation Points: 10
Solved Threads: 1
Newbie Poster
frank@furnes.nu is offline Offline
12 posts
since Feb 2009
Feb 19th, 2009
0

Re: MessageBox in C#

Hi,

I dont think what Frank is saying will work when deployed (But i will gladly be proven wrong as i would like to be able to use the messagebox functionality in an asp.net app). The messagebox will throw an exception because you can not show a modal form on a clients machine when it is created server side. The only real option avaliable is to Use javascript or Ajax as someone has mentioned earlier in this thread.
Reputation Points: 10
Solved Threads: 2
Newbie Poster
Jamie Shedley is offline Offline
5 posts
since Feb 2009
Feb 19th, 2009
0

Re: MessageBox in C#

I must say i have never tried this before
So Yes, the best right way is by javascript..
Reputation Points: 10
Solved Threads: 1
Newbie Poster
frank@furnes.nu is offline Offline
12 posts
since Feb 2009
Mar 25th, 2011
0

Try this

Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "SCRIPT", string.Format("alert('Hello World')"), true);
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sanchu666 is offline Offline
1 posts
since Mar 2011

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: Latitude and longitude conversion
Next Thread in ASP.NET Forum Timeline: Log In Credentials





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC