Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 24th, 2009, 10:27 PM
Registered User
 
Join Date: Aug 2009
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Update one text field from another source

Hi,

I have a form called "formStudentDemographics". Is is bound to datasource "sqlStudentDemographics". There is a textbox on the insert section of the form call "studentNameID". The format for the field in the DB is int. This textbox has the following code for binding it to the database:


StudentNameID:

<asp:TextBox ID="StudentNameIDTextBox" runat="server" Text='<%# Bind("StudentNameID") %>'></a

When the form loads to the insert section, I need the "studentNameID" to automatically be filled in with or equal to "IDStudentName" which is in the dropdownlist "ddlStudentNamefilter". I've provided the code for that dropdownlist below:

asp:DropDownList ID="ddlStudentNameFilter" runat="server" AutoPostBack="True" DataSourceID="sqlStudentNameFilter"

DataTextField="Student_Name" DataValueField="IDStudentName" Width="208px" Enabled="False" Font-Bold="True">

_______________________

I'm assuming there needs to be code in the codebehind bu am not sure how to do this or how to code it.

Any help would be greatly appreciated.

Thanks,

Leesha
 
Old November 24th, 2009, 08:43 AM
Friend of Wrox
 
Join Date: May 2006
Posts: 107
Thanks: 1
Thanked 8 Times in 7 Posts
Default

Try

IDStudentName.Text = ddlStudentNamefilter.SelectedValue





Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert Text(Sql Server Text Field) to Image(JPG) srinivas72 ADO.NET 2 February 13th, 2009 06:31 PM
Update Many Destination while using One Source jase2007 SQL Server DTS 0 September 20th, 2007 05:08 AM
Table field update ibelta Access 4 February 12th, 2005 08:22 PM
Update Source Record After Insert Duncan Allen SQL Server DTS 1 October 25th, 2004 10:44 AM
Update city field based on zip field nganb SQL Server ASP 0 April 22nd, 2004 10:30 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.