XModPro

Dependant Textbox

Edwin S Edwin S posted May 9, 2014
Active May 9 · Viewed 1751 times

I need to autofill the textbox based on dropdownlist selection

I have fields in Table m_VendorType

VendorTypeID, VendorTypeName,VendorTypeFee

I have one dropdownlist with

DataTextField="VendorTypeName" DataValueField="VendorTypeID"

Now I want to have vendor Fee autofilled on the textbox below, how to do that?

Here is my code, but its not working:

<ControlDataSource Id="dsVendorType" CommandText="SELECT VendorTypeID, VendorTypeName FROM m_VendorType" />

<ControlDataSource Id="dsVendorTypeFee" CommandText="SELECT VendorTypeFee FROM m_VendorType WHERE VendorTypeID = @theVendorTypeID" >
<Parameter name="theVendorTypeID" />
</ControlDataSource>

<DropDownList Id="VendorType" DataField="VendorType" DataType="String"
DataSourceId="dsVendorType" DataTextField="VendorTypeName" DataValueField="VendorTypeID"
TargetDataSourceId="dsVendorTypeFee" ParameterName="theVendorTypeID" TargetControlId="VendorFee" />

<TextBox id="VendorFee" DataField="VendorTypeFee" DataType="int32" DataSourceId="dsVendorTypeFee" />

Thenks before

2 Replies

Loading replies...