提交页面是htm 页面,提交到a.aspx页面,接受之后提交到数据库,发现中文乱码。表单用的是post.如下<form action="cc.aspx?id={@id}" method="post" accept-charset="UTF-8">
        <div class="resume">
            <ul>
                            <li><div class="resume_nav">应聘职位:</div><div>业务代表</div></li>
                            <li><div class="resume_nav">姓名:</div><div><input name="TextBox1" type="text" id="TextBox1" /> *必填</div></li>
                            <li><div class="resume_nav">性别:</div><div>
                                <table id="RadioButtonList1" border="0">
<tr>
<td><input id="RadioButtonList1_0" type="radio" name="RadioButtonList1" value="男" checked="checked" /><label for="RadioButtonList1_0">男</label></td><td><input id="RadioButtonList1_1" type="radio" name="RadioButtonList1" value="女" /><label for="RadioButtonList1_1">女</label></td>
</tr>
</table>
                            </div></li> <li>
                                <div class="resume_nav"></div>
                                <div>
                                    <input type="submit" name="Button2" value="提交" onclick="return checkResume();" id="Button2" style="width:60px;" />
                                    <input type="submit" name="Button3" value="取消" id="Button3" style="width:60px;"  />
                                </div>
                            </li>
                        </ul>         
        </div>
        </form> cc.aspx页面           rsm.Zid = Convert.ToInt32(Request["id"].ToString());
            rsm.Rname = Request.Form["TextBox1"].ToString();
            rsm.Rsex = Request.Form["RadioButtonList1"].ToString();
            rsm.Rage = Convert.ToInt32(Request.Form["DropDownList1"]);
            rsm.Rhuji =  Request.Form["TextBox2"].ToString();
            rsm.Raddress = Request.Form["TextBox3"].ToString();
            rsm.Rshenfenzheng =  Request.Form["TextBox4"].ToString();
            rsm.Rjiehun = Convert.ToInt32(Request.Form["RadioButtonList2"]);
            rsm.Rtel =  Request.Form["TextBox5"].ToString();
            rsm.Rmail =  Request.Form["TextBox6"].ToString();
            rsm.Rxueli = Request.Form["DropDownList2"].ToString();
            rsm.Rjiaoyujingli =  Request.Form["TextBox7"].ToString();
            rsm.Rgongzuojingli =  Request.Form["TextBox8"].ToString();
            rsm.Rtechang =  Request.Form["TextBox9"].ToString();
            if (rsm.addResume() > 0)
            {
                Response.Write("<script>alert('提交成功');window.location.href=\"people1.htm\"</script>");
            }
            else
            {
                Response.Write("<script>alert('提交失败');window.location.href=\"people1.htm\"</script>");
            }
应该是编码设置问题,小弟菜鸟,各位指点下

解决方案 »

  1.   

    整个html头部贴出来看看,不看你表单的内容
    后台
    不要用request.form[""]
    直接Request[""]试试,
      

  2.   

    头部<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>{@tname}-{@title}</title>
        <meta name="Kyewords" content={@keywords} />
        <meta name="description" content={@contents} />
        <link href="Style.css" rel="stylesheet" type="text/css" />
    </head>
      

  3.   

    <title>{@tname}-{@title}</title>
        <meta name="Kyewords" content={@keywords} />
        <meta name="description" content={@contents} />
    先删除试试可行,
      

  4.   

    在cc.aspx页面把Request获取过来的值输出来看看是不是乱码,如果是乱码那是编码问题
    如果不是,可能是数据库字段类型问题,如果有中文应该定义为NVarChar而不是VarChar,插
    入的SQL语句应该加N,Insert into TableName select N'中文',N'乱码'
      

  5.   

    是数据库中的中文乱码吗?要是把数据库中相应的字段改为Nvarchar类型。
    再出现乱码 可以 Insert into a(name,sex) values(N'张三',N'男')
      

  6.   


    上面已经说过了,去了也不行,我是把form表单那里加上,接值那里也加上了,那样也不行,都去掉,一样不行