Problem with .net frameworks
|
|
Joined on 25 May 2009
Total posts: 7
|
|
Post made on 25 May 2009 01:40 PM
Reply
|
Hi,
I am building a project using the .net 2.0 framework; I wanted to use your HTML editor, so I downloaded the dll. from http://jiffycms.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=24906 the problem here is that this release seems to work only with 3.5 framework. Tried to download the source code and add it to my project too, but got the same problem... besides, some of the classes there -like the Jiffycms.Net.Toolkit.ImagePickerTreeNode and about 10 more others have some reference to Linq.
I want to develop using your Editor class in 2.0 framework and no Linq. What can I do?
Thanks in advance,
Antonio Bou.
|
Re: Problem with .net frameworks
|
|
Joined on 06 Jan 2009
Total posts: 210
|
|
Post made on 25 May 2009 01:57 PM
Reply
|
Hi Antonio, there are no dependencies on Linq and the .NET framework 3.5 ; what you see are import statements added automatically by VS.NET 2008 when adding a new class to a project.
Feel free to remove those "using" statements, build and use the resulting dll.
It's not something I have tested personally, but do report back if this works nicely on .NET 2.0 only environment for you.
Have a good day,
We are now on twitter! Follow us for the latest.
|
Re: Problem with .net frameworks
|
|
Joined on 25 May 2009
Total posts: 7
|
|
Post made on 25 May 2009 02:03 PM
Reply
|
Before anything thanks for the quick response.
Tried to do what you said. Apparently it works, but i get an "empty" -no styles, no visible buttons- Editor, wich leads me to the next question.
I am trying to create the Editor by code, using VB statements like this:
Dim htmName As New Editor()
what I get with this is a new, fresh, empty editor... ¿how can I "fill" it with the toolbars, buttons, etc.?
Thanks again,
Antonio Bou.
|
Re: Problem with .net frameworks
|
|
Joined on 06 Jan 2009
Total posts: 210
|
|
Post made on 25 May 2009 02:19 PM
Reply
|
The following piece of code works just fine here :
|
|
|
|
Dim ed As New Editor()
PlaceHolder1.Controls.Add(ed)
|
how are you adding the editor to the page? In the above piece of code I am adding it to a PlaceHolder that already exists on the page. Perhaps this is what you are missing. Can't tell for certain though.
We are now on twitter! Follow us for the latest.
|
Re: Problem with .net frameworks
|
|
Joined on 25 May 2009
Total posts: 7
|
|
Post made on 25 May 2009 02:52 PM
Reply
|
Public Sub InstantiateIn(ByVal container As System.Web.UI.Control) Implements System.Web.UI.ITemplate.InstantiateIn Dim htmName As New Editor() container.Controls.Add(htmName) End Sub
What I'm trying to do is to instantiat the Editor in a gridview, in the same way I would put a TextBox or a DropDownList, using the ITemplate interface... maybe this is not possible?
Regards,
Antonio Bou.
|
Re: Problem with .net frameworks
|
|
Joined on 06 Jan 2009
Total posts: 210
|
|
Post made on 25 May 2009 03:53 PM
Reply
|
Antonio, the following basic test I conducted a few minutes ago seems to work just fine :
|
|
|
|
<%@ Import Namespace="Jiffycms.Net.Toolkit" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Protected Sub Page_Load(ByVal sender As Object, _
ByVal e As System.EventArgs)
Dim tf As New TemplateField()
tf.HeaderText = "Html editor"
tf.ItemTemplate = New DummyTemplate()
GridView1.Columns.Add(tf)
If (Not IsPostBack) Then
GridView1.DataSource = New String() {"apples", "bananas"}
GridView1.DataBind()
End If
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager
ID="ScriptManager1"
runat="server">
</asp:ScriptManager>
<div>
<asp:GridView
ID="GridView1"
AutoGenerateColumns="false"
runat="server">
</asp:GridView>
</div>
</form>
</body>
</html>
|
and the code for the custom ITemplate I used in the test above :
| Visual Basic |
|
|
Imports Microsoft.VisualBasic
Imports Jiffycms.Net.Toolkit
Imports System.Data
Namespace Dummy
Public Class DummyTemplate
Implements ITemplate
Private editor1 As Editor
Private Sub InstantiateIn(ByVal container As Control) _
Implements ITemplate.InstantiateIn
editor1 = New Editor
AddHandler editor1.DataBinding, AddressOf dataBind
container.Controls.Add(editor1)
End Sub
Private Sub dataBind(ByVal sender As Object, ByVal e As EventArgs)
Dim editor1 As Editor = CType(sender, Editor)
Dim container As GridViewRow = _
CType(editor1.NamingContainer, GridViewRow)
editor1.Text = CType(container.DataItem, String)
End Sub
End Class
End Namespace
|
I have tried to mirror your issue as closely as possible based on what you said on your previous post. Let me know if my sample code is a bit off
We are now on twitter! Follow us for the latest.
|
Re: Problem with .net frameworks
|
|
Joined on 25 May 2009
Total posts: 7
|
|
Post made on 25 May 2009 04:13 PM
Reply
|
It seems that your code follows my idea, yes. But we can't make it work . After some trials with a partner, we have seen that adding this line to the web.config:
<add verb="*" path="jiffycms.axd" type="Jiffycms.Net.Toolkit.WebResourceHandler" />
The editor showed up in our grid, but buttons were alltogether and hard to click, and after that, when we clicked in the "Update" command button of the gridview, a Sys.WebForms.PageRequestManagerServerErrorException with code 500 showed up... maybe we are missing something in the web.config file?
|
Re: Problem with .net frameworks
|
|
Joined on 06 Jan 2009
Total posts: 210
|
|
Post made on 25 May 2009 04:21 PM
Reply
|
Yup, you need to register the handler manually. The handler registration is provided as a designtime feature where dragging and dropping the control from the tool should automatically add the needed hander in web.config for you.
However since you are doing this manual, you need to register the handlers manually. I wrote a small article regarding this here, in case you missed it :
http://www.jiffycms.net/Article/HtmlEditor-Tutorials/23/Using-an-External-StyleSheet-with.aspx
We are now on twitter! Follow us for the latest.
|
Re: Problem with .net frameworks
|
|
Joined on 25 May 2009
Total posts: 7
|
|
Post made on 25 May 2009 04:24 PM
Reply
|
OK. Reading and testing. Will write something with the outcome ASAP.
Thanks for the quick response times,
Antonio Bou.
|
Re: Problem with .net frameworks
|
|
Joined on 25 May 2009
Total posts: 7
|
|
Post made on 25 May 2009 10:08 PM
Reply
|
Allright. Read and tested. Here's my new set of questions .
When I tried to use the control as you explained in the article, everything went fine. But when I tried to put the Editor in the gridview template, found the same problem of before, even with the new lines inserted in the web.config. My partners and me found out that this "disarrangement" of the buttons in the Toolbars had something to do with an UpdatePanel in the MasterPage... maybe we have to avoid having an UpdatePanel containing the GridView that will contain the Editor? Is it there something to be done instead?
I'm out of the office now so I can't paste the MasterPage code. But it's simply a UpdatePanel containint the ContentPlaceHolder that will content the pages' controls -including the GridView of the Editor-.
Thanks again,
Antonio Bou.
|