Hi,
I'm trying to update some custom bizform code from Kentico4.1 to Kentico6 and have run into a problem I cant seam to fix.
Previously the 4.1 code wrote some data to a bizform textbox control during the Page_Load.
Which was simply:
protected void Page_Load(object sender, EventArgs e)
{
viewBiz.SiteName = "MySiteName";
viewBiz.FormName = "MyFormName";
this.viewBiz.BasicForm.DataRow["FormTextField"] = "My text";
}
But in 6, the function DataRow doesn't exist anymore.
I've tried using:
protected void Page_Load(object sender, EventArgs e)
{
viewBiz.SiteName = "MySiteName";
viewBiz.FormName = "MyFormName";
this.viewBiz.BasicForm.Data["FormTextField"] = "My text";
}
and
protected void Page_Load(object sender, EventArgs e)
{
viewBiz.SiteName = "MySiteName";
viewBiz.FormName = "MyFormName";
EditingFormControl TextField_ID = viewBiz.BasicForm.FieldEditingControls["FormTextField"] as EditingFormControl;
TextField_ID.Value = "My text";
}
But both produce a "System.NullReferenceException" error. Which I guess is because i'm not referencing the form properly.
How do I correctly access the form fields during Page_Load in Kentico6??
Thanks,
Tim