在线编辑器 用iframe做的 如何获取iframe的内容并存入数据库 asp.net 10
<scripttype="text/javascript">functionexeCommand(command,value){document.execCommand(...
<script type="text/javascript">
function exeCommand(command, value)
{
document.execCommand(command, false, value);
}
function addBold()
{
var obj = frames['testEdit'];
obj.focus();
exeCommand('Bold', '');
}
function addItalic()
{
var obj = frames['testEdit'];
obj.focus();
exeCommand('Italic', '');
}
function addUnderline()
{
var obj = frames['testEdit'];
obj.focus();
exeCommand('Underline', '');
}
</script>
</head>
<body onload="testEdit.document.designMode='On'">
<form id="form1" runat="server">
<div class="top"></div>
<div class="pub" style="height:50px; border:none;"><span title="文章" class="span1">Article</span></div>
<div class="pub" style="height:350px;">
标题 <asp:TextBox CssClass="input" ID="title" runat="server"></asp:TextBox> 作者 <asp:TextBox CssClass="input" ID="author" runat="server"></asp:TextBox> <asp:Label Visible="false" ID="statement" runat="server" Text="Label"></asp:Label><br /><br />
正文<br />
<div style="height:22px; width:605px;">
<input id="Button1" title="加粗" type="button" value="B" onclick="addBold()" /> <input id="Button2" type="button" title="斜体" value="I" onclick="addItalic()" /> <input type="button" id="Button3" title="下划线" value="U" onclick="addUnderline()" /></div>
<!--<asp:TextBox ID="content" TextMode="MultiLine" Width="600px" Height="220px" runat="server"></asp:TextBox>-->
<iframe frameborder="0" id="testEdit" runat="server" width="605px" height="210px" style="background-color:White;"></iframe><br /><br />
<asp:LinkButton ID="sure" CssClass="linkbutton" runat="server" onclick="sure_Click">确定</asp:LinkButton> <asp:LinkButton CssClass="linkbutton" ID="cancle" runat="server" onclick="cancle_Click">取消</asp:LinkButton>
</div>
<input type="hidden" id="con" runat="server"/>
</form>
</body>
</html> 展开
function exeCommand(command, value)
{
document.execCommand(command, false, value);
}
function addBold()
{
var obj = frames['testEdit'];
obj.focus();
exeCommand('Bold', '');
}
function addItalic()
{
var obj = frames['testEdit'];
obj.focus();
exeCommand('Italic', '');
}
function addUnderline()
{
var obj = frames['testEdit'];
obj.focus();
exeCommand('Underline', '');
}
</script>
</head>
<body onload="testEdit.document.designMode='On'">
<form id="form1" runat="server">
<div class="top"></div>
<div class="pub" style="height:50px; border:none;"><span title="文章" class="span1">Article</span></div>
<div class="pub" style="height:350px;">
标题 <asp:TextBox CssClass="input" ID="title" runat="server"></asp:TextBox> 作者 <asp:TextBox CssClass="input" ID="author" runat="server"></asp:TextBox> <asp:Label Visible="false" ID="statement" runat="server" Text="Label"></asp:Label><br /><br />
正文<br />
<div style="height:22px; width:605px;">
<input id="Button1" title="加粗" type="button" value="B" onclick="addBold()" /> <input id="Button2" type="button" title="斜体" value="I" onclick="addItalic()" /> <input type="button" id="Button3" title="下划线" value="U" onclick="addUnderline()" /></div>
<!--<asp:TextBox ID="content" TextMode="MultiLine" Width="600px" Height="220px" runat="server"></asp:TextBox>-->
<iframe frameborder="0" id="testEdit" runat="server" width="605px" height="210px" style="background-color:White;"></iframe><br /><br />
<asp:LinkButton ID="sure" CssClass="linkbutton" runat="server" onclick="sure_Click">确定</asp:LinkButton> <asp:LinkButton CssClass="linkbutton" ID="cancle" runat="server" onclick="cancle_Click">取消</asp:LinkButton>
</div>
<input type="hidden" id="con" runat="server"/>
</form>
</body>
</html> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询