Formview with ObjectDataSource

Discussion in 'Software' started by rturner003, Oct 26, 2006.

  1. rturner003

    rturner003

    Joined:
    Oct 26, 2006
    Messages:
    1
    I have come across a problem using the formview with an objectdatasource. When using an object datasource a piece of code like
    Button test = (Button)frmvDetails.Controls[0].FindControl("EditButton");
    test.Enabled = false;

    will generate an error 'Object reference not set to an instance of an object'. Set the formview to reference an SQLDataSource and it is no problem.

    I have noticed that if create a new formview and attach it to objectdatasource it will not generate the template code as it does with the SQL code. This is not a problem as it is just a little coding but not being able to reference controls is a problem.

    For what I want to do if found the SQLdatasource a problem and the objectdatasource worked really well.

    Can anybody help
    rturner003, Oct 26, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page