473,699 Members | 2,570 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MessageBox in WebForms

You will need to use client side script to display a
message box:

The following code demonstrates the results of the alert
using a hidden input box, and javascript.

Do the following.
1. Create a webform and copy the following into the Load
function:
lblResult.Text = Request.Form("R eturnValue")
2. Switch to html view and copy the following from <html>
tag to </html> tag:
<HTML>
<HEAD>
<title>WebForm1 </title>
<meta name="GENERATOR " content="Micros oft
Visual Studio .NET 7.1">
<meta name="CODE_LANG UAGE" content="Visual
Basic .NET 7.1">
<meta name="vs_defaul tClientScript"
content="JavaSc ript">
<meta name="vs_target Schema"
content="http://schemas.microso ft.com/intellisense/ie5">
<Script language="javas cript">
function AskQuestion()
{
if (confirm('Quest ion
Here')) //Yes clicked if true
{

document.Form1. ReturnValue.val ue = "YES";
}
else // No clicked
{

document.Form1. ReturnValue.val ue = "NO";
}
return true;
}
</Script>
</HEAD>
<body MS_POSITIONING= "GridLayout ">
<form id="Form1" method="post"
runat="server">
&nbsp; <INPUT name="ReturnVal ue"
id="ReturnValue " style="Z-INDEX: 101; LEFT: 91px; WIDTH:
206px; POSITION: absolute; TOP: 85px; HEIGHT: 27px"
type="hidden" size="29">
<asp:Label id="lblResult" style="Z-
INDEX: 102; LEFT: 95px; POSITION: absolute; TOP: 51px"
runat="server"
Width="199px"></asp:Label>
<INPUT style="Z-INDEX: 103; LEFT:
88px; WIDTH: 269px; POSITION: absolute; TOP: 164px;
HEIGHT: 32px"
type="submit"
onclick="AskQue stion();" value="Submit">
</form>
</body>
</HTML>

3. Run it and click the button.

4. Look at the html to see how it works. It is pretty
simple.

HTH,

Billy Jacobs
-----Original Message-----
How can I get MessageBox in the WebForms?
I would like to display yes/no messagebox and wanted to
capture what value was clicked by the user(i.e., whether
yes or no).
.

Jul 19 '05 #1
0 3058

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3597
by: rachel | last post by:
Hi all, I am new in ASP.Net. I have a question on link multiple web forms together. Here is the scenario: I create an Index.aspx WebForm which consists of a banner and three navigator buttons as well as a body to load the content. It is exactly like a normal HTML page where there are banner, menu bar, and body to load content. In my case, there are three .aspx WebForms which I have to link them together in the Index.aspx page. So that...
1
1718
by: Paul R | last post by:
Hi, I have a Winforms application that access some SQLServer2000 stored procedures. I have now written some new Webforms pages to use some of the same stored procs. The Webforms use the SAME data access classes (all of my business logic and data access classes are in DLLs that are shared between the Winforms and Webforms).
3
1269
by: Netserver | last post by:
Hi have a question hope there is a simple answer. I want to enter data in to 2 arrays from several webforms in project and be able to recall that data from any of the webforms, other then using a querystring I tried creating a module as follows Module dataspecs Public ar1(0) As Integer Public ar2(0) As Integer End Module
20
2895
by: Martin Rosén-Lidholm | last post by:
Although an impossible question to answer, I fell urged to raise it anyhow. Given a fairly complex ERP application scenario, what's your estimation for the X-ratio dev. time for WebForms app
0
241
by: Billy Jacobs | last post by:
You will need to use client side script to display a message box: The following code demonstrates the results of the alert using a hidden input box, and javascript. Do the following. 1. Create a webform and copy the following into the Load function: lblResult.Text = Request.Form("ReturnValue")
4
3937
by: 3Cooks | last post by:
I have a windows application written in Visual Basic 6.0 that is going to be redeveloped in dotNET. We are trying to decide if we should deploy using Webforms or Winforms and I need advice from someone who is not on my team. The VB 6.0 application is used by approximately 100 users. All users reside in-house. There is an existing external website that will use some of the same components but the two applications are separate. The...
5
4940
by: Bit byte | last post by:
Can I use C# (Winforms) to design a website?. I am from C/C++ background but know nothing about Internet programming. My understanding of WebForms are that they are similar to WinForms in that they give a WYSIWYG environment for designing user interfaces - however, all searches I have done on WebForms display the actual HTML, not a WYSIWYG environment. My questions (finally) then are.
0
1937
by: JM | last post by:
Hi, I have uploaded an application written in asp.net 2.0 on server. By web controls started giving Javascript error and I figured it out from discussion groups that I have to put WebForms.js file with the aspx pages. But I am unable to find out WebForms.js file in .NET 2.0 . I have searched my PC also (I have VS 2005 and .NET 2.0) but unable to find WebForms.js file.
19
7605
by: PPrasanna | last post by:
I am back in .net after a long break.. i am stuck with a problem .. I have coded to display a message box using "System.Windows.Forms.MessageBox.Show " to show up based on condition and this works fine in my local machine but when i publish the site and put the .dll out for testing i am getting an error saying --------------------------- Microsoft Internet Explorer ---------------------------...
0
8689
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
8618
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,...
0
9035
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...
0
8885
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
7752
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
5875
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
4376
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
4631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2010
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.