- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
Gridview RowCommand 没有在服务器上触发,但是当我在本地系统上使用它时它可以工作。但是当我发布并发布到服务器时 RowCommand 没有被触发..你能给我一个解决方案吗...这是我的 GridView 代码.
Aspx代码:
<asp:GridView ID="gvCandiList" runat="server" Style="border: 1px;" RowStyle-BorderColor="#ebf3e4"ViewStateMode="Enabled" RowStyle-BorderStyle="None" GridLines="Both" PageSize="10" AllowPaging="true" AutoGenerateColumns="false" Width="100%" AlternatingRowStyle-BackColor="" CssClass="grdCandList" RowStyle-CssClass="RowStyle" AlternatingRowStyle-CssClass="AltRowStyle" HeaderStyle-CssClass="grdheaderCandList"
DataKeyNames="UserId" OnPageIndexChanging="gvCandiList_PageIndexChanging" OnRowCommand="gvCandiList_RowCommand"OnRowDataBound="gvCandiList_RowDataBound" AllowSorting="true" OnSorting="gvCandiList_Sorting">
<EmptyDataTemplate>
<div class="shadowbox" style="min-height: 75px;">
<br />
<center>
No Data Found.</center>
</div>
</EmptyDataTemplate>
<Columns>
<asp:TemplateField HeaderText="Name" ItemStyle-CssClass="grdcolumncenter" HeaderStyle-CssClass="grdcolumnheadermiddle pad_left5 pad_right5 NameHeaderWidth"
SortExpression="CandiName">
<ItemTemplate>
<h4 style="font-size: 13px; text-align: left; font-weight: normal !important; color: rgb(67, 73, 75);font-family: Calibri;">
<asp:LinkButtonID="lnkCandidateView" runat="server" Style="text-decoration: none;
color: rgb(67, 73, 75);" onmouseover='mouseover(this);' onmouseout='mouseout(this);' CommandName="View" CommandArgument='<%# Eval("CandidateId")%>'>
<asp:Label ToolTip='<%# Eval("CandiName")%>' ID="lblGrdCandiName" runat="server"Text='<%# Eval("CandiName")%>'></asp:Label></asp:LinkButton></h4>
<asp:ImageButton ID="ImageButton1" runat="server" Visible="false" ImageUrl="~/Images/edit.png"CommandName="Modi" CommandArgument='<%# Eval("UserId")%>' ToolTip="Edit" />
<asp:ImageButton ID="ImageButton2" runat="server" ToolTip="View" Visible="false"
ImageUrl="~/Images/view.png" CommandName="View" CommandArgument='<%# Eval("UserId")%>' />
<asp:ImageButton ID="ImageButton3" runat="server" ToolTip="Delete" Visible="false" ImageUrl="~/Images/delete.png" CommandName="Del" CommandArgument='<%# Eval("UserId")%>'
OnClientClick="return confirm('Are you sure ?');" />
<div style="float: left;">
<asp:UpdatePanel ID="UpdatePanel5" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:ImageButton ID="imgbtnNewCmnt" runat="server" Visible="false" CommandName="NewCmnt" CommandArgument='<%# Eval("CandidateId")%>' ToolTip="New Comment" ImageUrl="~/Images/reminder.png" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</ItemTemplate>
</asp:TemplateField>
</asp:GridView>
ASPX.CS
protected void gvCandiList_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName.Equals("View"))
{
Session["CandiUserId"] = e.CommandArgument.ToString();
DisplayCandidateDetails();
}
}
最佳答案
元素“Button”的开始标签和结束标签之间不允许有内容
因此将您的 lnkCandidateView 按钮替换为
<asp:Button ID="lnkCandidateView" ToolTip='<%# Eval("CandiName")%>' Text='<%# Eval("CandiName")%>'
runat="server" Style="text-decoration: none; color: rgb(67, 73, 75);" onmouseover='mouseover(this);'
onmouseout='mouseout(this);' CommandName="View" CommandArgument='<%# Eval("CandidateId")%>' />
关于c# - Gridview RowCommand 不在服务器上触发但在本地工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22935252/
我正在尝试以编程方式在 ASP.NET 中添加一个按钮,以 C# 作为后端。我能够显示该按钮,但当用户单击该按钮时 RowCommand 没有被触发。 我认为问题在于我在用户单击“提交”按钮后创建按钮
这可能看起来像是重复的,但我不这么认为。我已经搜索过 stackoverflow,可能还不够。 这是我的挑战: ' Text="Delete" OnClientClick="return con
Gridview RowCommand 没有在服务器上触发,但是当我在本地系统上使用它时它可以工作。但是当我发布并发布到服务器时 RowCommand 没有被触发..你能给我一个解决方案吗...这是我
我已经找到了解决方案,我只是想发布它,以便对某些人有用 这是使用命令的按钮
我有一个显示产品版本的网格和一些链接按钮,如编辑、删除、预览等。单击编辑按钮后,我想获取产品 ID 和版本 ID,并重定向到某个 xyz.aspx 页面,可以在其中编辑产品详细信息。 这是我的网格的样
我有一个看起来像这样的 GridView: ... '
' runat="server" Text="View"> 代码隐藏: protected void t
当调用 rowcommand 时,我尝试跨多个命令参数发送: ' />
' runat="server" Text="View"> 代码隐藏: protected void t
我的 GridView 基本上显示数据库中数据的汇总版本。 我想做的是设置它,以便当您单击 GridView 中一行中的任意位置时,它应该执行一个设置过程,该过程将隐藏包含 GridView 的面板并
首先,我意识到其中的大部分也可以使用 ItemTemplates 来完成。如果我尝试做的事情根本不可能,我会考虑改用它们。 以下是我的困境的基本情况: 我在代码隐藏中加载的 ASPX 页面中有一个 G
来自德国的美好下午, 我在带有 RowCommand 事件的行上有一个 asp:GridView 和 ButtonFields。 protected void gridView_RowCommand(
我正在尝试将 TextBox 中的 Value 转换为 gridview 的 RowCommand 中的 int。 else if (e.CommandName == "UpdateRow") {
您好,我有一个 GridView ,每行都有一个文本框,我正在尝试获取 RowCommand 事件中的值。下面的代码适用于除第一行以外的所有行。第一行的 textbox.text 值始终为空。
我在 aspx 中使用 gridview,我有两个页面,注册和 details.aspx 一旦注册完成,它应该转到 details.aspx 中的详细信息页面。我在那个 GV 中保留了一个 gridv
我有一个 asp.net GridView: ' CommandName="ViewFactors" ImageUrl="~/tadarokat/Images/factor
我有一个 gridview,在这个 gridview 上有一个 linkbutton。 单击链接按钮时,rowCommand 触发,但是我想要求用户使用确认框确认单击, 如果是 -> rowComma
有谁知道如何从 ASP 中的 Gridview RowCommand 事件调用 Javascript 函数? 我需要调用函数来接收 rowindex 但我不知道如何从 rowcommand 调用 ja
我有一个带链接按钮的 GridView 。我使用 jquery 和 css 为链接按钮设置了一个灯箱。 链接按钮源代码 '
我正在使用 GridView绑定(bind)到 List .当RowCommand被某个按钮触发 我希望能够检索当前行的 Customer来自 e.CommandArgument 的对象,像这样: p
我是一名优秀的程序员,十分优秀!