杂记

Question.htm页面以弹出窗口显示
 
<tr>
                        <td class="loginQuestion">
                            <ahref="javascript:window.showModalDialog('Question.htm','','dialogWidth:520px;dialogHeight:600px; dialogTop:'+(window.screen.availHeight-600)/2+';dialogLeft:'+(window.screen.availWidth -500)/2 +';scroll:yes;resizable:no;status:no')">ID and Password Questions</a>
                            <p />
                            <a class="loginQuestion" href="#"></a>
                        </td>
                    </tr>
 
2
<a href="javascript:Clearform();">
 
href可以调用js的方法
 
3
textbox写在后台的鼠标事件
txtSearch.Attributes["onkeypress"= "var textSearch = document.getElementById('" +txtSearch.ClientID + "'); textSearch.style.color='Black';if (event.keyCode==13)   {  clickObj(document.getElementById(\"aGoLink\"));   return   false;}";
                txtSearch.Attributes["onfocus"= var textSearch = document.getElementById('" +txtSearch.ClientID + "');if(document.activeElement.id   ==   this.id && (textSearch.value.Trim()=='EAI/APM Code/App. Name/Alias'|| textSearch.value.Trim()=='No Matching Records Found.')) { textSearch.style.fontSize='14px';textSearch.style.color='Black';textSearch.value='';}";
txtSearch.Attributes["onBlur"= var textSearch = document.getElementById('" + txtSearch.ClientID+ "');if (textSearch.value.Trim()==''){textSearch.style.fontSize='11px';textSearch.value = ' EAI/APM Code/App. Name/Alias ';textSearch.style.color = '#cccccc';}";
 
4
function IsAuthenticated()
    {
        /* Create a new XMLHttpRequest object to talk to the Web server */
        /*@cc_on @*/
        /*@if (@_jscript_version >= 5)
        try {
          xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
        catch (e) {
          try {
            xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
          catch (e2) {
            xmlHttp = false;
          }
        }
        @end @*/
        if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
          xmlHttp = new XMLHttpRequest();
        }
        //xmlHttp = new ActiveXObject("Microsoft.XMLHttp");
        xmlHttp.open("GET", "WebAjaxIsAuthenticated.aspx?r=" +new Date().getTime(), false);
        xmlHttp.send(null);
        if (xmlHttp.readyState == 4) {
            response = xmlHttp.responseText;
            //alert(response);
            if(response=="0")
                return(true);
            else
                return(false);
        }
        return(false);
    }
 
public partial class WebAjaxIsAuthenticated : System.Web.UI.Page
    {
        protected void Page_Load(object senderEventArgs e)
        {
 
            if (HttpContext.Current.User.Identity.Name.ToString() != "" &&
                (Session["UserAutorization"as UserAuthorization!= null)
                Response.Write(0);
            else
                Response.Write(1);
            Response.End();
        }
}
 
6
Textbox以横线的形式显现
  <input id="txtEventName" maxlength="100" runat="server"
              type="text" class="textBoxStyle" style="width: 120px" />
 
.textBoxStyle
{
      border-left-stylenone;
      border-left-width0px;
      border-right-stylenone;
      border-right-width0px;
      border-top-stylenone;
      border-right-width0px;
      border-bottom-stylesolid;
      border-bottom-width1px;
      font-familyverdana , Arial, Helvetica, sans-serif;
      font-size0.69em;
}
10
后台执行js
Page.ClientScript.RegisterStartupScript(this.GetType(), "fi1"initializtionScripts);
11
var url = '<%=this.ResolveUrl("~/HolidayCalendar/WebAjaxExportHolidayCalendar.aspx")%>' + '?' +queryString;
document.getElementById("exportFrame").src = url;
ResolveUrl是把服务器的url解析为绝对路径
12
window.top.location.reload();会重新执行页面(包括pageload()

posted on 2013-03-23 21:57  Amity  阅读(159)  评论(0编辑  收藏  举报