[custom code-only control] Inheriting from bp:FileUpload

:wrench: :screwdriver: :nut_and_bolt: What I wanted is to value-bind an int property to the MaxFileSize property of the bp:FileUpload control.

And I’m not able to make my NGMFileUpload work. Always giving the same error even when I comment all class code:

The error on client-side:

I don’t know what to do about this, please help!

Ok, this is somewhat weird, I think the problem should go away if you put a public override string ControlName => "FileUpload"; into there.

(I suppose you are not making a “markup control”, but a code-only custom control - the markup control will definitely not work, but that should fail much sooner)

It is a code-only custom control and your override suggestion worked well. Thank you!

PS: also changed the title of post, it stated wrongly “MarkupControl”.

1 Like

this may be embarrassing but it helps to tell:

NGMFileUpload is now of no use and it will be deleted.
What in fact I wanted to achieve is to not have the max file size hard coded, to use an app level “constant” property.

What I had to do in the markup of bp:FileUpload was to resource-bind instead of value-bind:


1 Like