.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++) {

posted @ 2009-03-04 11:51  子午  阅读(421)  评论(0编辑  收藏  举报