工作小记

DateTime.Now.ToString("yyyy-MM-dd HH//:mm")--用24小时制度显示

linkq 学习 http://www.tzwhx.com/newOperate/html/1/11/116/15404.html

System.Web.HttpContext.Current.Request.PhysicalApplicationPath: 获得网站根目录路径

 

读取xml问题:

 DataTable dt= new DataTable ();
            dt.ReadXml(System.Web.HttpContext.Current.Request.PhysicalApplicationPath + "Web.sitemap");

运行到最后一句出错:DataTable   does   not   support   schema   inference   from   Xml.
所以用下面语句执行:

 DataSet ds = new DataSet();
            ds.ReadXml(System.Web.HttpContext.Current.Request.PhysicalApplicationPath + "Web.sitemap");

 

JQuery.Ajax--遍历类成员

    $(document).ready(function () {
        $.ajax({
            type: "GET",
            url: "/HOME/GetMenu",
            dataType: 'json',
            success: function (json) {
                var menuplace = $("#leftmenuid");
                var data = json.data;
                $.each(data, function (n, value) {

                });
            },
            error: function (e) {
                alert(e);
            }
        });
    });

 

---------------------------------------------

--操作查询出来记录的每一个对象

 $(".xt").each(function () {
                    var parentarea = $(this).children().children(0);
                    //前四个是选项,后两个是问题id和答案id
                    JudgeOption(parentarea);
                }
                );

checkbox:      var objvalue = $(obj)[$(obj).length - 1].children[1].value;
 父目录的前一个兄弟:  var objparent = $(obj).parent().parent().prev(".question");

-----------------------------------------------------------------------

当鼠标移动上去后,加个边框

.mouseseoverstyle{ border:1px solid white}(默认的边框,这样就不会出现鼠标移动到上面后,加上边框出现移动的情况了
.mouseselected{ border:1px solid green; background-color:#f4f4f4}

------------------------------------

jquery each

            $(".dy_box li").each(function () {
                $(this).mouseout(function () {
                    $(this).removeClass("mouseselected");
                });
            });

找到对象数组,并且通过each,对每个对象操作

---css vertical-align:middle

答案:不起作用的时候,查看 min-height  和 line-height保证它们相同可以解决问题

 

FORM验证:FormsAuthentication.SignOut()

登陆:

            string userroles=string.Empty;
            FormsAuthenticationTicket Ticket = new FormsAuthenticationTicket(1, Login1.UserName, DateTime.Now, DateTime.Now.AddMinutes(30), false, userroles);
            string HashTicket = FormsAuthentication.Encrypt(Ticket);
            HttpCookie UserCookie = new HttpCookie(FormsAuthentication.FormsCookieName, HashTicket);
            FormsAuthentication.SetAuthCookie(Login1.UserName,false);
            Response.Cookies.Add(UserCookie);
            FormsAuthentication.RedirectFromLoginPage(Login1.UserName, true);
            Response.Redirect("WebForm1.aspx");

退出:

            FormsAuthentication.SignOut();
            Session.Abandon();

           //这两行很重要,要清除缓存,否则不能退出
            Response.Cache.SetExpires(DateTime.Now.AddMinutes(-1));
            Response.Cache.SetCacheability(HttpCacheability.NoCache);
            Response.Cache.SetNoStore();

 如何让radiobuttonlist控件和他后面的控件在同一行,不要换行

RepeatDirection="Horizontal"   RepeatLayout="Flow"

 

浮动元素的高度

<div>

   <div style="float:left"></div>

</div>

说明:因为有浮动,要想外面的div得到高度,必须清除浮动,如下面代码

<div>

   <div style="float:left"></div>

 <div style="clear:both"></div>

</div>

 

你可能感兴趣的:(工作,function,webform,div,login,dataset)