Rank: Newbie Groups: Member
Joined: 3/4/2009 Posts: 1
|
why the message Javascript alert is not displayed in the button click event
Code: C#
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
namespace SAT.View
{
public partial class TesteEO : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void ButtonShowDialog_Click(object sender, EventArgs e)
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "PlainJavaScript", "alert('Javascript alert');", true);
}
}
}
Code: HTML/ASPX
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TesteEO.aspx.cs" Inherits="SAT.View.TesteEO" %>
<%@ Register assembly="EO.Web" namespace="EO.Web" tagprefix="eo" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<eo:Dialog runat="server" id="DialogAguarde" BackColor="White"
ControlSkinID="None" HeaderHtml="Aguarde..." Height="80px" Width="100px"
AllowMove="False">
<HeaderStyleActive CssText="background-image:url('00020311');color:black;font-family:'trebuchet ms';font-size:10pt;font-weight:bold;padding-bottom:5px;padding-left:8px;padding-right:3px;padding-top:0px;" />
<BorderImages BottomBorder="00020305" BottomLeftCorner="00020304"
BottomRightCorner="00020306" LeftBorder="00020303" RightBorder="00020307"
TopBorder="00020310" TopLeftCorner="00020301" TopLeftCornerBottom="00020302"
TopRightCorner="00020309" TopRightCornerBottom="00020308" />
<FooterStyleActive CssText="padding-right: 4px; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; padding-top: 4px; font-family: tahoma" />
<ContentTemplate>
<table border="0" width="100%">
<tr>
<td align="center">
<img src="../../Images/loading.gif" />
</td>
</tr>
<tr>
<td align="center" nowrap="true" align="center" bordercolor="Black"><b>Por favor aguarde...</b></td>
</tr>
</table>
</ContentTemplate>
<ContentStyleActive CssText="padding-right: 4px; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; padding-top: 4px; font-family: tahoma" />
</eo:Dialog>
<eo:CallbackPanel runat="server" id="CallbackPanel1"
LoadingDialogID="DialogAguarde"
Triggers="{ControlID:ButtonShowDialog;Parameter:}"
Width="90%">
<asp:Button ID="ButtonShowDialog" runat="server" Text="Show dialog"
onclick="ButtonShowDialog_Click" style="height: 26px" />
</eo:CallbackPanel>
</form>
</body>
</html>
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, Page.ClientScript.RegisterStartupScript will never work because it is intended to be executed when the page initially load, not when you AJAX Update your page. Please see this post for a possible solution for your scenario: http://www.essentialobjects.com/forum/postst2802_Is-EOWeb-Suite-has-similar-function-like-ScriptManagerRegisterClientScriptBlock.aspxThanks!
|