I am currently using the asp repeater to house the fckeditor. However I can't grab the editor's value on button submit
ASP Repeater in MasterPage
Code Behind on button press
The string 'fck' keeps coming up null. I don't know what I am doing wrong or missing. Any help or ideas would be grateful. Thanks
ASP Repeater in MasterPage
<asp:Repeater ID="EditMContentRpt" runat="server" DataSourceID="EditMContent_DS"> <HeaderTemplate><tr></HeaderTemplate> <ItemTemplate> <td align="right" valign="top" style="vertical-align:top;">Content: </td> <td align="left"><FCK:FCKeditor ID="EditContentFCK" runat="server" BasePath ="~/FCKEditor/" ImageBrowserURL="../../../images/" LinkBrowserURL="../../../images/" Width="550" Height="300" Value='<%# Eval("Text") %>'></FCK:FCKeditor> </td> </ItemTemplate> <FooterTemplate></tr></FooterTemplate> </asp:Repeater> <asp:ObjectDataSource ID="EditMContent_DS" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="AWD_DSTableAdapters.MasterContentTBLTableAdapter"> </asp:ObjectDataSource>
Code Behind on button press
protected void Edit_MasterContentBtn_Click(object sender, EventArgs e) { AWD_DS.MasterContentTBLDataTable GetMContent = (AWD_DS.MasterContentTBLDataTable)mtA.GetData(); int contentid = Convert.ToInt32(GetMContent.Rows[0]["ContentID"]); string fck = ((FCKeditor)EditMContentRpt.FindControl("EditContentFCK")).Value;
The string 'fck' keeps coming up null. I don't know what I am doing wrong or missing. Any help or ideas would be grateful. Thanks
Re: FCKEditor within C# Repeaters
so, your _Click method is searching just the repeater (which wont work)
you need to do something along the lines of:
RepeaterItem myItem = (RepeaterItem)((LinkButton)sender).NamingContainer;
string myString = ((FCKeditor)myItem.FindControl("EditContentFCK")).Value;
that will find the item in the repeater that housed teh button when it was clicked and assign it to myItem then search THAT item for the fckeditor