web 2.0

ASP.NET(vb.net) & Msgbox

ASP.NET(vb.net) & Msgbox How to test Msgbox,Messagebox (alert message) in a ASP.NET script.

ShotDev Focus:
- Messagebox in ASP.NET

Example

MsgBox.aspx

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="MsgBox.aspx.vb" Inherits="MsgBox" %>
<html>
<head>
<title>ShotDev.Com Tutorial</title>
</head>
<body>
<form id="form1" runat="server">
<asp:TextBox id="txtName" runat="server"></asp:TextBox>
<asp:Button id="btnSubmit" runat="server" Text="Submit" />
</form>
</body>
</html>

MsgBox.aspx.vb

Public Class MsgBox
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not Page.IsPostBack() Then
Page.RegisterClientScriptBlock("OnLoad", "<script>alert('Welcome to ShotDev.Com')</script>")
End IF
End Sub

Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
Page.RegisterClientScriptBlock("OnLoad", "<script>alert('Sawatdee " & Me.txtName.Text & "')</script>")
End Sub

End Class

Screenshot

Messagebox in ASP.NET
.
.
.
Download this script.
Download

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (No Ratings Yet)
Loading ... Loading ...

Leave a Reply

You must be logged in to post a comment.