Skip to main content

Hello,

 

I'm working on developing a custom SmartForm Control that gets the IP address and domain name of the user accessing the SmartForm.  I've developed the code to get this data in C#, however I can't get the control to work properly.  After initial testing I've determined the issue is the code won't set the control property "value" from the C# code.  Does anyone know how to do this?  I've been looking around online and at the sourcecode of the controls here in the K2 Market but am having no luck.

 

At the moment I've tried the following, in my .cs file:

 

public string Value
{
get { return this.Attributesr"value"]; }
set { this.Attributesr"value"] = value; }
}

 

...

 

protected override void CreateChildControls()
{

Value = GetIPAddress();

}

 

and

 

protected override void CreateChildControls()
{

this.Attributes.Add("value", GetIPAddress()); 

}

 

Any ideas?  The basic goal of the control is to generate a value in C# and store it in a SmartForm Control property so the SmartForm can use it.

 

Thanks,

 

~Chris

This should be possible using our API, take a look at this link:

 

http://help.k2.com/onlinehelp/K2smartforms/DevRef/1.0.7/Default.htm

 

Its a complete developer reference for Smartforms and details how you can set control properties with the API .

 

Regards

 

 


Just came across this post and was wondering if someone found a way to achieve this request.  I am not a developer so something simple seems like it should be within the SmartForms tools set or maybe easy to add.  Any new info on this would be extermely helpeful and appreciated. 


Reply