Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

dynamically populate control does not work?

$
0
0

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();
        }

    }
}



 


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>