Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • gilpt 33 posts 53 karma points
    Jun 05, 2011 @ 11:49
    gilpt
    0

    hi ... i'm trying to create my own Datatype

    by inheriting

    umbraco.cms .businesslogic .datatype .

     

    AbstractDataEditor

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    public

     

     

     

    class QueryStringDataEditor : umbraco.cms .businesslogic .datatype .AbstractDataEditor

     

    {

     

    private QueryStringDataEditorUC

    control;

    #region

     

     

     

    properties

     

    public override Guid

    Id

    {

     

    get

    {

     

    return new Guid ("B630F00A-96DA-4969-8FF8-99E233DADAB9");}

    }

     

    public override string

    DataTypeName

    {

     

    get

    {

     

    return "Incredimail QString";}

    }

    #endregion

     

    public QueryStringDataEditor()

    {

        control =

     

    new QueryStringDataEditorUC();

     

       base.RenderControl = control;

       control.Init +=

     

    new EventHandler(control_Init);

     

       base.DataEditorControl.OnSave += new    umbraco.cms.businesslogic.datatype.AbstractDataEditorControl.SaveEventHandle(DataEditorControl_OnSave);

    }

     

    void DataEditorControl_OnSave(EventArgs e)

    {

     

    base.Data.Value = control.QSText; ;}

     

    void control_Init(object sender, EventArgs e)

    {control.QSText =

     

    base.Data.Value == null ? "" : base.Data.Value.ToString();}

     

    ====================================================

    my DataType uses the UserControl QueryStringDataEditorUC (contain only TEXTBOX)

    when I put the textbox in QuerystringDataEditorUC.ascx  nothing is rendered and is see nothing on the content section when i want to set a data to my new  datatype

     

    but when the textbox is located in QuerystringDataEditorUC.ascx.cs by

     

     

     

     

    this.Controls.Add(new TextBox ());

    the datatype is render and everything is good ...

     

    is that the way it should be implemented.. can't I create my userControl in the .ascx file???

     

    thanks

     

     

Please Sign in or register to post replies

Write your reply to:

Draft