Problem to Link button

HuaMin Chen
HuaMin Chen used Ask the Experts™
on
Hi,
There is Link button below, to the GV
        <asp:GridView ID="gvResult" runat="server" 
            CellPadding="4" ForeColor="#333333" Font-Size="12px" 
            AutoGenerateColumns="False" PageSize="20" 
            DataKeyNames="id"
            style="margin-top: 1px" AllowPaging="True" 
            onpageindexchanging="gvResult_PageIndexChanging" 
            OnRowDataBound="gvResult_RowDataBound" onrowcommand="gvResult_RowCommand">
            <PagerSettings Mode="NumericFirstLast" />
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <Columns>
                <asp:TemplateField ShowHeader="False">
                    <ItemTemplate>
                        <asp:LinkButton ID="lbEdit" runat="server" CausesValidation="False" 
                            CommandName="RowEdit" Text="更改資料" CommandArgument='<%# Eval("Id") %>'></asp:LinkButton>
                            
                        <asp:LinkButton ID="lbEdit2" runat="server" CausesValidation="False" 
                            CommandName="RowEdit2" Text="更改資料" CommandArgument='<%# Eval("Id") %>'></asp:LinkButton>
                    </ItemTemplate>
					...

Open in new window

when running the page, the Link button is not shown. But I cannot find out any codes, which are hiding such Link button. Why?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
teebonTechnology Manager

Commented:
Is the grid showing and did you see any error message?
You may want to provide a screenshot.
Ryan ChongSoftware Team Lead

Commented:
is your datagrid bind to a datasource and got records returned to the screen?
HuaMin ChenProblem resolver

Author

Commented:
I do not get any error message shown, on the page.
Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

Ryan ChongSoftware Team Lead

Commented:
>>is your datagrid bind to a datasource and got records returned to the screen?

I mean..

is your gridview control bind to a datasource and got records returned to the screen?
HuaMin ChenProblem resolver

Author

Commented:
Yes, GV is binding to a datasource.
Why can't I see the codes that are disabling the button below
 
                <asp:TemplateField ShowHeader="False">
                    <ItemTemplate>
                        <asp:LinkButton ID="lbEdit" runat="server" CausesValidation="False"
                            CommandName="RowEdit" Text="更改資料" CommandArgument='<%# Eval("Id") %>'></asp:LinkButton>
                           
                        <asp:LinkButton ID="lbEdit2" runat="server" CausesValidation="False"
                            CommandName="RowEdit2" Text="更改資料" CommandArgument='<%# Eval("Id") %>'></asp:LinkButton>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Center" Width="30px" />                   
                </asp:TemplateField>
                                ...

Open in new window

Ryan ChongSoftware Team Lead

Commented:
>>Why can't I see the codes that are disabling the button below
is your original question asking why the linkbuttons are not being shown or being disabled in the page?
HuaMin ChenProblem resolver

Author

Commented:
yes
Ryan ChongSoftware Team Lead

Commented:
perhaps I should emphasize my question...

>> is your original question asking why the linkbuttons are not being shown OR being disabled in the page?
HuaMin ChenProblem resolver

Author

Commented:
how to ensure the button is being shown there?
Ryan ChongSoftware Team Lead

Commented:
>>how to ensure the button is being shown there?
I don't have a VS with me right now, but you can do quick checks:

-ensure your linkbutton control is visible in the page (not using scripts to set the visible property to false)
-since it's within your GV control, ensure your GV column is not being hidden via scripts (not to set the column's visible property to false)
-there is data that binded to GV, NO data = Nothing will be shown
HuaMin ChenProblem resolver

Author

Commented:
Sorry, GV is being shown. But I do not know why Linkbutton is not shown there.
Software Team Lead
Commented:
I did a test and my link buttons are visible (yes, nothing special, it will appear).

link buttons
can you ensure and answer questions below?

1. ensure your linkbutton control is visible in the page (not using scripts to set the visible property to false)
2. since it's within your GV control, ensure your GV column is not being hidden via scripts (not to set the column's visible property to false)

and try do a search in your script to see if you did hide the columns or the linkbuttons in your scripts?

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial