I have a page with a Repeater control on it called Repeater1. On that page I
have a User Control I inserted using the HTML Method. Now I want to change
the Repeater's DataSource and then use DataBind method on it if a variable is
defined in the address bar. I've tried alot of things but so far no luck. The
main reason that I have the User Control is becuase it has all the database
controls (dbview, dataset, connection etc) and it also acts as a Menu that is
dynamicly generated based on a database query.
This Method Didn't work
This Function is in the WebForm1 where the Repeater is
public void RepeaterBinding(DataView dbDataViewSource)
{
Repeater1.DataSource = dbDataViewSource;
Repeater1.DataBind();
}
In the user control I tried doing this:
if(selectedcat != null)
{
string thefilter = "DownloadCategory= '"+selectedcat+"' ";
dbDataView.RowFilter = thefilter;
dbDataView.Table = dtDownloads;
DownloadScript.WebForm1 repeaterpage = new WebForm1();
repeaterpage.RepeaterBinding((DataView)this.dbData View);
Label1.Text = dbDataView.Table.Columns[0].ToString();
}
I get an error saying that there was no instance of an object.