<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<script type="text/javascript">
function updateDateKey(value)
{
var behavior=$find('dpe');
if(behavior)
{
behavior.populate(value);
}
}
Sys.Application.add_load(function() {updateDateKey('N');});
</script>
<div style="text-align: center">
<input id="Normal" checked="checked" name="DateGroup" type="radio" value="N" οnclick="updateDateKey(this.value)" />普通型<br />
<input id="ShortDate" name="DateGroup" type="radio" value="S" οnclick="updateDateKey(this.value)" />短日期<br />
<input id="LongDate" name="DateGroup" type="radio" value="L" οnclick="updateDateKey(this.value)" />长日期<br />
<br />
<asp:Panel ID="Panel1" runat="server" CssClass="DPENormal" Height="45px" Width="271px">
</asp:Panel>
</div>
<cc1:DynamicPopulateExtender ID="dpe" runat="server" TargetControlID="Panel1" UpdatingCssClass="DPEUpdating" ServiceMethod="GetGroupDate">
</cc1:DynamicPopulateExtender>
</form>
.DPENormal
{
border:silver 1px inset;
padding:2px;
text-align:center;
height:2em;
margin:5px;
width:200px;
}
.DPEUpdating
{
background-image:url(images/loading.gif);
background-repeat:no-repeat;
border:silver 1px inset;
padding:2px;
text-align:center;
height:2em;
margin:5px;
width:200px;
}
protected void Page_Load(object sender, EventArgs e)
{
}
[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]
public static string GetGroupDate(string contextKey)
{
System.Threading.Thread.Sleep(1000);
string value;
if (contextKey == "N")
{
value = DateTime.UtcNow.ToString();
}
else if(contextKey == "S")
{
value = DateTime.Now.ToShortDateString();
}
else
{
value = DateTime.Now.ToLongDateString();
}
return value;
}