asp.net - Question about moving common routines to the App_Code Class -


I have some common code that I want to share among the pages and I was messing around with App_Code classes Which is very good but I also want to use the code that affects the drop down lists example:

  sub Set_FirmType (ByVal as the sender object, byVal e EventArgs as) subcategories .Visible = "false" supplycategories.Visible = "false" supplytypes.Visible = "false" CityData.Visible = "true" CityDropDown.Visible = "false" CityDropDown.Items.Clear () If DropFirmType.SelectedValue = "funeralhomes || FH" then CountryDropDown.ClearSelection () CountryDropDown.Items. FindByValue ("United States"). Selected = true CountryDropDown.Enabled = false StateDropDown.Enabled = true getStateDropDown ("1") end then End Sub  

Is there a way to put it in my App_Code class?

Thanks in advance!

After

It seems that you are setting a certain subtotal that visibility toggles on many controls and setting some properties on Have drop down lists you can consider all packaging controls in the same user control (.ascx) and put sub routines in the code behind.

The user controls in the Housing App_Code folder are not required to reuse the application simply leave the user control on those pages where you want the functionality.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -