关闭

master模板页中如何取得控件客户端ID

标签: borderclassjavascripthtmlbuttontable
2591人阅读 评论(1) 收藏 举报
分类:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="HtmlEdit.ascx.cs" Inherits="Controls_HtmlEdit" %>
<script language="javascript" type="text/javascript" src="Editor/Editor.js"></script>
<script language="javascript" type="text/javascript">
    function CheckForm()

    
if(document.all('edit').style.display=='none')
        
{
            CheckFormHtml();
        }
     
        document.aspnetForm.
<%=this.content.ClientID %>.value = getContent();
    }


    function CheckFormHtml()
    
{
        setContent(document.aspnetForm.
<%=this.content.ClientID %>.value);
    }

    
    function CheckFormChange()
    
{
        CheckForm();
        CheckFormHtml();
    }


    function show(c_Str)
    
{
    
if(c_Str =='edit')
    
{
        
if(document.all('edit').style.display=='none')
        
{   
            CheckFormHtml();
            document.all(
'html').style.display='none';
            document.all(
'edit').style.display='block';
            
        }

    }

    
if(c_Str =='html')
    
{
        
if(document.all('html').style.display=='none')
        
{
            CheckForm();
            document.all(
'edit').style.display='none';
            document.all(
'html').style.display='block';
            
        }

    }

    }

</script>
<style type="text/css"> .Hand_Off { TEXT-ALIGN: center }
    .Hand_On 
{ border-RIGHT: #3169c6 1px solid; border-TOP: #3169c6 1px solid; border-LEFT: #3169c6 1px solid; width: 20px; CURSOR: pointer; border-BOTTOM: #3169c6 1px solid; height: 20px; BACKGROUND-COLOR: #c6d3ef; TEXT-ALIGN: center }
</style>
<div id="html" style="display:none;"><textarea id="content" name="content" style="width:500px; height:280px;" runat="server"></textarea></div>
<div id="edit">
<table cellspacing="0" bordercolordark="#ffffff" width="500px" bgcolor="#ffffff" borderColorLight="#666666" border="1">
 
<tr>
    
<td> 
    
<table>
    
<tr>
        
<td>
            
<select name="font_name" id="font_name" onchange="FontName(this.options[this.selectedIndex].value)"> 
            
<option class="heading" selected>字体</option>
            
<option value="宋体">宋体</option>
            
<option value="黑体">黑体</option>
            
<option value="楷体_GB2312">楷体</option>
            
<option value="仿宋_GB2312">仿宋</option>
            
<option value="隶书">隶书</option>
            
<option value="幼圆">幼圆</option>
            
<option value="新宋体">新宋体</option>
            
<option value="细明体">细明体</option>
            
<option value="Arial">Arial</option>
            
<option value="Arial Black">Arial Black</option>
            
<option value="Arial Narrow">Arial Narrow</option>
            
<option value="Courier">Courier</option>
            
<option value="Courier New">Courier New</option>
            
<option value="Script">Script</option>
            
<option value="System">System</option>
            
<option value="Verdana">Verdana</option>
            
<option value="Wide Latin">Wide Latin</option>
            
<option value="Wingdings">Wingdings</option>
            
</select>
        
</td>
        
<td>
            
<select name="font_size" id="font_size" onchange="FontSize(this.options[this.selectedIndex].value)">
              
<option value="1" selected>字号</option>
              
<option value="1">1</option>
              
<option value="2">2</option>
              
<option value="3">3</option>
              
<option value="4">4</option>
              
<option value="5">5</option>
              
<option value="6">6</option>
              
<option value="7">7</option>
            
</select>
        
</td>
        
<td onclick="FontColor()" class="Hand_Off"; onmouseover="this.className='Hand_On';" onmouseout="this.className='Hand_Off';"><img src="Editor/images/fgcolor.gif" width="16" height="16" border="0" alt="字体颜色"></td>
        
<td onclick="BackColor()" class="Hand_Off"; onmouseover="this.className='Hand_On';" onmouseout="this.className='Hand_Off';"><img src="Editor/images/fbcolor.gif" width="16" height="16" border="0" alt="背景颜色"></td>
        
<td onclick="bold()" class="Hand_Off"; onmouseover="this.className='Hand_On';" onmouseout="this.className='Hand_Off';"><img src="Editor/images/bold.gif" width="16" height="16" border="0" alt="加粗"></td>
        
<td onclick="italic()" class="Hand_Off"; onmouseover="this.className='Hand_On';" onmouseout="this.className='Hand_Off';"><img src="Editor/images/italic.gif" width="16" height="16" border="0" alt="倾斜"></td>
        
<td onclick="underline()" class="Hand_Off"; onmouseover="this.className='Hand_On';" onmouseout="this.className='Hand_Off';"><img src="Editor/images/underline.gif" width="16" height="16" border="0" alt="下划线"></td>
        
<td onclick="ralign('left')" class="Hand_Off"; onmouseover="this.className='Hand_On';" onmouseout="this.className='Hand_Off';"><img src="Editor/images/aleft.gif" width="16" height="16" border="0" alt="居左"></td>
        
<td onclick="ralign('center')" class="Hand_Off"; onmouseover="this.className='Hand_On';" onmouseout="this.className='Hand_Off';"><img src="Editor/images/center.gif" width="16" height="16" border="0" alt="居中"></td>
        
<td onclick="ralign('right')" class="Hand_Off"; onmouseover="this.className='Hand_On';" onmouseout="this.className='Hand_Off';"><img src="Editor/images/aright.gif" width="16" height="16" border="0" alt="居右"></td>
        
<td onclick="url()" class="Hand_Off"; onmouseover="this.className='Hand_On';" onmouseout="this.className='Hand_Off';"><img src="Editor/images/wlink.gif" width="16" height="16" border="0" alt="超级链接"></td>
        
<td onclick="unurl()" class="Hand_Off"; onmouseover="this.className='Hand_On';" onmouseout="this.className='Hand_Off';"><img src="Editor/images/unlink.gif" width="16" height="16" border="0" alt="取消链接"></td>
        
<td onclick="image()" class ="Hand_Off"; onmouseover="this.className='Hand_On';" onmouseout="this.className='Hand_Off';"><img src="Editor/images/img.gif" width="16" height="16" border="0" alt="插入图片"></td>
        
<td onclick="flash()" class="Hand_Off"; onmouseover="this.className='Hand_On';" onmouseout="this.className='Hand_Off';"><img src="Editor/images/swf.gif" width="16" height="16" border="0" alt="插入Flash动画"></td>
        
<td onclick="wmv()" class="Hand_Off"; onmouseover="this.className='Hand_On';" onmouseout="this.className='Hand_Off';"><img src="Editor/images/wmv.gif" width="16" height="16" border="0" alt="插入Windows Media"></td>
        
<td onclick="rm()" class="Hand_Off"; onmouseover="this.className='Hand_On';" onmouseout="this.className='Hand_Off';"><img src="Editor/images/rm.gif" width="16" height="16" border="0" alt="插入RM电影"></td>        
        
<td onmouseover="this.className='Hand_On';" onclick="unformat()"  onmouseout="this.className='Hand_Off';" class="Hand_Off";ondrag="return false;"><img height="16" border="0" alt="取消格式" src="Editor/images/cleancode.gif" width="16"/></td>
    
</tr>
    
</table>
    
</td>
</tr>
<tr>
    
<td></td>
</tr>
<tr>
    
<td>
<script language="javascript" type="text/javascript">
<!--
    Editor(document.aspnetForm.
<%=this.content.ClientID %>.value);
//-->
</script>
    
</td>
</tr>
</table>
</div>
<input type="button" onclick="show('edit')" style="width:80px" value="设计" /><input style="width:80px" type="button" onclick="show('html')" value="HTML" />

            
 
0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:803934次
    • 积分:9976
    • 等级:
    • 排名:第1789名
    • 原创:115篇
    • 转载:347篇
    • 译文:1篇
    • 评论:145条
    文章分类
    dotnet控件开发网站
    enterprise library 企业库
    HTML&amp;&amp;JAVASCRIPT网站
    电子书
    可以下载整站源代码的地方
    面试题
    南京同事
    朋友的博客
    软件,破解下载
    提供各大搜索引擎收录的网站--你只要提交首页就可以了
    我買的書對應的資源
    英文.net参考网站
    整站源代码相关