string value = "";
public string GetCallbackResult()
{
return value;
}
/// <summary>
/// 这是判断数据库中是不是已经有了该广告的方法
/// </summary>
/// <param name="eventArgument"></param>
public void RaiseCallbackEvent(string eventArgument)
{
if (ValidateTitle())
{
value = "1";
}
else
{
value = "0";
}
}
<script type="text/javascript">
//调用服务器端得方法
function CallServer()
{
var value =document.getElementById("txtTitle").value;
<%= ClientScript.GetCallbackEventReference(this, "value", "CheckExists","")%>;
}
function CheckExists(value)
{
if(value >= 1)
{
alert("该品牌推荐名称已经存在,请换别的名称");
}
else
{
alert("此名称可以使用!");
}
}
</script>