Rank: Administration
Groups: Administration
Joined: 10/8/2008(UTC) Posts: 190  Was thanked: 1 time(s) in 1 post(s)
|
For this overrule mail part, I created something which overrules every open Control without Copying the code Code:Imports microsoft.visualbasic
==>END IMPORTS
Try
Dim Cid as string = pbw.get_cid_currentdomain
Dim Newmail as string = ""
Dim Orgineletekst as string = Mailtext
Dim CTeller, Labelteller As Integer
Labelteller = -1
Dim b As String() = Split(Orgineletekst, "{!$")
Dim arraysize As Integer = b.Length * 3
Dim Lbar(arraysize) As String
Dim LbarType(arraysize) As String
While Orgineletekst.IndexOf("{!$") >= 0
'Neem eerste deel tekst en plaats in label array voorbeeld: {!$Control.05$!}
Dim Ctrlpos, Ctrllen As Integer
Ctrlpos = Orgineletekst.IndexOf("{!$")
Ctrllen = Orgineletekst.IndexOf("$!}") + 1 - Ctrlpos
Dim TekstdeelI As String = Orgineletekst.Substring(0, Ctrlpos)
Dim Controlnaam As String = Orgineletekst.Substring(Ctrlpos + 1, Ctrllen)
Controlnaam = Controlnaam.Substring(2, Controlnaam.Length - 4)
Dim TekstdeelII As String = Orgineletekst.Substring(Ctrlpos + Ctrllen + 2, Orgineletekst.Length - Ctrlpos - Ctrllen - 2)
'Voeg items toe aan array
Labelteller = Labelteller + 1
Lbar(Labelteller) = TekstdeelI
LbarType(Labelteller) = "LB"
Labelteller = Labelteller + 1
Lbar(Labelteller) = Controlnaam
LbarType(Labelteller) = "UC"
'Orginele tekst wordt de rest van de string
Orgineletekst = TekstdeelII
Dim ControlId as string = controlnaam.split(".")(1)
Select Case ControlId
Case 36
try
Dim SourceVolgnummer as string= controlnaam.split(".")(2)
Dim key As String = "SOURCEFORMCT"
If SourceVolgnummer.Length = 1 Then
SourceVolgnummer = "0" & SourceVolgnummer
End If
key &= SourceVolgnummer
dim Parvulling as integer = controlnaam.split(".").Length - 3
Dim par(20) As String
For I as integer = 0 to Parvulling -1
par(I) = controlnaam.split(".")(I+3)
next
Dim Controlplace as new System.Web.UI.HtmlControls.HtmlGenericControl
Controlplace.Id = "Controlplace"
Dim MyForm2 As new SiennEngine.OpenControl
pbw.Run_OpenControl(key, Cid, False, pbw.Get_RunSource_CreateAssembly, pbw.Get_RunSource_RunFromAssembly(), MyForm2, "", httpContext.Current.Server, httpContext.Current.Request, httpContext.Current.Session, httpContext.Current.Response, pbw.Get_Constring, par, parvulling, "", "", Controlplace)
Dim Result as string = ""
Dim ControlCount as integer = Controlplace.Controls.Count
If controlCount > 0 then
For I as integer = 0 to ControlCount -1
If Controlplace.Controls(I).Tostring= "System.Web.UI.LiteralControl" then
Dim litControl as literalControl = Controlplace.Controls(I)
Result &= litControl.text
end if
next
else
Result = Controlplace.InnerHTML
end if
Newmail &= TekstdeelI & Result
catch ex as exception
Newmail &= TekstdeelI & ex.tostring
end try
Case 42
Dim ViewId as string= controlnaam.split(".")(2)
Dim Queryoverrule as string = controlnaam.split(".")(3)
Queryoverrule = Queryoverrule.replace("|",".")
dim result as string = pbw.Create_View(0,0,"/",0,httpContext.Current.Server,"","","","",httpContext.Current.Session,httpContext.Current.Response,httpContext.Current.Request,0,"",-1,"","","",0.0,-1,2,0,0,0,0,0,0,1,Queryoverrule,0,"",0,"",0,Cint(ViewId),Cid,100,"",Constring)
Newmail &= TekstdeelI & Result
end Select
End While
'Kijk of er nog tekst is overgebleven
Newmail &= Orgineletekst
Mailtext=Newmail
catch ex as exception
mailtext &= ex.tostring
end try
This currently only works if you use only literalcontrols. If you also use other control you can remark this code Code: 'Dim Result as string = ""
'Dim ControlCount as integer = Controlplace.Controls.Count
'For I as integer = 0 to ControlCount -1
' If Controlplace.Controls(I).Tostring= "System.Web.UI.LiteralControl" then
' Dim litControl as literalControl = Controlplace.Controls(I)
' Result &= litControl.text
' end if
'next
And Include your own handling for other controls. I hope this will help someone out. Edit 20120829: I changed the controplace part so it automaticcaly detects innerHTML or controlplace. In some cases it won't work correct if you do this the wrong way. Edited by user Wednesday, August 29, 2012 11:06:04 AM(UTC)
| Reason: Not specified
|