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

Jun 26, 2010 at 12:02 AM

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.

FYI.

Anyone have a workaround?

-- John Kiernan

 

Jun 27, 2010 at 8: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.

Medmerd

Jun 30, 2010 at 12:50 AM

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>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <%@ 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"
            oniteminserted="FormView1_Inserted"
            >
            <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
            <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
            <EditItemTemplate>
                <asp:Label ID="ErrorLabel" runat="server" Font-Bold="True" Font-Size="Large"
                Text=""></asp:Label>
                <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") %>' />
                </td></tr><tr><td>&nbsp;</td><td>
                <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?');" />
                </td></tr></table>
    <cc1:RichTextEditor ID="Rte1" Theme="Blue" runat="server" />
            </EditItemTemplate>
            <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
        </asp:FormView>
        <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)"
            >
          <SelectParameters>
            <asp:QueryStringParameter Name="id" QueryStringField="id" />
          </SelectParameters>
          <UpdateParameters>
            <asp:QueryStringParameter Name="id" QueryStringField="id" />
          </UpdateParameters>
          <DeleteParameters>
            <asp:QueryStringParameter Name="id" QueryStringField="id" />
          </DeleteParameters>
        </asp:SqlDataSource>
    
    </div>
    </form>
</body>
</html>

Jul 9, 2010 at 12:43 AM

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 3: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 4:51 PM

For those contacting me about this:

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

http://freetextbox.com/

 

-- John Kiernan