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

翻译|其它|编辑:郝浩|2007-09-21 09:30:09.000|阅读 1381 次

概述:

# 界面/图表报表/文档/IDE等千款热门软控件火热销售中 >>

<%@ 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" />

 


标签:

本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@evget.com

文章转载自:csdn

为你推荐

  • 推荐视频
  • 推荐活动
  • 推荐产品
  • 推荐文章
  • 慧都慧问
扫码咨询


添加微信 立即咨询

电话咨询

客服热线
023-68661681

TOP