Solved

<ajaxToolkit:HtmlEditorExtender Key cannot be null  Error

Posted on 2013-06-05
8
1,373 Views
Last Modified: 2013-06-28
Hi Experts,

I'm trying to use AJAX HTMLEditor and getting the error above.  
In the same <Div> area I'm using <ajaxToolkit:CalendarExtender and it's working fine.  In fact I use AJAX all over the intranet.
Here's the code for Select.aspx:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<%@ Page Title="Department Meeting Notes" Language="VB" MasterPageFile="~/Masters/mstrIntranet.master" AutoEventWireup="false" CodeFile="Select.aspx.vb" Inherits="Tools_DN"  %>
<asp:Content ID="Content1" ContentPlaceHolderID="contentplaceholder2" Runat="Server">
    <style type="text/css"">
            .modalBackgroundClass {
          background-color:White;
          filter:alpha(opacity=70);
          opacity:0.7;
}
</style>
  <style type="text/css">
        .style1
        { width: 97px;}
    </style>

    <table cellpadding="0" cellspacing="0" style="width: 843px">
        <tr>
        <td bgcolor="#DBDBDB" style="width: 14px; height: 25px;">
        </td>
        <td style="width: 30px; height: 25px;">
        </td>
        <td style="width: 576px; height: 25px;">
   <table cellpadding="0" cellspacing="0" style="width: 720px; height: 454px;">
       <tr>
           <td valign="top" style="height: 17px; width: 559px;">
            <table cellpadding="0" cellspacing="0" style="width: 720px; height: 446px;">
          <tr>
            <td height="449" valign="top">
    <form id="Form1" name="form1" method="post" runat="server">
    <asp:ScriptManager ID="scriptmanager1" runat="server"></asp:ScriptManager>
       <table cellpadding="0" cellspacing="0" class="text" border="0" style="width: 720px;">
             <tr valign="top">
               <td style="width: 149px" class="textBold" >Year:</td>
               <td style="width: 571px" colspan="3" >
                   <asp:DropDownList ID="YearDD" runat="server">
                       <asp:ListItem>2013</asp:ListItem>
                       <asp:ListItem>2012</asp:ListItem>
                   </asp:DropDownList>
                  &nbsp;&nbsp;&nbsp;
                    <asp:Label ID="lbl10" runat="server" Text=""></asp:Label>
                    <br />
                </td>
              </tr>
             <tr valign="top">
               <td style="height: 8px;" colspan="4" ></td>
              </tr>
              <tr valign="top">
                <td style="width: 149px" class="textBold" >Month: </td>
                <td style="width: 412px">
                    <asp:DropDownList ID="MonthDD" runat="server" >
                        <asp:ListItem>January</asp:ListItem>
                        <asp:ListItem>February</asp:ListItem>
                        <asp:ListItem>March</asp:ListItem>
                        <asp:ListItem>April</asp:ListItem>
                        <asp:ListItem>May</asp:ListItem>
                        <asp:ListItem>June</asp:ListItem>
                        <asp:ListItem>July</asp:ListItem>
                        <asp:ListItem>August</asp:ListItem>
                        <asp:ListItem>September</asp:ListItem>
                        <asp:ListItem>October</asp:ListItem>
                        <asp:ListItem>November</asp:ListItem>
                        <asp:ListItem>December</asp:ListItem>
                    </asp:DropDownList>
                </td>
       <td style="text-align: right"><asp:LinkButton ID="AddBtn" runat="server" class="textBold">Add New</asp:LinkButton></td>
               <td style="width: 10px;"></td>
             </tr>
             <tr valign="top">
              <td style="height: 8px;" colspan="4" ></td>
             </tr>
             <tr valign="top">
               <td colspan="4" class="textBold" style="height: 16px">
                   <table cellpadding="0" cellspacing="0" style="border-style: inset; border-width: 1px; width: 730px">
                       <tr>
                           <td style="height:5px;" colspan="8"></td>
                       </tr>
                       <tr>
                       <td style="width: 10px">&nbsp;</td>
                           <td style="width: 400px;">x<asp:Label ID="MonthLbl" runat="server" Text=""></asp:Label>x</td>
                           <td style="text-align: right">
                               <asp:LinkButton ID="EditBtn" runat="server">Edit</asp:LinkButton>
                               </td>
                           <td style="text-align: right" style="width: 40px">&nbsp;</td>
                           <td style="text-align: right" style="width: 40px">
                           <asp:LinkButton ID="PreviewBtn" runat="server">Preview</asp:LinkButton>
                           </td>
                           <td style="width: 40px">&nbsp;</td>
                           <td style="text-align: right" style="width: 40px">
                           <asp:LinkButton ID="DeleteBtn" runat="server">Delete</asp:LinkButton>
                           </td>
                           <td style="width: 10px">&nbsp;</td>
                       </tr>
                        <tr>
                           <td style="height:5px;" colspan="8"></td>
                       </tr>
                       </table>
                 </td>
             </tr>
  <tr valign="top">
              <td colspan="4"> <asp:Label ID="lbl1" runat="server" Text="Label"></asp:Label> &nbsp;</td>
          </tr>
          <tr valign="top">
            <td colspan="4">&nbsp;</td>
          </tr>
          <tr valign="top">
            <td colspan="4">
<%--~~~~~~~~~~~~        Add New Meeting Info  Area  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--%>
<div id="divPopUP" align="center"
         style="display:none;width:860px;height:750px;border:solid1px#dddddd; top: 780px;  position: relative; ">
        <div id="Layer2"
        style="position:absolute; left:685px; top:49px; width:97px; height:17px; z-index:5"><span class="text"><font color="#990000">*Required field </font></span></div>
        &nbsp;<br/>&nbsp;<br/>
    <table cellpadding="0" cellspacing="0" style="width: 843px;" border="2" bgcolor="White"  bordercolor="#000000">
     <tr>
      <td>
            <table cellpadding="0" cellspacing="0" style="width: 843 px;" border="0">
                <tr>
                    <td style="width: 30px; height: 12px;"></td>
                    <td colspan="3"></td>
                    <td  style="width: 30px;"></td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td colspan="3" align="left"><strong class="title1">Add New Dept Head Meeting Notes</strong><hr></td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td colspan="3">&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td>
                        &nbsp;</td>
                    <td class="textBold" style="width: 174px" align="left">Meeting Date<font color="#990000">*</font>:</td>
                    <td class="style1" align="left"><asp:TextBox ID="AddMeetingDatetxt" runat="server" style="margin-bottom: 0px" Width="78px"></asp:TextBox>
                                      <ajaxToolkit:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="AddMeetingDatetxt" PopupButtonID="CalendarBtn" >
                                       </ajaxToolkit:CalendarExtender>
                     </td>
                   
                    <td style="width: 524px;" align="left"><asp:ImageButton ID="CalendarBtn" runat="server"  ImageUrl="~/Tools/Images/Calendar2.gif" CausesValidation="false"/> <asp:RequiredFieldValidator ID="AddDateVld" runat="server" ErrorMessage="Please add a date" ControlToValidate="AddMeetingDatetxt" Display="Dynamic" CssClass="textBold" SetFocusOnError="True"></asp:RequiredFieldValidator></td>
                    <td>&nbsp;</td>
                </tr>
                 <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td class="style1">&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>  
                <tr>
                    <td>
                        &nbsp;</td>
                    <td  class="textBold" align="left">Meeting Notes Text<font color="#990000">*</font>:</td>
                    <td colspan="2" valign="top"> <asp:RequiredFieldValidator ID="addMeetingTextVLD" runat="server" ErrorMessage="Please add meeting information" ControlToValidate="MeetingNotestxt" CssClass="textBold" Display="Dynamic" SetFocusOnError="True"></asp:RequiredFieldValidator>
                                           &nbsp;</td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td style="height: 6px;"></td>
                    <td colspan="3"></td>
                    <td></td>
                </tr>
                <tr>
                    <td> &nbsp;</td>
                    <td colspan="3" align="left"> <asp:TextBox ID="MeetingNotestxt" runat="server" TextMode="MultiLine" ClientIDMode="Static"  Width="766px" Height="500px" />
  <ajaxToolkit:HtmlEditorExtender ID="HtmlEditorExtender1" runat="server" TargetControlID="MeetingNotestxt" ></ajaxToolkit:HtmlEditorExtender>

</td>
                    <td> &nbsp;</td>
                </tr>
               
                <tr>
                    <td> &nbsp;</td>
                    <td colspan="3">&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td colspan="3" align="right">
                    <asp:Button ID="Button1" runat="server" Text="Preview" CausesValidation="False" />&nbsp;&nbsp;&nbsp;
                    <asp:Button ID="btnHide" runat="server" Text="Cancel" OnClick="btnHide_Click" CausesValidation="False" />&nbsp;&nbsp;&nbsp;
                    <asp:Button ID="SubmitAddBtn" runat="server" Text="Submit" />
                    </td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td colspan="3">&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
                </table>
       </td>
    </tr>
    </table>
    <br/>
 </div>
 <%--~~~~~~~~~~~~     END   Add New Meeting Info  Area  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--%>
     <ajaxToolkit:ModalPopupExtender ID="mpe1" runat="server" TargetControlID="AddBtn" PopupControlID="divPopUP" BackgroundCssClass="modalBackgroundClass" DropShadow="false">
     </ajaxToolkit:ModalPopupExtender>
</div>
         </td>
       </tr>
       <tr valign="top">
         <td colspan="4"> &nbsp;</td>
       </tr>
       <tr valign="top">
         <td colspan="4">&nbsp;</td>
       </tr>
       </table>
   </form>
   </td>
   </tr>
 </table>
</td>
</tr>
</table>
</td>
<td valign="bottom" style="height: 21px">
<asp:Image ID="Image10" style="height: 20px; width: 18px;" runat="server" align="right" ImageUrl="~/Images/Corner-Right.jpg" />
</td>
<td bgcolor="#DBDBDB" style="height: 25px">
</td>
</tr>
</table>
</asp:Content>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Here's the aspx.vb code that relates to it.:
 Protected Sub SubmitAddBtn_Click(sender As Object, e As System.EventArgs) Handles SubmitAddBtn.Click

        Dim mDate As Date = AddMeetingDatetxt.Text
        Dim mText As String = (MeetingNotestxt.Text)
        Dim today As Date = FormatDateTime(Now(), 2)
        Dim updater As String = Request.Cookies("lastname").ToString

        Dim strSQL As String = "INSERT INTO DeptHeadMeetingNotes (meetingDate, meetingNotes, updatedDate, updatedBy ) VALUES"
        strSQL = strSQL + "(" & mDate & ", '" & mText & "', " & today & ", " & updater & ")"

        Dim thisResponse As String

        thisResponse = InsertRecord(strSQL)
        mpe1.Hide()
        lbl10.Text = thisResponse

    End Sub

~~~~~~~~~~~~~~~~~~~~~~~~~
Here's the web.config:
<sectionGroup name="system.web">
      <section name="sanitizer" requirePermission="false" type="AjaxControlToolkit.Sanitizer.ProviderSanitizerSection, AjaxControlToolkit"/>
    </sectionGroup>

 <controls>
        <add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit"/>
      </controls>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The other AJAX item in this page and in the other pages under this web.config work with no problems.

Any ideas?

JS
0
Comment
Question by:jshesek
  • 4
  • 4
8 Comments
 
LVL 23

Expert Comment

by:Roopesh Reddy
ID: 39226243
Hi,

Try installing the latest AjaxControlToolKit!

I think you should try installing AjaxControlToolKit through NuGet - http://roopeshreddy.wordpress.com/2012/10/07/installingconfiguring-ajaxcontroltoolkit-through-nuget/

Hope it helps u...
0
 
LVL 1

Author Comment

by:jshesek
ID: 39228737
I reinstalled the AjaxControlToolKit with NuGet.  No luck.  I guess I'll try tinyMCE.
Thanks for the post.

JS
0
 
LVL 23

Expert Comment

by:Roopesh Reddy
ID: 39228952
Hi,

Let me know the result!
0
 
LVL 1

Accepted Solution

by:
jshesek earned 0 total points
ID: 39229470
Hi RoopShreddy,

Worked out well with a lightbox effect.  I downloaded the latest version and having a little trouble getting the spellcheck button to show up with a picture - but it works.  Boss is happy with it.  Dowloaded the 3.x version and that worked well too.

I upload the html text to a database - for archiving.  And call back on the intranet.

Now the problem is with the underlying repeater & linkbuttons.  They aren't calling the codebehind.  When I remove the lightbox <Div - it works.  I'm going to post a new question on that.

(http://www.experts-exchange.com/Microsoft/Development/Q_28151132.html)

Got a response back.  The links in the repeater should have CausesValidation="false".  

JS
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 23

Expert Comment

by:Roopesh Reddy
ID: 39253952
Hi,

So, is the issue resolved?
0
 
LVL 1

Author Comment

by:jshesek
ID: 39262183
Yes
0
 
LVL 23

Expert Comment

by:Roopesh Reddy
ID: 39262428
Hi,

Then if you can mark the post which helped you with answer. If none of the posts helped, then you can post the solution and mark it as answer!
0
 
LVL 1

Author Closing Comment

by:jshesek
ID: 39283782
This is how I solved the problem
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Vb.net dynamic formulas in runtime 11 61
What .NET URL re-routing tool did I use? 2 34
Run time Error 4 34
Displaying a web form as a modal popup dialog box. 4 17
Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now