Apr 12, 2012, 2:21 PM
[CLOSED] Web Service Render ASCX
Hi,
i'd like to generate an ascx in a webmethod.
In fact, in the webmethod "renderTo",
1 - I created the new Page()
2 - I added the HtmlForm to the page
3 - I added the Ext.Net.ResourceManager to the HtmlForm
4 - then I tried to load rm.ascx, I did the databind and
5 - I did the "page.RenderControl(wr)" (point where i encoutered the error)
I correctly did all of these passages with the 1.0.0.15317 ext.net version
but with the 1.0.4414.20616 and 1.0.4485.18804 versions I'm facing this problems
what could I do to solve my problem?
thank you
RM.ASCX:
WEB SERVICE:
i'd like to generate an ascx in a webmethod.
In fact, in the webmethod "renderTo",
1 - I created the new Page()
2 - I added the HtmlForm to the page
3 - I added the Ext.Net.ResourceManager to the HtmlForm
4 - then I tried to load rm.ascx, I did the databind and
5 - I did the "page.RenderControl(wr)" (point where i encoutered the error)
I correctly did all of these passages with the 1.0.0.15317 ext.net version
but with the 1.0.4414.20616 and 1.0.4485.18804 versions I'm facing this problems
what could I do to solve my problem?
thank you
RM.ASCX:
<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="RM.ascx.vb" Inherits="GoogleExtMaps.RM" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<ext:Button runat="server" ID="bttn" Text="---"></ext:Button>
RM.ASCX.VB:Public Class RM
Inherits UserControl
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
Public Overrides Sub DataBind()
bttn.Text = "TEST VALUE"
End Sub
End Class
WEB SERVICE:
<WebMethod(True)> _
<System.Web.Script.Services.ScriptMethod(ResponseFormat:=System.Web.Script.Services.ResponseFormat.Json, UseHttpGet:=False)> _
Function renderTo(Userid As String, Lingua As String) As ExtResult
Dim res As New ExtResult
Dim Controllo As New UserControl
Try
Controllo = Controllo.LoadControl("rm.ascx")
Controllo.DataBind()
Dim page As Page = New Page()
Dim Sw As New System.IO.StringWriter
Dim RMExtNet As New Ext.Net.ResourceManager
Controllo.EnableViewState = False
page.EnableViewState = False
page.EnableEventValidation = False
Dim form As New HtmlForm
form.ID = "ExtNetFormContainer"
form.Controls.Add(RMExtNet)
form.Controls.Add(Controllo)
page.Controls.Add(form)
Dim wr As New System.Web.UI.HtmlTextWriter(Sw)
page.RenderControl(wr) '<- ERROR ############################
Catch ex As Exception
res.Errore = "Errore: " & ex.Message
End Try
Return res
End Function
Last edited by Daniil; Apr 16, 2012 at 12:41 PM.
Reason: [CLOSED]