Hlo Professionals!
I am executing the dynamic populate control but in output it does not work. I want toget date on button click but its not working.
Here Is my code
Please execute it.
Aspx<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm52.aspx.cs" Inherits="WebApplication14.WebForm52" %><!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"><title></title></head><body><form id="form1" runat="server"><div><asp:ScriptManager ID="Script1" runat="server"></asp:ScriptManager><h3>Dynamic Populate</h3><asp:Button ID="Button5" runat="server" Text="Get Date" BackColor="Black" ForeColor="#FFCC00" Width="140px" Height="35px" /><br /><br /><asp:Label ID="Label2" runat="server" ></asp:Label><ajaxToolkit:DynamicPopulateExtender ID="Label2_DynamicPopulateExtender" runat="server" PopulateTriggerControlID="Button5" ClientIDMode="Static" TargetControlID="Label2" ServiceMethod="GetData" /></div></form></body></html>C# using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace WebApplication14 { public partial class WebForm52 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { } } [System.Web.Script.Services.ScriptMethod()] [System.Web.Services.WebMethod] public static String GetData() { return "Today is" + DateTime.Now.ToLongDateString(); } } }