Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 21st, 2004, 02:01 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Is that an ASP.NET app Snib?

 
Old April 21st, 2004, 03:23 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Oops, I thought this was just a .NET forum....
Sorry.

Snib

<><
 
Old April 22nd, 2004, 08:57 AM
Registered User
 
Join Date: Apr 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by planoie
 Now you have my curiosity. I would very much like to see it.
hi

 I will tell u what actually i did for getting the message box.This is the java script.

[u]1st write java script</u>

<script language="javascript">

function fnChangeTo()
    {
        alert("Hai u have called me")
        }
</script>

[u]then go to coding part(.vb) and type this in page_load event </u>

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

       Button1.Attributes.Add("onclick", "return fnChangeTo();")

End Sub

here Button1 refers to button id. Even we can use confirm instead of alert with ok/cancel button.

while running the application click the button, u will get a message box .

try this out.

regards

sriram


 
Old April 22nd, 2004, 09:07 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

I have used some version of that code on many, many occasions, but I don't see anything having to do with System.Windows.Forms.Messagebox.Show() in there which is what you claimed you were using. All I see is a standard javascript alert(), no "MessageBox".
 
Old April 22nd, 2004, 09:20 AM
Registered User
 
Join Date: Apr 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi

one of my previous post:

yes i know that. But in previous post it is given that it is not possible to use message box in asp.net.For that i post this one.
But still we can make use of java script to achieve this.

u'r post :

Ok, so you got me on sematics. Sure, it might be technically possible, but it's not very practical. In the end, with the intended use of a web application, it's not possible in practice.

in my next post : I have tried that and found it working for our project.

actually here i meant javascript only. sorry if i have ...






 
Old December 8th, 2006, 12:55 AM
Registered User
 
Join Date: Apr 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jdkulkarni Send a message via Yahoo to jdkulkarni
Default

Strange to see that but this code works at least on server. I have not checked on other mahcine.
MessageBox.Show("message", "Caption", 0, 0, 0, MessageBoxOptions.ServiceNotification);

--
Warm Regards
Jayant D. Kulkarni
Brainbench certifications in : C#, ASP.NET, .NET framework, ADO.NET.
 
Old December 8th, 2006, 01:00 AM
Registered User
 
Join Date: Apr 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jdkulkarni Send a message via Yahoo to jdkulkarni
Default

Just checked it. MessageBox is always populated on server desktop. It will create hell when thousands of user will access the site and there is message box for frequently occuring errors or events.

--
Warm Regards
Jayant D. Kulkarni
Brainbench certifications in : C#, ASP.NET, .NET framework, ADO.NET.
 
Old March 20th, 2008, 01:39 AM
Registered User
 
Join Date: Mar 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ScepterMT Send a message via Yahoo to ScepterMT
Default

Quote:
quote:Originally posted by jdkulkarni
 Strange to see that but this code works at least on server. I have not checked on other mahcine.
MessageBox.Show("message", "Caption", 0, 0, 0, MessageBoxOptions.ServiceNotification);

--
Warm Regards
Jayant D. Kulkarni
Brainbench certifications in : C#, ASP.NET, .NET framework, ADO.NET.
Using MessageBox.Show() this way will work, but only displays on the server. The reason for this is that the server is where your code is being processed. To get this to work on the client side you'll need to use code that is processed on the client side, like javascript.

The best way I've found to do this is to create a static class MessageBox with a static method Show(), which will give you the ablility to to still use the syntax MessageBox.Show("Your Message"); and convert it into window.alert("Your Message");.

The javascript alert() function is limited as it doesn't provide any overloads for changing the caption of the MessageBox, but it still works nicely.

I've written a how to on my blog at: http://sceptermt.blogspot.com/2008/0...lass-in-c.html that shows the source code that I used in C# for my web application and details on how it works.

You could also write overloads for the static show() method to allow the class to do a javascript confirm() or a prompt(). I haven't needed that functionality yet so I've just kept it simple.

If I ever do want to use it I'll update the how to at my blog.

Check This out: http://www.sceptermarketingtechnologies.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
messagebox.show bikki_suresh ASP.NET 1.0 and 1.1 Basics 3 March 20th, 2008 04:26 AM
MessageBox.Show() jyoti_khera General .NET 2 November 23rd, 2004 06:32 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.