G
Guest
I have a standard aspx page format that I replicate in many places on my site. That page has a lengthy page_load section, that I'd love to stick in a single code file (e.g. MyFunctions.vb). I know how to do this for simple functions such where I pass in and get back string parameters etc, but the code I want to stick in that code file includes commands to modify controls on the aspx page (e.g. label.text = "hello"). Can anyone tell me how to pass the name of the aspx page from the aspx page to the code file, and reference/modify controls on the aspx page from the code file? The scenario is:
Page1.aspx - page_load includes MyFunctions.InitializeLabels("page1.aspx")
Page2.aspx - page_load includes MyFunctions.InitializeLabels("page2.aspx")
MyFunctions.vb -
class MyFunctions
public shared function InitializeLabels
...commands like CallingPage.Label1.text = "Hello, World"
Page1.aspx - page_load includes MyFunctions.InitializeLabels("page1.aspx")
Page2.aspx - page_load includes MyFunctions.InitializeLabels("page2.aspx")
MyFunctions.vb -
class MyFunctions
public shared function InitializeLabels
...commands like CallingPage.Label1.text = "Hello, World"