Posts

Showing posts from November, 2008

No Query Strings Needed

.NET allows you to reference most anything from one page to any page. An example: Page1.aspx Public Shared MyVariableThatIWant_ToPass as string = "secret information" OnAnyOtherPage. aspx Dim TheSecretFromPage1 as string TheSecretFromPage1 = MyProject.Page1. MyVariableThatIW_antToPass

Raising Events

In Default.aspx I have a user control ( < WI : editBOM runat ="server" id ="ctlEdit" />)  I want to refresh  the ctlEdit dropdownlist when another control fires (BOM.ascx)   So in DEFAULT.aspx I add this sub Private Sub ctlNew_drpBOM_Change() Handles ctlNew.drpBOM_Change ctlEdit.drpbomChange() End Sub In the EDITBOM.ASCX file I add this subroutine essentially rebinding the dropdownlist Public Sub drpbomChange() drpBOM.DataSource = VendorBid_Data.itemAttributesvb.getValidBOMStyles() drpBOM.DataBind() drpBOM.Items.Insert(0, "Choose Style" ) End Sub In the BOM.ASCX file I declare the event and raise the event: Public Event drpBOM_Change() I raise the event at the point I want to fire it.... RaiseEvent drpBOM_Change() Thus we have a page that holds two controls - when one dropdownlist or event fires then the other control dropdownlist is refreshed.  This enables me to load up my controls on the page but if circumstances change