bluetorch002
Legacy Member
Code:
Sub postcodesinvullen(ByVal s As Object, ByVal e As EventArgs)
Dim strCountry As String
strCountry = Trim(DropDownList2.SelectedItem.Value)
datasourcePostCodes.FilterParameters.Add("strLand", strCountry)
End Sub
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<asp:SqlDataSource ########secret#####>
</asp:SqlDataSource>
<asp:SqlDataSource ####secret#####>
<SelectParameters>
<asp:Parameter Name="strLand" DefaultValue="Belgium" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
<form id="form1" runat="server">
<div>
<br />
<asp:DropDownList ID="DropDownList2" AutoPostBack="True" runat="server" DataSourceID="datasourceCountries" DataTextField="INTL_NAME" DataValueField="INTL_NAME" Width="223px" OnSelectedIndexChanged="postcodesinvullen">
<asp:ListItem Selected="True" Value="">please select a value</asp:ListItem>
</asp:DropDownList><br />
<br />
<asp:DropDownList ID="DropDownList1" AutoPostBack="True" runat="server" DataSourceID="datasourcePostCodes" DataTextField="postal_code" DataValueField="postal_code" Width="223px">
<asp:ListItem Selected="True">please select a value</asp:ListItem>
</asp:DropDownList><br />
<br />
<br />
<br />
<asp:Label ID="Label1" runat="server" Text="Label" Width="221px" OnLoad="func"></asp:Label> </div>
</form>
</body>
</html>
Wat is hier mis mee ?
de dropdownlist2 is die waar alle landen in staan
de list1 is die met alle postcodes met defaultvalue Belgium
ik probeer na een selectedindexchanged een sub postcodesinvullen aan te roepen en de param van de selectie te veranderen maar dit gaat blijkbaar niet op de manier die ik probeer.
Wat doe ik verkeerd?
Mvg
Dank bij voorbaat