El siguiente ejemplo implementa la función SARS de obtener iFrames editables en el lado del servidor. El código es muy simple, por lo que no explicaré mucho sobre el sufrimiento aquí. El código es el siguiente:
getiframehtml.axpx
<%@ page idioma = "<a href =" http://dev.21tx.com/language/vb/ "target =" _ blank "> vb </a>" ValidateRequest = false autoeventwireUp = "false"
codeBeHind = "getiframehtml. <a href =" http://dev.21tx.com/web/asp/ "target =" _ blank "> asp </a> x.vb" inherits = "aspx <a href =" http://dev.21tx.com/web/ " Target = "_ Blank"> Web </a> .getiframehtml "%>
<html>
<Body>
<Form ID = "frmMain" método = "post" runat = "servidor">
<iframe id = "iFrhtml" name = "ifrhtml"> </iframe>
<br>
<Asp: Button id = "CMDSEND" Runat = "Server" Text = "Envir"> </Asp: Button>
<input type = "Hidden" name = "HidValue">
</form>
<script>
ifrhtml.document.designmode = "on";
</script>
</body>
</html>
getiframehtml.aspx.vb
clase pública getiframehtml
Heredina System.Web.UI.Page
protegido con los vents cmdsend como system.web.ui.webcontrols.button
protegido con los ventos ifrhtml como System.web.ui.htmlControls.htmlGenericControl
#Rregion "Código generado por el diseñador de formulario web"
'El diseñador de formulario web requiere esta llamada.
<system.diagntics.deBuggerStepthrough ()> privado sub inicializeComponent ()
final
privado subpage_init (remitente Byval como System.Object, _
Byval E como System.Eventargs) Maneja mybase.init
'Codegen: el diseñador de formulario web requiere esta llamada de método
'No lo modifique usando el editor de códigos.
inicializeComponent ()
final
#Error de región
privado subpage_load (remitente Byval como System.Object, _
Byval E como System.Eventargs) Maneja mybase.load
cmdsend.attributes.add ("onClick", "document.frMMain.hidValue.Value" + _
"= ifrhtml.document.body.innerhtml;")
final
Sub cmdsubmit_click privado (remitente Byval como System.Object, _
Byval e como System.Eventargs) Maneja CMDSEND. Haga clic
Dim strvalue como cadena
strValue = request.form ("HidValue")
Response.Write (server.htmldecode (strValue))
final
La clase final registra a un miembro y crea su base de datos de desarrollo web.