473,320 Members | 1,713 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

FormView/Insert template / DropdownList / DataBinding

Hi, I have successfully createda table and datasource which I have bound to
the FormView. I can create a record in the table OK.

The problem is that I want to bind a DropDownList selected value to the
datasource.

here is my code, I it simply does not work as the table field ends upo with
NULL

<asp:DropDownList ID="DropDownList1" runat="server" DataValueField='<%#
bind("Gender") %>' >

<asp:ListItem Value="0">Male</asp:ListItem>

<asp:ListItem Value="1">Female</asp:ListItem>

</asp:DropDownList>

Any Ideas ?
Apr 17 '07 #1
1 3124
Dont worry, I needed the Text property, that returned the selected value

Thanks for looking anyway.

"Just Me" <news.microsoft.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
Hi, I have successfully createda table and datasource which I have bound
to the FormView. I can create a record in the table OK.

The problem is that I want to bind a DropDownList selected value to the
datasource.

here is my code, I it simply does not work as the table field ends upo
with NULL

<asp:DropDownList ID="DropDownList1" runat="server" DataValueField='<%#
bind("Gender") %>' >

<asp:ListItem Value="0">Male</asp:ListItem>

<asp:ListItem Value="1">Female</asp:ListItem>

</asp:DropDownList>

Any Ideas ?


Apr 17 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: John R. Lewis | last post by:
I posted this yesterday with a different email address. I am reposting with my fake-address as given to me by Microsoft so that I can be guraranteed a response from a support representative. Sorry...
2
by: P. Yanzick | last post by:
Hello, I am creating an edit template for a FormView control, changing one of the textboxes to a dropdown box. The dropdown will be populated from a simple table with the primary key, and a...
3
by: Bas Paap | last post by:
I'm having a problem with formviews and DropDownLists in ASP.NET 2.0. I'm using a formview to insert an order into a database. Part of the order is the customer. Currently, I have a dropdownlist...
3
by: sck10 | last post by:
Hello, I am trying to bind an arraylist to a FormView DropDownList control in the PreRender state. The error that I get is the following: Databinding methods such as Eval(), XPath(), and...
4
by: J055 | last post by:
Hi I thought I was trying to do something very simple but I'm have a lot of trouble trying to do the following. <asp:FormView ID="fvGroups" runat="server" DataKeyNames="GroupID"...
6
by: AG | last post by:
ASP.NET 2.0 aspx page with a FormView bound to an ObjectDataSource to view, add and edit records. Can anyone point me to a sample of how to retain the user entered control values when an insert...
1
by: Anilsg | last post by:
Hi all, I have the DropDownList in the FormView,inside InsertTemplateField The data is binded in run time to it in codebehind page,FOr the First time the page is loaded the DropdownList is...
0
by: Anilsg | last post by:
Hi all, I have the DropDownList in the FormView,inside InsertTemplateField The data is binded in run time to it in codebehind page,FOr the First time the page is loaded the DropdownList...
1
by: Paulo | last post by:
Hi, I have a aspx with a a FormView on left wich opens insert template as default containing all the TextsBox, Combos, etc, and on right a GridView listing the stored itens (ID column key)... When...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.