Setting ID and Bind parameter for dinamicaly generated FCKeditors

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
 
B

bruce barker

you can not use <%= %> tags with server controls. you must use a binding
expression <%# %>. the binding expressing will be evaluated when you
call the databind for the control.

-- bruce (sqlwork.com)
 
G

Guest

:

you can not use <%= %> tags with server controls. you must use a binding
expression <%# %>. the binding expressing will be evaluated when you
call the databind for the control.

<FCKeditorV2:FCKeditor ID="<%#bodyContainerName%>" runat="server"
Height="500px" Value='<%#bodyContainerBindingName%>' Width="700px">
Generate errors:

Error 1 The ID property of a control can only be set using the ID attribute
in the tag and a simple value. Example: <asp:Button runat="server"
id="Button1" /> C:\Documents and Settings\ÐдминиÑтратор\Мои документы\Visual
Studio 2005\aurore-dodge\cms\forms\shablon_article.aspx 270
Error 2 Name 'bodyContainerBindingName' is not declared. C:\Documents and
Settings\ÐдминиÑтратор\Мои документы\Visual Studio
2005\aurore-dodge\cms\forms\shablon_article.aspx 270

May be where is some better way to realise queston?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top