Objectdatasource DefaultValue property and Integer error  
Author Message

PostPosted: Top

ASP.Net >> Objectdatasource DefaultValue property and Integer error

Hello guys,
I have some wiered problem ...I have a header details form where the
header part is a datagrid and the details part is a Detailsview

Once I select a record in the header it should show in the details
part. It works fine with strings but now i have a field which is
Integer and it complains about conversion. The bind is below:

<asp:ControlParameter ControlID="GridView1"
DefaultValue="EmployeeID = {0}" Name="argID"
PropertyName="SelectedValue" Type="Int32" />

is this format correct? DefaultValue="EmployeeID = {0}" ?

I use the code behinde to fill the detailsview and it works fine eg

Dim emp As New Employees

Dim empId As Integer
empId = Val(GridView1.SelectedValue.ToString)

Me.DetailsView1.DataSource = emp.GetEmployeesByID(empId)

Web Programming334