您好,欢迎来到佳博论文网!

计算机专业毕业设计:[107]用户权限设计5

天使将会展现网站编程最真实的一面,包括编程中遇到的一些错误指令的处理,网站调试过程,排查代码错误等,通过本系列经验,相信你在.net网站开发方面会有一个很大的提升。同时也希望小伙伴们喜欢天使的经验,把我的经验分享给更多需要帮助的人。后面功能模块比较深入,大家不懂的可以先看看前面的经验。

工具/原料

我们实现了将需要编辑的权限组显示在界面上,下一步是要保存权限组信息

双击【保存修改】按钮,进入代码编辑界面

string ID = Request.QueryString["new_id"].ToString();

        string group_id = txtgroup_id.Text.Trim();

        string group_name = txtName.Text.Trim();

        string other = txtOther.Text.Trim();

        if (group_id != "" && group_name != "" && other != "")

        {

            string sql_change = "update news set group_id='" + group_id + "',group_name='" + group_name + "',other='" + other + "' where group_id='" + ID + "'";

            if (myclass.ExCom(sql_change))

            {

                Response.Write("<script>alert('权限组:'+'" + txtName.Text + "'+' 修改成功!')</script>");

            }

        }

        else

        {

            Response.Write("<script>alert('必填字段不能为空');location='user_center.aspx'</script>");

            //Page.Response.Redirect("new_edit.aspx?new_id=" + ID);

        }

保存并启动调试程序,进入个人中心

点击【权限组管理】编辑相应的权限组

修改文字信息之后,点击【保存修改】

提示【修改成功】