473,666 Members | 2,039 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DropDownList in asp.net C#

Sl1ver
196 New Member
here is the code in the website

I have a repeater, The DropDownList, this is where I need to send the corresponding data from the DataView with to my event in C# page.

How would I do this?

Expand|Select|Wrap|Line Numbers
  1.  
  2. <asp:Repeater ID="atHomeRep" runat="server">
  3.   <HeaderTemplate>
  4.     <table cellpadding="0" cellspacing="0">
  5.       <tr>
  6.         <td colspan="2" class="CbbTableWhiteLine">&nbsp;</td>
  7.       </tr>
  8.   </HeaderTemplate>
  9.   <ItemTemplate>
  10.     <tr>
  11.       <td class="style2" style="width: 320px;">
  12.         Shipped: <%# String.Format("{0:D}", ((DataRowView)Container.DataItem)["dtedateadded"].ToString())%>
  13.       <br>
  14.       <%# String.Format("{0:D}", ((DataRowView)Container.DataItem)["vctitlename"]).Replace("@", " - ")%>
  15.        -
  16.       <%# String.Format("{0:D}", ((DataRowView)Container.DataItem)["vctitlediscname"]) %>
  17.       <br> 
  18.       <br>
  19.     </td>
  20.  
  21.     <td class="style3" style="width: 320px;">
  22.       <asp:DropDownList ID="atHomeRate" runat="server" 
  23.           AutoPostBack="true" 
  24.           AppendDataBoundItems="False"
  25.           OnSelectedIndexChanged="atHomeRate_SelectedIndexChanged">
  26.           <asp:listitem>1 Star</asp:listitem>
  27.           <asp:listitem>2 Stars</asp:listitem>
  28.           <asp:listitem>3 Stars</asp:listitem>
  29.           <asp:listitem>4 Stars</asp:listitem>
  30.           <asp:listitem>5 Stars</asp:listitem>
  31.         </asp:DropDownList>
  32.       </td>
  33.     </tr>
  34.   </ItemTemplate>
  35.   <FooterTemplate>
  36.     </table>
  37.   </FooterTemplate>
  38. </asp:Repeater>
Jun 17 '11 #1
1 1993
Frinavale
9,735 Recognized Expert Moderator Expert
Could you post the code for the SelectedIndexCh anged event?

-Frinny
Jun 23 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1962
by: Vijay Kerji | last post by:
Hi, I have a datagrid with dropdown list and Remove hyperlink in it as columns. When I remove a row from the datagrid, Dropdown list selection is retaining its previous value. i.e, removed Dropdown item selection is applied to the next dropdown list. Is there any way to fix this problem?
0
1582
by: ba | last post by:
I'm using asp.net 2.0 and am writing a webform using the formview control. The <%# Bind("") %> syntax makes sense for textboxes, but I cannot figure out how to bind a dropdown list to a column. The values to be entered from the dropdownlist are YES and NO. I want the source of the dropdown to be one of these two choices. When the record is in 'edit mode', I want the dropdown list selected
1
6487
by: sck10 | last post by:
Hello, I am using the following in a GridView. Currently, I am using a dropdown that pulls the Name of the person, given the Employee ID. I am doing this in both the ItemTemplate and the EditTemplate. This makes sense for the EditTemplate becuase the user can then change the Employee using the dropdown box. What I am trying to figure out is how to show the Employee Name in the ItemTemplate without having to use a DropDownList Box. ...
12
3511
deephill
by: deephill | last post by:
hi i need form dependency. Can u check below code? <p>1. Are you married?</p> <p>
2
1065
by: Bob | last post by:
is there a way to have a dropdown box and when the user clicks on an item in the dropdown box it can show information about that item in html somewhere else on the page example: in the drop down box it would have a list of baseball players, and when a user clicks on the player (not pushing the submit button, just highlighting the selection in the dropdown box) to the right of the dropdown box would show the players stats...
0
938
by: lyealain | last post by:
hi.. imagine i have 10 columns and plenty rows of data... i would like to have 2 dropdown box where the first one contains all the 10 column titles.. and the second dropdown contains each of the selected dropdown values... Problems!!! each time i select the first dropdown .. the second dropdown will automatic show the data for that selected value...pls help
4
1283
by: mathewgk80 | last post by:
Hi everybody, I am having a drop down list with items 1,2,3.. and another dropdown list with items apple,orange and lemon.. If i select item 2 in the first dropdown list i need to get orange as the selected item in the second dropdown list. if i select item 3 in the first drop down list, i need to get lemon in the second drop down list automatically... I am using asp.net and c#.net.... Please help me..
2
1437
by: JJ297 | last post by:
I have a dropdown list populated via a database. I edited the dropdown list to have "select a topic" to always appear when the drop down loads. Now if a user selects a dropdown item it goes into the datagrid fine, but if a user selects "select a topic" I get an error message... Error converting nvarchar to int on adapter.Fill(ds) Here's the code behind can someone please assist? Thanks! Protected Sub...
20
3894
by: daitasri | last post by:
Hi I am using HTML and JS only. When i click on Button(say Add) a new row will be added in to the table with dropdown's and textboxes.I want to know how to access the data entered in the textboxes and dropdowns Please help me out as i am a beginner
1
1437
by: mldardy | last post by:
I really hope this makes sense to someone because I really need some assistance with this: I have a asp page that I am working on that has as many as 4 dropdownlists depending on what I choose in those dropdowns. The 4 dropdowns are named:iSource, iSub1, iSub2, iSub3. To begin I select an item for iSource then iSub1 comes up and I have an option to choose ALL or any of the other items in the recordset. If I choose ALL it will bring up iSub2...
0
8448
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8871
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8783
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8640
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4198
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4369
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2773
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.