I'm using Visual Web Developer 2010 Express with SQL Server 2008 Express, VB.
The sub below is executed when the user selects the appropriate line in DropDownList4 (SelectedIndexChanged), no problem. What I would like to do (desperately need to do), is after the selected part PDF is opened, toggle visibility so FNameDD.visibile = False and FName.visible = True. Adding the commands simply doesn't work.
Protected Sub DropDownList4_SelectedIndexChanged(sender As Object, e As System.EventArgs)
Dim PCB1 As String = String.Empty
If FormView1.CurrentMode = FormViewMode.ReadOnly Then
Dim FName As Label = TryCast(FormView1.FindControl("PCB_FootprintLabel"), Label)
Dim FNameDD As DropDownList = TryCast(FormView1.FindControl("DropDownList4"), DropDownList)
PCB1 = PCBpdf & FNameDD.SelectedItem.Text & ".pdf"
Response.Clear()
Response.ContentType = "application/pdf"
Context.Response.AddHeader("Content-Disposition", "attachment=" + PCB1)
Response.WriteFile(PCB1)
Response.End()
End If
End Subasp for DropDownList4 (FNamedd):
<asp:DropDownList
ID="DropDownList4" runat="server" AutoPostBack="True" Visible="False"
onselectedindexchanged="DropDownList4_SelectedIndexChanged" >
<asp:ListItem>-- Select Footprint to View --</asp:ListItem>
</asp:DropDownList>
asp for PCB_FootprintLabel (FName):
<asp:Label ID="PCB_FootprintLabel" runat="server"
Text='<%# Bind("PCB_Footprint") %>' Width="225px" />Yesterday I had trouble with buttonclick, today labels and dropdownlists, what tomorrow?
Thanks!