example of ajax control "DynamicPopulate" using asp.net
DynamicPopulate.aspx
<%@ Page Language="C#"
AutoEventWireup="true"
CodeFile="DynamicPopulate.aspx.cs"
Inherits="DynamicPopulate"
%>
<%@ Register Assembly="AjaxControlToolkit"
Namespace="AjaxControlToolkit"
TagPrefix="asp"
%>
<!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">
<script type="text/javascript">
function
updateDateKey(value) {
var
behavior = $find('dp1');
if(behavior)
{
behavior.populate(value);
}
}
Sys.Application.add_load(function(){updateDateKey('Alik
Levin');});
</script>
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:ToolkitScriptManager ID="ScriptManager1" runat="server"></asp:ToolkitScriptManager>
<div>
<asp:DynamicPopulateExtender ID="DynamicPopulateExtender1" runat="server"
BehaviorID="dp1"
TargetControlID="form1$Label1"
ClearContentsDuringUpdate="true"
ServiceMethod="GetHtml">
</asp:DynamicPopulateExtender>
<input type="radio"
name="rbFormat"
id="r0"
value='alik'
onclick="updateDateKey(this.value);"
checked="checked" />click
to set 'alik'<br/>
<input type="radio"
name="rbFormat"
id="Radio1"
onclick="updateDateKey(this.value);"
value='levin' />click
to set 'levin'<br
/>
<asp:Label ID="Label1" runat="server"
ForeColor="Red"
Text="Label"></asp:Label>
</div>
</form>
</body>
</html>
DynamicPopulate.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class DynamicPopulate : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
0 comments :