S
Stan SR
Hi,
I use a user control within a gridview
Something like this
<asp:GridView DataSourceID="myDatasource" ID="gvList" runat="server">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal runat="server" id="article" Text='<%#
Eval("myArticle")%>' />
<uc:MyControl runat="server" ID="myUC" Url='<%#
Eval("myUrl")%>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
My UserControl is a control that must control an url to display a picture
(it makes some actions before).
For my test, I just put a literal on the control and add a property
private string _url="";
public string Url
{
get {return _url; }
set {_url=value;}
}
Inside the page Load event (of the user control), I just have
myLiteral.Text=Url;
But when I use <uc:MyControl runat="server" ID="myUC" Url='<%#
Eval("myUrl")%>' />, it seems it doesn't submit the field's value.
If I use <uc:MyControl runat="server" ID="myUC" Url="test" /> I get the test
value for each row of my gridview.
How can I solve this problem ??
Thanks for your help
Stan
I use a user control within a gridview
Something like this
<asp:GridView DataSourceID="myDatasource" ID="gvList" runat="server">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal runat="server" id="article" Text='<%#
Eval("myArticle")%>' />
<uc:MyControl runat="server" ID="myUC" Url='<%#
Eval("myUrl")%>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
My UserControl is a control that must control an url to display a picture
(it makes some actions before).
For my test, I just put a literal on the control and add a property
private string _url="";
public string Url
{
get {return _url; }
set {_url=value;}
}
Inside the page Load event (of the user control), I just have
myLiteral.Text=Url;
But when I use <uc:MyControl runat="server" ID="myUC" Url='<%#
Eval("myUrl")%>' />, it seems it doesn't submit the field's value.
If I use <uc:MyControl runat="server" ID="myUC" Url="test" /> I get the test
value for each row of my gridview.
How can I solve this problem ??
Thanks for your help
Stan