1,form表单提交到某个具体页面

<form id="search_form" name="search_form"  target="_blank" method="Post">    
            <input id="catid" name="catid" type="hidden" value="0"/>
                <input class="sb" type="submit" value="" onclick="return get()"/>
                  <script type="text/javascript">
                    function get()
                    {
                        if(document.getElementById("q").value=="")
                        {
                            alert("请输入搜索关键词!");
                            return false;
                        }
                        else
                        {
                            var type=document.getElementById("catid").value;
                 //中文编码的时候需要对参数编码 //var search=encodeURI(document.getElementById("q").value); //UTF-8的时候需要对参数进行编码 var search=document.getElementById("q").value;//gb2312的时候可以直接传参数 document.getElementById('search_form').action="/zhuanti/SubJectBrandSearch_"+type+"_"+search+"_1.html"; document.search_form.submit(); } } </script> </form>

 2.后台接收数据

//关键词解码,需要web.config配置gb2312编码格式
            Keyword = HttpUtility.UrlDecode(Function.SqlFilter(DtRequest.GetString("Key", true).ToString()));

3.web.config里面的配置

system.web 加上这一句,明确是什么编码
<globalization requestEncoding="gb2312" responseEncoding="gb2312" culture="zh-CN" fileEncoding="gb2312"/>

  

posted on 2015-06-25 18:02  等风起  阅读(849)  评论(0编辑  收藏  举报