Country State Setting: Retrieving selected values

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
9/17/2012 4:11:44 AM
Gravatar
Total Posts 51

Country State Setting: Retrieving selected values

Hi,

Could anybody guide me in retrieving the selected values of the Control CountryStateSetting.ascx?

I need to insert the selected values in a table of my custom module. The table contain a row for country and another one for State.

Any help will be appreciated.

Thanks

9/17/2012 12:51:25 PM
Gravatar
Total Posts 18439

Re: Country State Setting: Retrieving selected values

the .GetValue() returns a pipe separated value with the country and state iso codes, so you will have to split it on the pipe | to parse the values

Hope that helps,

Joe

9/18/2012 2:26:13 AM
Gravatar
Total Posts 51

Re: Country State Setting: Retrieving selected values

Thanks Joe.

I used the .GetValue(), but thought there was an easier way to get the selected value of each dropdown

9/18/2012 6:33:26 AM
Gravatar
Total Posts 18439

Re: Country State Setting: Retrieving selected values

That control was designed to be used as a module setting in Event Calendar Pro but I put it in mojoPortal core in case it was useful in other features. Each module setting is just one property so I needed a single control and a single result value. There is not a way in the module settigns page to have cross talk or dependencies between settings so I could not use a separate setting for country and separate for state. By doing it as one setting I was able to have the state dropdown inside the same setting control and make it populate according to the selected country.

Its pretty easy to split the values, but if you don't like that you could populate your own dropdown lists instead of using that control. You could even borrow some of the code from inside that control since iy has the logic to populate the dropdown lists.

9/18/2012 3:31:27 PM
Gravatar
Total Posts 51

Re: Country State Setting: Retrieving selected values

Thanks a lot Joe!

I will borrow the logic of the dropdownlist to get something working..

P.S: I´m working on a project ( slowly)

You must sign in to post in the forums. This thread is closed to new posts.