473,405 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

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("ReturnValue")
2. Switch to html view and copy the following from <html>
tag to </html> tag:
<HTML>
<HEAD>
<title>WebForm1</title>
<meta name="GENERATOR" content="Microsoft
Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual
Basic .NET 7.1">
<meta name="vs_defaultClientScript"
content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
<Script language="javascript">
function AskQuestion()
{
if (confirm('Question
Here')) //Yes clicked if true
{

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

document.Form1.ReturnValue.value = "NO";
}
return true;
}
</Script>
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post"
runat="server">
&nbsp; <INPUT name="ReturnValue"
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="AskQuestion();" 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 3036

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

Similar topics

3
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...
1
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...
3
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...
20
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...
0
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....
4
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...
5
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...
0
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...
19
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
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,...

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.