I'm creating a custom field. I'd like to pass some data to my control when the FieldRenderingControl property is get.
How could I do? I think about Url Rewriting but in the get I can't access the Request NOR the page or the Response.
This is my code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;
namespace CustomFields
{
public class AutoAssignedLookUp : SPFieldLookup
{
public AutoAssignedLookUp(SPFieldCollection fields, string fName)
: base(fields, fName) { }
public AutoAssignedLookUp(SPFieldCollection fields, string tName, string dName)
: base(fields, tName, dName) { }
public override Microsoft.SharePoint.WebControls.BaseFieldControl FieldRenderingControl
{
get
{
return new AutoAssignedLookUpControl();
}
}
public override string GetFieldValueAsHtml(object value)
{
return base.GetFieldValueAsHtml(value);
}
public override Type FieldValueType
{
get { return (typeof(AutoAssignedLookUp)); }
}
}
}
And for the Control simply:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
namespace CustomFields
{
public class AutoAssignedLookUpControl : BaseFieldControl
{
protected override void Render(System.Web.UI.HtmlTextWriter output)
{
base.Render(output);
}
}
}
How can I pass some data to this object? How can I do this by url rewriting?