How I can convert my '<%# Eval.......%>' code in Page.aspx to Page.aspx.vb ?
-
Hi all, I have code for menu in page.aspx, but now i want write this code in page.aspx.vb for menu programming. How i can convert this code? this is my code:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
<Columns>
asp:TemplateField
<ItemTemplate>
<asp:Panel ID="Panel1" Runat="Server">
<asp:LinkButton ID="LinkButton1" Text='<%# Eval("nam") %>' Runat="Server"
PostBackUrl='<%# Eval("id","Page.aspx?id={0}") %>'ForeColor="#990000" Font-Underline="False"/> </asp:Panel> </ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>i didn't use SqlDataSouece, and i used dataset for filling gridview. Now how i can write these code in page.aspx.vb instead of using Eval in page.aspx? Thank you
Hoda
-
Hi all, I have code for menu in page.aspx, but now i want write this code in page.aspx.vb for menu programming. How i can convert this code? this is my code:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
<Columns>
asp:TemplateField
<ItemTemplate>
<asp:Panel ID="Panel1" Runat="Server">
<asp:LinkButton ID="LinkButton1" Text='<%# Eval("nam") %>' Runat="Server"
PostBackUrl='<%# Eval("id","Page.aspx?id={0}") %>'ForeColor="#990000" Font-Underline="False"/> </asp:Panel> </ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>i didn't use SqlDataSouece, and i used dataset for filling gridview. Now how i can write these code in page.aspx.vb instead of using Eval in page.aspx? Thank you
Hoda
Handle RowDataBound[^] event, use
FindControl()
to find the link button and set thePostBackUrl
. Looks like you need aHyperLink
button here, notLinkButton
. :)Navaneeth How to use google | Ask smart questions