23
2015
03

Silverlight页面动态生成添加控件

 

public partial class dynamicControl : UserControl
    {
        public dynamicControl()
        {
            InitializeComponent();

17
2015
03

RadGrid 默认多字段分组和选择列

 

 

 

<body>
    <form id="form1" runat="server">
    <div>
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <asp:ScriptReference Assembly="Telerik.Web.UI"
                    Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI"
                    Name="Telerik.Web.UI.Common.jQuery.js" />
            </Scripts>
        </telerik:RadScriptManager>

05
2015
03

重构artDialog.prompt方法,让它支持多行文本

 

 

        artDialog.prompt = function (content, yes, value) {
            value = value || '';
            var input;

06
2015
01

Radgrid实现行合并

 

 


  public static void MergeRows(RadGrid RadGrid1)
        {
            for (int i = RadGrid1.Items.Count - 2; i > 0; i--)
            {
                if (RadGrid1.Items[i][RadGrid1.Columns[0]].Text == RadGrid1.Items[i - 1][RadGrid1.Columns[0]].Text)
                {
                    RadGrid1.Items[i - 1][RadGrid1.Columns[0]].RowSpan = RadGrid1.Items[i][RadGrid1.Columns[0]].RowSpan < 2 ? 2 : RadGrid1.Items[i][RadGrid1.Columns[0]].RowSpan + 1;                    
                    RadGrid1.Items[i][RadGrid1.Columns[0]].Visible = false;
                    //RadGrid1.Items[i][RadGrid1.Columns[0]].Text = "&nbsp;"; 
                }
            }
            //To mau lai cho Radgird
            foreach (GridDataItem dataItem in RadGrid1.Items)
            {
                foreach (GridColumn col in RadGrid1.MasterTableView.RenderColumns)
                {
                    //if (dataItem[col.UniqueName].Text == string.Empty)
                    dataItem[col.UniqueName].Style.Add("border-left", "solid 1px #ededed");
                }
            }   
        }

25
2014
12

控件包含代码块(即 <% ... %>),因此无法修改控件集合。

 

 


ASP.net 调试出现如下错误,
控件包含代码块(即 <% ... %>),因此无法修改控件集合。

元原因是的 在  <head></head> 之间 有  runat="server" 元素,并且里面又有 <% %> , 这两个是不兼容的

23
2014
12

CSS背景颜色半透明,文字不透明,兼容多数浏览器

 IE:外层filter,内层position:relative或absolute。
FF:外层不使用opacity,而用background:rgba()。

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <title> New Document </title>
  <meta name="Generator" content="EditPlus">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <style>
        #wrapper
        {
            background: #369;
            width:300px;
            height:150px;
        }
        #div1
        {
            -moz-opacity: 0.3; /* FF 3.5以下 */
            opacity: 0.3; /* FF 3.5及以上 */
            filter: alpha(opacity=30); /* IE6及以上 */
            background: #fff;
            width: 200px;
            height: 50px;
        }
        #div2
        {
            background: rgba(255, 255, 255, 0.3) !important; /* IE无效,FF有效 */
            background: #fff;
            filter: alpha(opacity=30);
            width: 200px;
            height: 50px;
        }
        #div2 span
        {
            position: relative;
        }
    </style>
 </head>

18
2014
12

ASP.NET网站部署后不能直接下载exe文件的问题


ASP.net 网站部署到服务器上后,里面有一些exe文件,当打开EXE文件的链接后提示找不到文件,而不是直接下载,原因为 IIS 设置为 “脚本和可执行文件”的问题,把IIS里面的网站执行权限改为纯脚本就可以直接用链接下载了。 

17
2014
12

Exception of type 'System.OutOfMemoryException' was thrown

ASP.net服务器出现如下错误:

 

 Server Error in '/' Application.

Exception of type 'System.OutOfMemoryException' was thrown.

09
2014
12

div显示在object、embed之上~



<object height="600" width="940" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
      
<param value="/swf/park/1/1303872749292.swf" name="movie">
      
<param value="high" name="quality">
      
<param value="always" name="allowScriptAccess">
      
<param value="internal" name="allowNetworking">
     
 <param value="transparent" name="wmode">
      
<embed height="600" width="940" wmode="transparent" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" allownetworking="internal" allowscriptaccess="always" quality="high" src="/swf/park/1/1303872749292.swf">
    
</object>

09
2014
12

DIV 在object之上, div 覆盖object

<html> 
<head> 
<meta   http-equiv= "Content-Type "   content= "text/html;   charset=gb2312 "> 
<meta   name= "GENERATOR "   content= "Microsoft   FrontPage   4.0 "> 
<meta   name= "ProgId "   content= "FrontPage.Editor.Document "> 
<title> 简单菜单 </title> 
<!-- 
提供定位函数,用iframe作载体,不会被select挡住 
By   Fason(2003-5-21) 
--> 
<style id=s> 
#div1{ 
position:absolute; 
z-index:100; 
width:100; 
height:130; 
background-color:#d2e8ff; 
border:1   solid   black; 

div{cursor:hand;font-size:12px;} 
a{text-decoration:none;color:red;font-size:12px} 
</style> 
</head> 
<body> 
<script> 
function   window.onload(){ 
var   shtml=div1.innerHTML; 
var   ifm=document.createElement( " <iframe   frameborder=0   marginheight=0   marginwidth=0   hspace=0   vspace=0   scrolling=no> </iframe> ") 
ifm.style.width=div1.offsetWidth 
ifm.style.height=div1.offsetHeight 
ifm.name=ifm.uniqueID 
div1.innerHTML= " " 
div1.appendChild(ifm) 
window.frames[ifm.name].document.write(s.outerHTML+ " <body   leftmargin=0   topmargin=0> "+shtml   +   " </body> ") 
}
function   show(){ 
with(document.all.img1){ 
x=offsetLeft; 
y=offsetTop; 
objParent=offsetParent; 
while(objParent.tagName.toUpperCase()!=   "BODY "){ 
x+=objParent.offsetLeft; 
y+=objParent.offsetTop; 
objParent   =   objParent.offsetParent; 

y+=offsetHeight-1 

with(document.all.div1.style){ 
pixelLeft=x 
pixelTop=y 
visibility= ' ' 


function   hide(){ 
document.all.div1.style.visibility= 'hidden '
function   aaa() 

window.alert( 'ok ') 


</script> 
<img   id=img1   onmouseover= "show() "   onmouseout= "hide() "   src= "ie.gif "> <br> 
<object id="nmclayer" height="410" width="624" classid="clsid:9EBADD82-B1AB-49eb-843F-D0A445DF7B46">
</object>
<div   id=div1   onmouseover= "style.visibility= ' ' "   onmouseout= "style.visibility= 'hidden ' "   style= "visibility:hidden; "> 
<div   href= "http://www.csdn.net "   onmouseover= "style.backgroundColor= 'highlight'"   onmouseout= "style.backgroundColor=''"   onclick= "parent.aaa() "> 中国程序员 </div> 
<div   href= "http://www.sohu.com"   onmouseover= "style.backgroundColor='highlight'"   onmouseout= "style.backgroundColor=''"   onclick= "window.open(href) "> sohu </div> 
</div> 
</body> 
</html