people face lot of problems in creating message boxes like in desktop applications in asp.net, there are lot of ways of calling javascript alerts, but here i would explain how to generate a message box in asp.net..
for that , create a class and name it Messages.cs in App_Code. the class will have a single method to generate the message box like as follows -
-
using System;
-
using System.Collections.Generic;
-
using System.Linq;
-
using System.Web;
-
using System.Web.UI;
-
-
/// <summary>
-
/// Summary description for Messages
-
/// </summary>
-
public class Messages
-
{
-
public Messages()
-
{
-
//
-
// TODO: Add constructor logic here
-
//
-
}
-
-
-
public void CreateMessageAlert(string strMessage)
-
{
-
Guid guidKey = Guid.NewGuid();
-
Page pg = (Page)HttpContext.Current.Handler;
-
string strScript = "alert('" + strMessage + "');";
-
pg.ClientScript.RegisterStartupScript(pg.GetType(), guidKey.ToString(), strScript, true);
-
}
-
}
-
-
now in your page where ever you want to display an OK message box , you can call like this -
Messages myMsg=new Messages(); // create the object
-
myMsg.CreateMessageAlert("Your Message Here");
-
-
...
Addan
1 23764
'ASP.net MessageBox
'Add a scriptmanager to the ASP.Net Page
<asp:scriptmana ger id="ScriptManag er1" runat="server" />
try:
Dim sMsg As String = "My Message"
ScriptManager.R egisterStartupS cript(Page, Page.GetType, Guid.NewGuid(). ToString(), "alert('" & sMsg & "')", True)
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: dog |
last post by:
I've seen plenty of articles on this topic but none of them have been
able to solve my problem.
I am working with an Access 97 database on an NT4.0 machine, which has
many Access reports.
I want my users to be able to select a report, click on a command
button on a form, which will then automatically create the report as a
pdf file and save it to the user's machine.
I am using Adobe Acrobat (5.0 I think) and have Adobe Distiller as a
|
by: Tingo |
last post by:
Hi all,
Is it possible to create a message queue with a specific ID? I want to
do this because I'm trying to write a piece of software which restores
communicating processes (which communicate through message queues) when
there is a machine failure. When restarting the machine I need to setup
the message queues as they were originally.
I find that given the same key, when creating a queue, the queue ID is
not always the same value. Is...
|
by: deepak |
last post by:
I have to create message queue at remote machin. My code works properly when
i use console application in c#. But it throws exception whenever i try it on
web application in c#. My code is
MessageQueue.Create("FormatName:DIRECT=OS:MachineName\\QueueName");
or
MessageQueue.Create("MachineName\\QueueName");
|
by: I_AM_DON_AND_YOU? |
last post by:
There is one more problem I am facing but didn't get the solution. In my
Setup Program I am not been able to create 2 things (when the program is
intalled on the client machine ) : (1) create shortcut to my program/utility
(2) Entry in Windows' Start --> Program Menu.
Actually in my VB.Net solution I have two projects (1) MYPROGRAM (2)
MYPROGRAM_INSTALLER. MYPROGRAM is a "Windows Application".
MYPROGRAM_INSTALLER is a "SetUp Wizard"...
|
by: Zack Sessions |
last post by:
Has anyone tried to create a SQL7 view using the CREATE VIEW command
and ADO.NET? If so, is there a trick in trapping a SQL error when
trying to create the view? I have a VB.NET app that, amoung other
things, can create views based on existing tables and a table of
column name equivalents. If I accidently introduce a column name
equivalent that is the same as another column, I end up with a CREATE
VIEW SQL statement that is in error, if...
| |
by: Ikkezelf |
last post by:
Hi,
I was wondering if it's possible to write a message in the windows
message queue by means of c.
Already searched a lot through this newsgroup and others. I noticed
that it is possible with the use of c++, but i use "normal" c script.
I just want something that looks simple, but as I can't find it, it
seems not that simple at all.
|
by: max |
last post by:
Hello,
I am a newbye, and I'm trying to write a simple application.
I have five tables with three columns; all tables are identical; I need to
change some data in the first table and let VB updates the same data in all
other four tables in the right places.
I know it would be possible by using the ForeignKeyConstraint object. I have
created the tables using the DataSet Visual Tool and I know it doesn't
create any ForeignKeyConstraint obj....
|
by: kvadro |
last post by:
Hi. I am new in this website. How to create message box, with buttons, and icons? And of course, with text?
|
by: aadsaca |
last post by:
hi there,
I just want to know if
it is possible
to create
Message Queue on other Computer?
if yes,
how to do it?
tnx,
|
by: Laetitia |
last post by:
Hi All
Please can anyone advise whether it is possible to display messages in
the status bar.
I have a number of update queries which will be run and need to find a
way to identify which field is currently being updated so that I can
monitor the progress.
I know that I can use InputBox to display the variable table and field
|
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...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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...
|
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...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |