Hi Yashdeep,
I believe what you are trying to do is easier to achieve with custom MVC Form Component. Have a look in the documentation and example.
If your form control properties will be something like:
public class CustomFormComponent : FormComponent<CustomFormComponentProperties, string>
{
[BindableProperty]
public string HiddenValue { get; set; }
public override string GetValue()
{
return HiddenValue;
}
public override void SetValue(string value)
{
if (!string.IsNullOrEmpty(value))
{
HiddenValue = value;
}
else
{
SetValue(Request.QueryString["QueryStringParamName"]);
}
}
}
And in view something like:
@model CustomFormComponent
@Html.HiddenFor(m => m.HiddenValue)
I think this should work.