我正在创建一个评论网络用户控件。我想在不同的页面上使用此评论控件,例如:文章、景点和类别。
因此,在文章页面上,我声明了 Web 用户控件
<uc1:Comments ID="Comments1" runat="server" />
在控件上,有一个函数调用loadComments
public void LoadComents(int ID,string type)
{
//Load the comments into an asp.net repeater that resides on the control
}
一旦我确认文章存在,我想调用它。所以在文章页面上我想做类似的事情
Comments1.LoadComents(101,"article");
这可能吗?