473,806 Members | 2,879 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Client side messagebox

5 New Member
Hello

I have a messagebox showing on the click of a button
it is a yes/no message box and so far it works in the localhost with MessageBox.Show

but when I publish the aspx page and run it on the server i get this error

"Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotifica tion or DefaultDesktopO nly style to display a notification from a service application. "

can anyone give me pinters what to do?

thanks for any help
Probi
Aug 4 '08 #1
1 2077
DrBunchman
979 Recognized Expert Contributor
MessageBox.Show will not work for an ASP.NET page because it is a server side message box.

You need to use client side script to fire a message box. Try using the following function instead when you want to display an alert style messagebox:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Message(ByVal sMessage As String)
  2.     Dim myscript As String = "alert('" & sMessage & "');"
  3.     Page.ClientScript.RegisterStartupScript(Me.GetType(), "myscript", myscript, True)
  4. End Sub
If you want to display a confirmation style messagebox then add the following to your asp.net server control:
Expand|Select|Wrap|Line Numbers
  1. OnClientClick="return confirm('Are you sure you want to proceed?');"
Hope this helps,

Dr B
Aug 5 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1228
by: ME | last post by:
In my server app I perform the following: //------------------------------------------- remoteObject remoteObj = new remoteObject(); ChannelServices.RegisterChannel(new TcpChannel(tcpPort)); ObjRef refSubManager = RemotingServices.Marshal(remoteObj, "remoteObject"); In the Client app I attempt to do this: //-------------------------------------------- TcpChannel chan = new TcpChannel();
7
4758
by: Ken Allen | last post by:
I have a .net client/server application using remoting, and I cannot get the custom exception class to pass from the server to the client. The custom exception is derived from ApplicationException and is defined in an assembly common to the client and server components. The custom class merely defines three (3) constructors -- the null constructor; one with a string parameter; and one with a string and innner exception parameter -- that...
2
2173
by: Rick Strahl [MVP] | last post by:
Run into an interesting problem today with a client of mine: They have an ASP.Net form that they want to drive through a client side HTTP interface. I know a Web Service would be a better way to go but in this case they want to try and consolidate a single interface for the 3 or 4 forms involved and drive them through a WebRequest Http client. The data is getting there no problem - it's retrievable with Request.Form. However ASP.net is...
5
1177
by: Dave | last post by:
I have a vb routine below where I'm trying to capture a name from a javascript prompt box. My application is inline VB on Visual Studio 2003. The prompt box does display, but when I type a string and hit OK or Cancel, the value 'ret' which I want to hold the value of the string, is always empty. And the status bar always says "Done but with errors on page." If I use a simpler control like alert or confirm, I get no problems. Can...
0
1465
by: Usman | last post by:
Hi I'm having problem with a scenarion where I have a server written in C# and client written in VC6++. Here is the server code that i'm using including the Callback function for handling clients. Also there's a commented code where i'm using TCPListener instead of simple Socket Class. The problem i'm having is that when I run this code using Socket class, the server starts well but "OnClientConnect" method never gets called. On...
10
2107
by: Betina Andersen | last post by:
I have inherited a VB.NET dll that I am using from common asp. My problem is to get the messages from the dll to the Ie client, I can see the messages in the Eventlog on the IIS server so I know they are there, but how do I get them to show in IE? The original code was: MsgBox("Kunne ikke finde databasenavn udfra den angivne DSN: " & DSN) I tried to change that to: Result = MessageBox.Show("Kunne ikke finde databasenavn udfra den...
5
8244
by: raghubr | last post by:
Hi all, Can any one pls guide me through..I need to transfer the file from server to client and client to server using sockets in an Asynchronous mode so this file transfer doesn't hinder the common process of connecting and of the server and client... here is the code i am trying to implement. this code snippet is for message transfer only for multiple clients. /////////////////////////////file receive method when sent from...
3
1599
by: hhendrickx | last post by:
Hello, I have a problem showing a multi-line client-side messagebox. Single-line works ok but multi-line does not. How can I show multi-line client-side messageboxes? Code: String message = ""; message = ers.Tables.Rows.ToString(); link.OnClientClick = "return confirm('" + message +"'),false;"; tc1.Controls.Add(link);
9
7273
by: =?Utf-8?B?U3RldmVuIFRhbmc=?= | last post by:
I want to download pfx from my asp.net server, add the pfx to client's X509Store as a trusted publisher, Is it possible? my func in aspx is like this: void InstallCertification() { try{ WebClient web = new WebClient(); string url = "http:/myaspserver/mydir/mykey_2008.pfx"; byte b = web.DownloadData(url);
0
9719
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10369
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10372
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10110
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9187
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6877
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5546
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5682
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3851
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.