.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

pass a value to the 2 Master/Detailed drop down lists

Posted By:      Posted Date: October 05, 2010    Points: 0   Category :ASP.Net

using below code, I bind 2 drop down lists.

    <asp:SqlDataSource ID="sdsCountry" runat="server" ConnectionString="<%$ ConnectionStrings:Conn %>"
        SelectCommand="SELECT tbz_CountryID, tbz_CountryName FROM AZ_Country"></asp:SqlDataSource>
    <asp:SqlDataSource ID="sdsCity" runat="server" ConnectionString="<%$ ConnectionStrings:Conn %>"
        SelectCommand="SELECT [tbz_CityID], [tbz_CityName] FROM [AZ_City] WHERE ([tbz_CityID] = @tbz_CityID)">
            <asp:ControlParameter ControlID="ddlCounty" Name="tbz_CountryID" PropertyName="SelectedValue"
                Type="Int32" />

And using the below code, I pass the content of GridView selectedRow cell to that DopDownLists .

 Protected Sub gvTax_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
      With gvTax.SelectedRow ddlCountry.SelectedValue = .Cells(26).Text Try ddlCity.SelectedValue = .Cells(28).Text Catch End Try End With End S

View Complete Post

More Related Resource Links

After applying custom master page, "Current View" drop down is no longer functional on Lists


The "Current View" drop down is not dropping down anymore when on the list library ribbon with a custom master page applied. Of course, it does work fine with v4.master. I would list all the custom master page changes however they are numerous. So I am looking to see if there are any ribbon experts that can give me things to at least look for. I would really appreciate it! Thanks!

Create a placeholder for drop down lists


First time post here, if i'm in the wrong area please move as necessary. Thanks

I'm using VWD with a database back end. I have a list of teams which are marked off by league, level, division, teamid and then using gridview for the list of players per teams.

I've got the drop downs working correctly but running into a little snag and that is on the auto postback.

When I only have one option come up in a list, i obviously don't change that list and thus it doesn't change the next drop down because there is no post back. is there a way to use a "header" value?

Example of my data

League Level Division Team

NHL 1 West Vancouver
NHL 1 West Calgary
NHL 1 West Edmonton
NHL 1 Central Chicago

OHL 2 West London
OHL 2 West Guelph

NBA 1 Central Chicago
NBA 1 Central Detroit
NBA 1 Central Milwaukee

So my drop downs choose by league, then level then division and then team then shows the player roster for that selected team.

The problem I run into is when only one value exists based on the previous choices I've made. If I choose NHL then Central only Chicago shows up in the example above. Because I'm not choosing between it and another value, the drop down does not put in a post back and thus I don't get a list of the team and then the players

bind drop down list in content page from value from master page

Hi all, I have applied nested master page to some page. Now i want to bind drop downlist from value selected in dropdown list in master page of master applied to that page. the hierarchy of pages is  mypage.aspx -> main.aspx -> inner.master I want bind dropdown list in  mypage.aspx from  from value selected in dropdown list in  inner.master Please help me. 

how do i develop a cascade drop down lists which get the chart names from excel sheets

hi i have to develop a cascade dropdownlist. one of the drop down is used to retrive only excel docs from a specific doc library and and the other drop down to get all the chart names and attach it to the second dropdown list in doc lib item changed event thanks    

pass Drop down selected value to Texxtbox in SSRS Reports

hi, i have developed a ssrs report which as Two dropdown as parameter first one is used to select the Starting year second one is used to select the ending year based upon the selected value a table will retreive data's Above the table there s textbox which is used to give message as "Project From year 2006-2007 " this 2006-2007 must be the dropdown selected how to do this? Thanks, Saraswathy

help with drop down lists

Hello i have 4 ddl for factory, category, model and engine im tryin to make connection between them so i could select factory and then the other ddls will change the data that relative to the select item on factory. I know how to make connection between them but i need to use AppendDataBoundItems so the user could select "all models" or "All categories" without success!!! when i select factory the category get the models and when i select different factory the new model join the other factory models and so on and on. i was try with ajax cascading ddl but i didnt success cause the user need to have the change to select factory and engine (for example) but the engine is enabled = false until the user select 3th ddl PLEASE HELP

Creating a generic template writer that can handle drop downs and option lists


If I have a the following model

public class User
		public List<Company> Companies;
		public string Login { get; set; }

		[DisplayName("First Name")]
		public string FirstName { get; set; }

		[DisplayName("Last Name")]
		public string LastName { get; set; }

		public string Password { get; set; }

		private int Company { get; set; }

And the following generic control template writer (which would have to be extended appropriately)

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<% foreach (var prop in ViewData.ModelMetadata.Properties .Where(pm => pm.ShowForEdit && !ViewData.TemplateInfo.Visited(pm))) 
{ %>
	<div class="SD_FieldItem">
		<% if (!String.IsNullOrEmpty(Html.Label(prop.PropertyName).ToHtmlString()))
			switch (prop.ModelType.Name)
				case "Boolean":

						<div class="SD_BoolField">
							<%= Html.CheckBox(prop.PropertyName) %>
							<%= Html.Label(prop.PropertyName) %>
							<%= Html.ValidationMessage(prop.PropertyName, 

cascading drop down lists from single table


my one table consists of fields (id, flying from, flying to). thus i have one drop down for flying from and another drop down for flying to. i'm hoping to cascade them so 2nd drop down values are dependant on the values from 1st drop down. is it possible to do this using a single table? or must i use two tables and link the id's from both? and do i write anyting in the SelectedIndexChange event? thanks...

the sqldatasource code looks like this:

Flying From:

        <asp:DropDownList ID="ddlFlyingFrom" runat="server" DataSourceID="SqlDataSource1"
            DataTextField="FlyingFrom" DataValueField="Id" AutoPostBack="True" OnSelectedIndexChanged="ddlFlyingFrom_SelectedIndexChanged">

        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:TestConnectionString %>"
            SelectCommand="SELECT [Id], [FlyingFrom] FROM [Flights]"></asp:SqlDataSource>

How do I - pass multiple params from multi-select drop down on one report to another via action


Report 1 - 3 params:  @Status =Y,N  @FromDate, @ToDate.  Report one shows 2 cols (Status, Total). 

 @Status gets values from shared dataset - getStatus

Status      Totals
[Status]    [Total]

I created an action [Total] when clicked runs another report that accepts the same 3 params (Status, FromDate, ToDate) and works fine if i only select one of the status' from the status param drop down.

I am trying to create an action on [sum(Total)] that will run the same 2nd report with both status' selected.  Show it should show me details of all Y and N

The second report will work if i set the 2nd report @Status param to no default value.  But i want a user to be able to run the 2nd report by itself if needed so i set the @Status param to Get Values from a Query, which get the same dataset as report 1 which is getStatus.  It will not populate the 2nd report Status field when I do this.  I am forced to set it to no default values.  Is there a way to pass both the Y and N from report 1 to report 2 and still keep the drop down multi-select box on report 2 for Status?


fx Controls instead of Drop Down Lists for Lookup fields in InfoPath Secondary Data Connections


I have a secondary data connection with a lookup field into another list. To display the fields text value instead of the index, I am using a drop down list which gets its choices from the linked list. This information is read-only so I disabled the control via formatting rule.

A calculated value control might be better suited, but my XPath skills are not very "developed". Has anyone done this before? Taken the index from the bound field and extracted the text value from a second data connection? Thx


Using 2 drop down lists to display dress size by Country version??




I have a Dress Version Table with Colums UK, EU, USA.

Also a Dress Size table which has a VersionId Column corresponding to the Version Table


On my aspx, i have two drop down lists. DD1 is binded to an objectdatasource which

has a select Method to the DAL and retrives the 3 Verions.


DD2 has Get DressSize by Version Method with a Select Parameter which is the DD1 selected Value.

I have wrapped the above in an update panel and the full code is below.


This works but I wonder if there is a better way of doing this?? I also have a probem

in that the Dropdowns are in a panel that is within a modal pop up extender. When

the dropdowns post back the whole panel disappears. Not sure why??





   Dress Size:

   <asp:UpdatePanel ID="UpdatePanel2"

How do I pass the Selected Value of my Drop Down List


I added 3 values on DropDownList controls. ID= DropDownList1. If a user selects a value from the DropDownList, I'd like to insert the value on my DB (DB = Test) and in Column (Column = LastName). Below is the code I get when I double click on the DropDownList.


Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged



How to pass data from content page to master page?



I would like to know if its possible to pass data from content page to master page on code behind. Lets say i have an integer data on content page and i would like to use this data on my master page's menu.

Any ideas?

Thanks in advance.

Best Regards

Multiple Cascading Drop Down Lists - Browser



We have a requirement to implement quite a complex cascading drop down list solution. I am aware that there are numerous articles on how to do this however I would like to confirm if it is possible to achieve the following:

1. A drop down list with multiple selections for field A. User selects field A.
2. Field B is automatically populated based on field A which was selected above.
3. A filtered drop down list appears for field C. This filtered drop down list is based on field A & B which was previously selected. User selects field C.
4. Field D is automatically populated based on field C which was selected above.
5. Field E is automatically populated based on field C which was selected above.
6. Field F is automatically populated based on field C which was selected above.

My programming skills are very limited and how I would ideally like to connect the form to a list in SharePoint so that the values can be easily maintained. We are using a browser form and would appreciate any ideas or suggestions on how to create the above functionality. Just out of interest, The custom drop down list for field C will probably have 100 values and overall we have about 5000 records which need to be autopopulated and filtered.

Thanks for any help


Drag n Drop files in Outlook Sharepoint Lists





Can you let me know how to enable drag and drop of files in Sharepoint List in Outlook 2007. I have installed MOSS 2007. Currently its in read only mode.




Displaying SharePoint lists in Web Parts

When you create a built-in or custom list in Microsoft Windows SharePoint Services, Windows SharePoint Services creates a Web Part, a basic building block of a SharePoint site, to display that list. These Web Parts are called List View Web Parts. Windows SharePoint Services stores List View Web Parts in the site collection Web Part gallery. (The site collection Web Part gallery is the most central gallery of Web Parts for a work group. By default, the gallery name is the name of the site, such as "Our Team Site Web Part Gallery." )

SharePoint Tutorial - Lists

A list is a feature in SharePoint that stores a lists of information. For example, a list can be created to store web links in the human resources team site. A list is usually created for a specific type of information. Lists can contain metadata to describe the particular information in more detail and to make it easier to find.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend