.net注册js,设定js值
StringBuilder sbProperty;
propertyQueryString = Request.QueryString["property"];
sbProperty=new StringBuilder();
sbProperty.Append("var selProperty=[];");
if (!string.IsNullOrEmpty(propertyQueryString))
{
string[] arr = propertyQueryString.Split('=');
searchPropertyId = arr[0];
searchPropertyValue = arr[1];
}
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "SearchProperty", sbProperty.ToString(), true);
}
<script type="text/javascript">
function btnSearch_Click() {
var sb = new StringBuilder();
for (var i = 0; i < selProperty.length; i++) {