G
Guest
There is Content Management System. In it on administrator's side dinamic
number of "body" (which showing in FCKeditors) elements for generating page
Code
--------------------------------------------------------------------------------
<%
Dim bodyCounter As Integer = 1
'Ð¸Ð¼Ñ ÐºÐ¾Ð½Ñ‚ÐµÐ¹Ð½ÐµÑ€Ð° body
Dim bodyContainerName As String = ""
Dim bodyContainerBindingName As String = ""
Do
bodyContainerName = "bodyFCKeditor" +
bodyCounter.ToString
bodyContainerBindingName = "body" +
bodyCounter.ToString
%>
<tr>
<td colspan="2">
Содержимое Ñтраницы (body<%=bodyCounter%>):
</td>
</tr>
<tr>
<td colspan="2">
<FCKeditorV2:FCKeditor
ID="<%=bodyContainerName%>" runat="server" Height="500px" Value='<%#
Bind(bodyContainerBindingName) %>' Width="700px">
</FCKeditorV2:FCKeditor>
</td>
</tr>
<%
bodyCounter += 1
Loop While (bodyCounter <= bodyNumber)
%>
--------------------------------------------------------------------------------
Return Errors:
Error 1 '<%=bodyContainerName%>' is not a valid identifier.
Error 2 A call to Bind was not well formatted. Please refer to documentation
for the correct parameters to Bind.
---
How I can correct it?
---
I wrote function for output FCKeditors:
code:
--------------------------------------------------------------------------------
Function getBodyContainers(ByVal bodyNumber As Integer)
Dim bodyContainers As String = ""
Dim bodyCounter As Integer = 1
Dim bodyContainerName As String = ""
Do
bodyContainerName = "bodyFCKeditor"
bodyContainers += "<tr>" + Environment.NewLine + _
" <td colspan=""2"">" + Environment.NewLine + _
" Содержимое Ñтраницы (body" +
bodyCounter.ToString + "):" + Environment.NewLine + _
" </td>" + Environment.NewLine + _
" </tr>" + Environment.NewLine + _
" <tr>" + Environment.NewLine + _
" <td colspan=""2"">" + Environment.NewLine + _
" <FCKeditorV2:FCKeditor ID=""" +
bodyContainerName + """ runat=""server"" Height=""500px"" Value='<%#
Bind(""body"") %>' Width=""700px"">" + Environment.NewLine + _
"</FCKeditorV2:FCKeditor>" + Environment.NewLine + _
" </td>" + Environment.NewLine + _
" </tr>" + Environment.NewLine
bodyCounter += 1
Loop While (bodyCounter <= bodyNumber)
Return bodyContainers
End Function
number of "body" (which showing in FCKeditors) elements for generating page
Code
--------------------------------------------------------------------------------
<%
Dim bodyCounter As Integer = 1
'Ð¸Ð¼Ñ ÐºÐ¾Ð½Ñ‚ÐµÐ¹Ð½ÐµÑ€Ð° body
Dim bodyContainerName As String = ""
Dim bodyContainerBindingName As String = ""
Do
bodyContainerName = "bodyFCKeditor" +
bodyCounter.ToString
bodyContainerBindingName = "body" +
bodyCounter.ToString
%>
<tr>
<td colspan="2">
Содержимое Ñтраницы (body<%=bodyCounter%>):
</td>
</tr>
<tr>
<td colspan="2">
<FCKeditorV2:FCKeditor
ID="<%=bodyContainerName%>" runat="server" Height="500px" Value='<%#
Bind(bodyContainerBindingName) %>' Width="700px">
</FCKeditorV2:FCKeditor>
</td>
</tr>
<%
bodyCounter += 1
Loop While (bodyCounter <= bodyNumber)
%>
--------------------------------------------------------------------------------
Return Errors:
Error 1 '<%=bodyContainerName%>' is not a valid identifier.
Error 2 A call to Bind was not well formatted. Please refer to documentation
for the correct parameters to Bind.
---
How I can correct it?
---
I wrote function for output FCKeditors:
code:
--------------------------------------------------------------------------------
Function getBodyContainers(ByVal bodyNumber As Integer)
Dim bodyContainers As String = ""
Dim bodyCounter As Integer = 1
Dim bodyContainerName As String = ""
Do
bodyContainerName = "bodyFCKeditor"
bodyContainers += "<tr>" + Environment.NewLine + _
" <td colspan=""2"">" + Environment.NewLine + _
" Содержимое Ñтраницы (body" +
bodyCounter.ToString + "):" + Environment.NewLine + _
" </td>" + Environment.NewLine + _
" </tr>" + Environment.NewLine + _
" <tr>" + Environment.NewLine + _
" <td colspan=""2"">" + Environment.NewLine + _
" <FCKeditorV2:FCKeditor ID=""" +
bodyContainerName + """ runat=""server"" Height=""500px"" Value='<%#
Bind(""body"") %>' Width=""700px"">" + Environment.NewLine + _
"</FCKeditorV2:FCKeditor>" + Environment.NewLine + _
" </td>" + Environment.NewLine + _
" </tr>" + Environment.NewLine
bodyCounter += 1
Loop While (bodyCounter <= bodyNumber)
Return bodyContainers
End Function