Wednesday, March 21, 2012

Passing a reference to a component

All,
I want to be able to pass a component referance to a function e.g I dont know what component it will be but need to bind data to it. See code

void BindDataToControl(Object paramControlName,String QueryString){


Response.Write("Object = "+ paramControlName);

// I have a class that gets the data and returns a recordset fine
//open DB and get data here
// just need help with getting the paramater bound to the data

paramControlName.DataSource = RSMenuData;
paramControlName.DataBind();


//close data base connection and clean up here
}

Any ideas how I can get over this?? ANy better ideas??

Thanks

ED BOC

Not sure, but maybe this topic will help:

http://forums.asp.net/thread/1215456.aspx


Thanks I will give it a go and post the results (if i get it working!)

Cheers

0 comments:

Post a Comment