Thank you for using Microsoft Newsgroup Service. Based on your description,
you want to popup a message box when a
ASP.NET server button is clicked. Is my understanding of your problem
correct?
If so, you may try use the ServerControl's "Attributes" collection property
to add the client side event binding. For example:
You've a ASP.NET button in page named "btnPop"
then in the page class, add such code:
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
btnPop.Attributes.Add("onclick","alert(\"hello\")");
}
Then when the server button is clicked, it'll first run the client side
script and then post back to the server side. You may have a try to check
out the above suggestion.
If you have any questions on it, please feel free to let me know.
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
RegisterStartupScript("startupScript", "<script
language=JavaScript>alert('This is my message.');</script>");
Here's more info:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWebUIPageClassRegisterStartupScriptTopic.asp
--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com
"kai" <kail...@earthlink.net> wrote in message
news:vErKb.11468$6B....@newsread1.news.atl.earthlink.net...
Kai
"Steve C. Orr [MVP, MCSD]" <St...@Orr.net> wrote in message
news:%23PtE26C...@TK2MSFTNGP09.phx.gbl...
I implement your suggestion using VB.NET code:
Public Class WebForm1
Inherits System.Web.UI.Page
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
btnPop.Attributes.Add("onclick", "alert(\'hello\')")
End Sub
End Class
HTML code is:
<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="WebForm1.aspx.vb" Inherits="WebApplication6.WebForm1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>WebForm1</title>
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<asp:Button id="btnPop" runat="server"></asp:Button>
</form>
</body>
</HTML>
I get error message:
"Run time error has occured. Do you whish to debug?
Line 10
Error: Invalid character"
What did I do wrong?
Thank you veru much for helping.
Kai
"Steven Cheng[MSFT]" <v-sc...@online.microsoft.com> wrote in message
news:lQQsSHC1...@cpmsftngxa07.phx.gbl...
Or write it as in the example you were given with regular quotes.
btnPop.Attributes.Add("onclick","alert(\"hello\")");
Bob Lehmann
"kai" <kail...@earthlink.net> wrote in message
news:_SzKb.11826$6B....@newsread1.news.atl.earthlink.net...
Kai
"Bob Lehmann" <none> wrote in message
news:%23xQhQlG...@TK2MSFTNGP12.phx.gbl...
MessageBox for ASP.NET from http://www.bassilsoft.com
It have a cool pop up messagebox feature that you wanted.
You can find the source code in its samples when finish installing it.
"bassil" <anon...@discussions.microsoft.com> wrote in message
news:96212747-93F8-4AEB...@microsoft.com...
or
http://www.microsoft.com/india/msdn/articles/119.aspx
--
Saravana
Microsoft MVP - ASP.NET
www.extremeexperts.com
"bassil" <anon...@discussions.microsoft.com> wrote in message
news:96212747-93F8-4AEB...@microsoft.com...
--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
"Gönen EREN" <ge...@fenixidea.com> wrote in message
news:evlFCXyC...@TK2MSFTNGP09.phx.gbl...