Bug report: This control doesn't work in a FormView

Jun 25, 2010 at 11:02 PM

I can put this control inside a Formview, but then all I get is a nice blue bar at the bottom of the area with no controls.


Anyone have a workaround?

-- John Kiernan


Jun 27, 2010 at 7:06 PM

I do not beleve i have used this control within a formview. If you post or send me a code sample of your issue I can take a look at it.


Jun 29, 2010 at 11:50 PM

Dear Medmerd -

  Sorry for the delay, I was away from home and couldn't access the code.  Here it is:

-- John

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DefaultMessage_Edit.aspx.cs" Inherits="DefaultMessage" %>

<%@ Register assembly="RichTextEditor" namespace="AjaxControls" tagprefix="cc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Edit Default Message</title>
    <form id="form1" runat="server">
        <%@ Register Assembly="RichTextEditor" Namespace="DataTest" TagPrefix="cc1" %>
        <asp:Label ID="Label4222" runat="server" Font-Bold="True" Font-Size="Large"
            Text="Edit Default Message"></asp:Label>
        <br />
        <br />
        <asp:FormView ID="FormView1" runat="server" CellPadding="4" DataKeyNames="id"
            DataSourceID="SqlDataSource1" ForeColor="#333333"
            onpageindexchanging="FormView1_PageIndexChanging" Width="719px"
            onitemcommand="FormView1_ItemCommand" onitemupdated="FormView1_Updated"
            ondatabound="FormView1_DataBound" onitemdeleted="FormView1_Deleted"
            <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
            <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                <asp:Label ID="ErrorLabel" runat="server" Font-Bold="True" Font-Size="Large"
                <table border="0">
                <tr><td align="right">
                <asp:Label ID="Label9" runat="server" Text="SMS Text:"></asp:Label>
                </td><td align="left">
                <asp:TextBox ID="smstextTextBox" runat="server" textmode="multiline" rows="5"  columns="50"
                      Text='<%# Bind("smstext") %>' />
                </td></tr><tr><td align="right">
                <asp:Label ID="Label10" runat="server" Text="Email Text:"></asp:Label>
                </td><td align="left">
                <cc1:RichTextEditor ID="emailtext" runat="server"
                    Text='<%# Bind("emailtext") %>' />                              
                </td></tr><tr><td align="right">
                <asp:Label ID="Label11" runat="server" Text="Voice Text:"></asp:Label>
                </td><td align="left">
                <asp:TextBox ID="voicetextTextBox" runat="server" textmode="multiline" rows="5" columns="50"
                    Text='<%# Bind("voicetext") %>' />
                <asp:Button ID="btnSave" runat="server" Text="Save" CommandName="Update" />&nbsp;&nbsp;
                <asp:Button ID="btnCancel" runat="server" Text="Cancel" CommandName="Cancel" />&nbsp;&nbsp;
                <asp:Button ID="btnDelete" runat="server" Text="Delete" Visible="true" CommandName="Delete" OnClientClick="return confirm('Are you certain you want to delete this record?');" />
    <cc1:RichTextEditor ID="Rte1" Theme="Blue" runat="server" />
            <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
        <asp:SqlDataSource ID="SqlDataSource1" runat="server"
            ConnectionString="<%$ ConnectionStrings:speedscriptConnectionString2 %>"
            ProviderName="<%$ ConnectionStrings:speedscriptConnectionString2.ProviderName %>"
            SelectCommand="SELECT * FROM defaultmessage WHERE id=@id"
            DeleteCommand="DELETE FROM defaultmessage WHERE id=@id"
            UpdateCommand="UPDATE defaultmessage SET messagetype = @messagetype, messagename = @messagename, smstext = @smstext, emailtext = @emailtext, voicetext = @voicetext, computer = @computer, voicemesssegs = @voicemesssegs, active = @active WHERE id = @id"
            InsertCommand="INSERT INTO defaultmessage(messagetype,messagename,smstext,emailtext,voicetext,computer,voicemesssegs,active) VALUES (@messagetype,@messagename,@smstext,@emailtext,@voicetext,@computer,@voicemesssegs,@active)"
            <asp:QueryStringParameter Name="id" QueryStringField="id" />
            <asp:QueryStringParameter Name="id" QueryStringField="id" />
            <asp:QueryStringParameter Name="id" QueryStringField="id" />

Jul 8, 2010 at 11:43 PM

As I have never heard anything again, I will assume this control does not work in a Form View.


-- John Kiernan

Jul 12, 2010 at 2:16 AM
Dear Medmerd - I got the FreeTextBox working instead. However, I thought I'd mention I think this has to do with your naming situation. If I have an editbox called "emailtext" instead of a FormView called FormView1, it needs to be referenced as "FormView1_emailtext". Just FYI... -- John
Jul 28, 2010 at 3:51 PM

For those contacting me about this:

I gave up and went to FreeTextBox instead.  Works great.



-- John Kiernan