PDA

View Full Version : مشکل در نمایش لحظه به لحظه زمان



mahdi68
دوشنبه 14 تیر 1389, 14:06 عصر
سلام
مشکل کد من کجاست که این پیغام میده !!!!

Server Error in '/WebSite1' Application.

The control with ID 'Timer1' requires a ScriptManager on the page. The ScriptManager must appear before any controls that need it.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: The control with ID 'Timer1' requires a ScriptManager on the page. The ScriptManager must appear before any controls that need it.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:

[InvalidOperationException: The control with ID 'Timer1' requires a ScriptManager on the page. The ScriptManager must appear before any controls that need it.]
System.Web.UI.Timer.get_ScriptManager() +318713
System.Web.UI.Timer.OnPreRender(EventArgs e) +21
System.Web.UI.Control.PreRenderRecursiveInternal() +80
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842

Version Information: Microsoft .NET Framework Version:2.0.50727.4927; ASP.NET Version:2.0.50727.4927 اینم کد :
<%@ Page Language="C#‎" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!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 runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<BR> Current Time is :<asp:TextBox
ID="TextBox1" runat="server"></asp:TextBox>
<asp:Timer ID="Timer1" runat="server" Interval="1000" ontick="Timer1_Tick1">
</asp:Timer>
&nbsp;<div>

<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />

</div>
<p>
&nbsp;</p>
</form>
</body>
</html>

میخوام زمان نشون بده ثانیه به ثانیه

profnami
دوشنبه 14 تیر 1389, 14:10 عصر
متن خطا داره فریاد میزنه که Script manager نداره !

mahdi68
دوشنبه 14 تیر 1389, 14:19 عصر
خوب اون چی هست ؟؟؟

profnami
دوشنبه 14 تیر 1389, 14:26 عصر
دوست عزیز شما تا حالا با Ajax کار نکردید . بهتره یه مقاله برای شروع کارتون با ajax بخونید . script manager برای کنترل script های ajax تو صفحه کاربرد داره ( تو همون قسمت که timer رو پیدا کردید میتونید پیداش کنید ! ). تازه بعد از این هم شما باید label رو داخل یه updatepanel بزارید . در نتیجه این کدها کاملا اشتباه هستند .