Search Results

Search found 3 results on 1 pages for 'weeshian'.

Page 1/1 | 1 

  • CascadingDropDown taking two parameters...

    - by WeeShian
    I have a page with 3 dropdownlist, 2nd and 3rd dropdownlist are added with CascadingDropDown. 3rd dropdownlist will take parameters from 1st and 2nd dropdownlist. So, in current example for CascadingDropDown i have found from google, they are only passing one parameter to the WebService method. How can pass two parameters to the service method, so that my 3rd dropdownlist will based on the SelectedValue of 1st and 2nd dropdownlist? <WebMethod()> _ Public Function GetTeams(ByVal knownCategoryValues As String, ByVal category As String) As CascadingDropDownNameValue() Dim strConnection As String = ConfigurationManager.ConnectionStrings("nerdlinessConnection").ConnectionString Dim sqlConn As SqlConnection = New SqlConnection(strConnection) Dim strTeamQuery As String = "SELECT * FROM TEAM WHERE conf_id = @confid" Dim cmdFetchTeam As SqlCommand = New SqlCommand(strTeamQuery, sqlConn) Dim dtrTeam As SqlDataReader Dim kvTeam As StringDictionary = CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues) Dim intConfId As Integer If Not kvTeam.ContainsKey("Conference") Or Not Int32.TryParse(kvTeam("Conference"), intConfId) Then Return Nothing End If cmdFetchTeam.Parameters.AddWithValue("@confid", intConfId) Dim myTeams As New List(Of CascadingDropDownNameValue) sqlConn.Open() dtrTeam = cmdFetchTeam.ExecuteReader While dtrTeam.Read() Dim strTeamName As String = dtrTeam("team_name").ToString Dim strTeamId As String = dtrTeam("team_id").ToString myTeams.Add(New CascadingDropDownNameValue(strTeamName, strTeamId)) End While Return myTeams.ToArray End Function This is the sample code i found! As you can see in the code, '@confid' will be passed from 2nd dropdownlist! So, hw do i modify this code to get the selected value from 1st dropdownlist as well??

    Read the article

  • Manually insert items into DDL after data binding...

    - by WeeShian
    I have a dropdownlist, which dynamically populate data from SQL Server and i wanna manually insert two items on top of the DDL after data binding. So, the DDL would has data something like this: Select Branch (manually insert) ALL (manually insert) AIR AMP ABG ... I tried to achieve it by using code below: ddlBranch.Items.Insert(0, "Select Branch") ddlBranch.Items(0).Value = CMM.sExcVal1 ddlBranch.Items.Insert(1, "ALL") ddlBranch.Items(1).Value = "ALL" but it comes out giving me the data like this: Select Branch (manually insert) ALL (manually insert) ('AIR' branch should be here but it's gone) AMP ABG ... After manually insert the 'ALL' item into the DDL, the 'AIR' is gone which is already replaced by the 'ALL'. How can i remain all the data from server and at the same time i can manually insert two items?

    Read the article

1