如何在Codebehind c#中打开一个弹出式div

时间:2017-02-10 14:42:18

标签: c# asp.net webforms

在项目模板c#上打开弹出窗口。 我的问题是,当我点击弹出窗口时,它将打开弹出窗口,但它不会命中RowCommand参数(即e.commandname)。 这是代码:

 <ItemTemplate><asp:LinkButton ID="imgAppointment" Text="Appointment" runat="server" Style="float: left; margin-right: 5px;" CommandName="App" CommandArgument='<%#Eval("ID") %>' CssClass="label label-sm label-success" data-backdrop="static" data-toggle="modal" data-target="#AddTask"></asp:LinkButton></ItemTemplate>

这是代码:

 protected void gvTaskDetails_RowCommand(object sender, GridViewCommandEventArgs e)
        {
 if (e.CommandName == "App")
        {
            DataTable retval = obj.FetchAppointmentByMalmrktId(Convert.ToInt32(e.CommandArgument));
            if (retval.Rows.Count > 0)
            {
                Repeater rptCustomers = (Repeater)Page.FindControl("rptCustomers");
                rptCustomers.DataSource = retval;
                rptCustomers.DataBind();

            }
        }
            }

这是弹出式div:

  <div class="modal fade " id="AddTask" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="margin-right: -15px !important;">
    <div class="modal-dialog" style="margin-right: 0; width: 50%; margin-top: 0; margin-bottom: 0px; background: #fff; height: 100vh; overflow-y: auto;">
        <div class="modal-header">
            <div class="row">
                <div class="col-sm-6">
                    <h3 class="text-primary text-big" style="margin-top: 0px; margin-bottom: 0px;"><b>Appointment </b></h3>
                </div>
                <div class="col-sm-6">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="fa fa-chevron-circle-right" id="btnAddTaskclose"></i></button>
                </div>
            </div>

<asp:Repeater ID="rptCustomers" runat="server">
                        <HeaderTemplate>
                            <div class="box-model">
                                <table class="table">
                                    <tr>
                                        <th style="width: 140px;">Appointment Date :
                                        </th>
                                    </tr>
                                    <tr>
                                        <th style="width: 140px;">Details  :
                                        </th>
                                    </tr>
                                </table>
                            </div>
                        </HeaderTemplate>

                        <ItemTemplate>
                            <tr>
                                <td style="width: 400px;">
                                    <asp:Label ID="lbAppointmentdt" runat="server" Text='<%# Eval("Appointmentdate") %>' />
                                </td>
                                <td style="width: 400px;">
                                    <asp:Label ID="lblDetails" runat="server" Text='<%# Eval("Details") %>' />
                                </td>
                                <td>Status
                                    <br />
                                    <button type="button" class="btn btn-xs btn-danger">Cancel Appointment</button>
                                </td>
                            </tr>
                        </ItemTemplate>


                    </asp:Repeater>

叔&GT;

1 个答案:

答案 0 :(得分:0)

如果没有其他工作,您可以尝试手动触发事件。 如果命令事件是你需要的(如果我正确理解),你可以点击这样的事件:

$folder = '\\server\folder' 
$filter = '*.wav' 

$fsw = New-Object IO.FileSystemWatcher $folder, $filter -Property @{IncludeSubdirectories = $false;NotifyFilter = [IO.NotifyFilters]'FileName, LastWrite'}

Register-ObjectEvent $fsw Created -SourceIdentifier FileCreated -Action { 
$name = $Event.SourceEventArgs.Name 
$changeType = $Event.SourceEventArgs.ChangeType 
$timeStamp = $Event.TimeGenerated 
Write-Host "The file '$name' was $changeType at $timeStamp" -fore green 
write-host "test"
Invoke-Item '\\server\folder\checksum.bat'

如果我遗失了某些内容,请告诉我。这是我首先想到的。我希望这可以在某种程度上帮助你。