Foros del Web » Programación para mayores de 30 ;) » .NET »

llamar a un weform

Estas en el tema de llamar a un weform en el foro de .NET en Foros del Web. saludos a todos, tengo un problema en asp, tengo un webform1.aspx que contiene un editor (ckeditor) y un boton, en el editor valga la redundancia ...
  #1 (permalink)  
Antiguo 08/10/2013, 23:27
 
Fecha de Ingreso: octubre-2013
Mensajes: 1
Antigüedad: 10 años, 6 meses
Puntos: 0
Exclamación llamar a un weform

saludos a todos, tengo un problema en asp, tengo un webform1.aspx que contiene un editor (ckeditor) y un boton, en el editor valga la redundancia edito o digito cualquier cosa, y el boton (button) que tengo me permite crear un nuevo webform y a la vez pasar todo lo que hice en el ckeditor a esta nueva pagina, mi problema es que cuando le doy clic al boton me aparece un error :

Server Error in '/' Application.

Parser Error

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load type 'editor_texto.WebForm3'.

Source Error:


Line 1: <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm3.aspx.vb" Inherits= "editor_texto.WebForm3" ValidateRequest= "false" %>
Line 2: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
Line 3: <html xmlns= "http://www.w3.org/1999/xhtml" >

Source File: /WebForm3.aspx Line: 1

y e verificado que este error aparece porque no tengo incluido el webform que creo al proyecto, tengo que hacerlo de forma manual, ir al webform creado, clic derecho e include in project, me gustaria saber si me pueden apoyar con un codigo que me permita incluir este webform que creo al proyecto para no hacerlo manualmente, de ante mano les agradesco un monton


Protected Sub Button2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button2.Click

Session("contenido") = CKEditor1.Text

'File.Create("E:\Proyectos de Software\Aspx.net\ckeditor\ckeditor\WebForm3.aspx. designer.vb")

Using sw As StreamWriter = File.CreateText("D:\visual\editor-texto\editor-texto\WebForm3.aspx.designer.vb")
sw.WriteLine("Option Strict On")
sw.WriteLine("Option Explicit On")
sw.WriteLine("Partial Public Class WebForm3")
sw.WriteLine(" '''<summary>")
sw.WriteLine(" '''form1 control.")
sw.WriteLine("'''</summary>")
sw.WriteLine("'''<remarks>")
sw.WriteLine("'''Auto-generated field.")
sw.WriteLine("'''To modify move field declaration from designer file to code-behind file.")
sw.WriteLine("'''</remarks>")
sw.WriteLine("Protected WithEvents form1 As Global.System.Web.UI.HtmlControls.HtmlForm")
sw.WriteLine("End Class")
End Using

'File.Create("E:\Proyectos de Software\Aspx.net\ckeditor\ckeditor\WebForm3.aspx. vb")
Using sw As StreamWriter = File.CreateText("D:\visual\editor-texto\editor-texto\WebForm3.aspx.vb")
sw.WriteLine("Public Class WebForm3")
sw.WriteLine("Inherits System.Web.UI.Page")
sw.WriteLine("Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load")
sw.WriteLine("End Sub")
sw.WriteLine("End Class")

End Using

'File.Create("E:\Proyectos de Software\Aspx.net\ckeditor\ckeditor\WebForm3.aspx" )

Dim declaracion As String = "<%@ Page Language=" & """vb""" & " AutoEventWireup=" & """false""" & " CodeBehind=" & """WebForm3.aspx.vb""" & " Inherits=" & " ""editor_texto.WebForm3"" " & "ValidateRequest=" & " ""false"" " & "%>"
Dim doc_type As String = "<!DOCTYPE html PUBLIC " & """-//W3C//DTD XHTML 1.0 Transitional//EN""" & """http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"" >"
Dim dec_html As String = "<html xmlns=" & " ""http://www.w3.org/1999/xhtml"" >"


Using sw As StreamWriter = File.CreateText("D:\visual\editor-texto\editor-texto\WebForm3.aspx")
sw.WriteLine(declaracion)
sw.WriteLine(doc_type)
sw.WriteLine(dec_html)

sw.WriteLine("<head runat=" & """server"">")

sw.WriteLine("<meta http-equiv=" & """Content-Type""" & "content=" & """text/html; charset=utf-8""" & "/>")
sw.WriteLine("<title>Pagina Autogenerada</title>")
sw.WriteLine("<link rel=" & """stylesheet""" & "type=" & """text/css""" & "href=" & """styles/styles.css""" & "/>")

sw.WriteLine("</head>")

sw.WriteLine("<body>")


sw.WriteLine("</body>")

sw.WriteLine("</html>")

sw.Flush()



End Using

'Me.Focus(webform3.aspx)
'OnUnload.WebForm3.aspx()


Response.Redirect("~\WebForm3.aspx")

End Sub

ese es el codigo que estoy usando en el botton a ver si me pueden ayudar por favor

Etiquetas: asp, form
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 22:11.