1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / How to create codebehind for a Page and Form, and access controls

How to create codebehind for a Page and Form, and access controls

5 posts, 0 answered
  1. Zubair
    Zubair avatar
    142 posts
    Registered:
    26 Dec 2007
    19 Jun 2011
    Link to this post
    Hi,

    I'm a SF4 newbie, I have created a Form and put it on a page but I need a Country dropdown list on the form, what I can do is drop the built in dropdown list and be able to get the control from Codebehind of the Form control or the page the form is on and bind it to a List of countries I already got.

    I know the control Id is there for a reason, so you can access them from codebehind, I need to know how?

    I have seen this post and this one too but I am not sure how to use the code without creating a page or custom widget.

    Please help, thanks.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    20 Jun 2011
    Link to this post
    Hello Zubair,

    There is no code behind of these controls, since they are compiles. You can inherit from the base class and bind the control to your data. You can use ChoiceField control in DropDown mode ( RenderChoicesAs.DropDown)

    Regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Zubair
    Zubair avatar
    142 posts
    Registered:
    26 Dec 2007
    20 Jun 2011
    Link to this post
    Hi Ivan,

    Thanks for getting back, I'm not sure if I understand you correctly, can you please provide a sample code or point me a post that answers the same thing?

    thanks,
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    20 Jun 2011
    Link to this post
    Hello Zubair,

    Here is a sample that you can use as a starting point.

    Regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Zubair
    Zubair avatar
    142 posts
    Registered:
    26 Dec 2007
    20 Jun 2011
    Link to this post
    Hi,

    This looks like alot of work, would you recommend adding my own widget since I already got one?
5 posts, 0 answered