updatepanel中的href无法正常工作

时间:2017-09-15 11:00:00

标签: javascript jquery html asp.net

我在UpdatePanel内使用了<div><a>里面有<Eval>。 它适用于<div>但是,当我点击<a>内的<div>标记时,它会像新页面一样打开。以前它就像Pop-Up。这是我的代码

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
  <ContentTemplate>
    <asp:UpdateProgress ID="updateProgress1" runat="server">
      <ProgressTemplate>
        <div style="position: fixed; text-align: center; height: 100%; width: 100%; top: 0; right: 0; left: 0; z-index: 9999999; background-color: #000000; opacity: 0.7;">
          <asp:Image ID="imgUpdateProgress" Width="325px" Height="250px" runat="server" ImageUrl="~/images/loader.gif" AlternateText="Loading ..." ToolTip="Loading ..." Style="border-width: 0px; position: center; padding: 50px; font-size: 36px;" />
        </div>
      </ProgressTemplate>
    </asp:UpdateProgress>

    <div class="box box-default collapsed-box" id="divThree" runat="server">
      <div class="box-header with-border">
        <h3 class="box-title">11kV Feeder Three Phase Supply as on
          <var id="d1">name</var></h3>
        <div class="exportimports_mainpage" id="divThreeExport" runat="server" visible="false">
          <asp:ImageButton class="PhaseExcel" ID="ThreePhaseExcel" runat="server" ImageUrl="~/images/excel.png" OnClick="ThreePhaseExcel_Click" />
          <asp:ImageButton class="PhasePdf" ID="ThreePhasePdf" runat="server" ImageUrl="~/images/pdf.png" OnClick="ThreePhasePdf_Click" />
        </div>
        <div class="box-tools pull-right">
          <button class="btn btn-box-tool" data-widget="collapse" id="btnThreePhase" runat="server" onserverclick="btnThreePhase_Click"><i class="fa fa-plus" id="iThree" runat="server"></i></button>
        </div>
        <!-- /.box-tools -->
      </div>
      <!-- /.box-header -->
      <div class="box-body">

        <div class="grid_table">

          <asp:GridView ID="ThreePh_Grid" runat="server" AutoGenerateColumns="false" DataKeyNames="meterno,substation">
            <Columns>
              <asp:BoundField DataField="sno" HeaderText="S.No" />
              <asp:BoundField DataField="substation" HeaderText="33kV SS" />
              <asp:BoundField DataField="feedername" HeaderText="11kV Feeder" />
              <asp:BoundField DataField="type" HeaderText="Type" />
              <asp:TemplateField HeaderText="Meter No">
                <ItemTemplate>
                  <a class="iframe" href='<%#"frmFeederMasterData.aspx?meterno="+DataBinder.Eval(Container.DataItem,"meterno")%>'>
                    <%#Eval("meterno")%>
                  </a>
                </ItemTemplate>
              </asp:TemplateField>
              <asp:BoundField DataField="Mf" HeaderText="MF" />
              <asp:BoundField DataField="rtc" HeaderText="Date" />
              <asp:BoundField DataField="duration" HeaderText="Duration(Hrs:Mins)" ItemStyle-CssClass="grid_c" HeaderStyle-CssClass="grid_c" />
              <asp:BoundField DataField="kwhcons" HeaderText="Consumption kWh" ItemStyle-CssClass="grid_rt" HeaderStyle-CssClass="grid_rt" />
              <asp:BoundField DataField="spells" HeaderText="No.of Spells" ItemStyle-CssClass="grid_rt" HeaderStyle-CssClass="grid_rt" />
              <asp:TemplateField HeaderText="Action" ItemStyle-CssClass="grid_c" HeaderStyle-CssClass="grid_c">
                <ItemTemplate>
                  <div class="actions">
                    <a class="iframe" href='<%#"frmPhaseHistory.aspx?event=Three Phase Running&meterno="+DataBinder.Eval(Container.DataItem,"meterno") + "&fromdate=" +  string.Format(DateTime.Now.AddDays(-1).ToString("dd-MM-yyyy")) + "&todate=" + string.Format(DateTime.Now.AddDays(-1).ToString("dd-MM-yyyy"))%>'>
                                                                            <img src='<%=strHistoryImage%>' title="History" /></a>
                    <a class="iframe nomobile" href='<%#"frmLiveSubstation.aspx?substation="+DataBinder.Eval(Container.DataItem,"substation")%>'>
                                                                            <img src='<%=strGraphImage%>' title="Graph" /></a>
                  </div>
                </ItemTemplate>
              </asp:TemplateField>
            </Columns>
          </asp:GridView>
        </div>

      </div>
      <!-- /.box-body -->
    </div>

  </ContentTemplate>
</asp:UpdatePanel>

<a class="iframe" href='<%#"frmFeederMasterData.aspx?meterno="+DataBinder.Eval(Container.DataItem,"meterno")%>'>
     <%#Eval("meterno")%>
</a>

是其中之一。请帮我 !我从3天开始苦苦挣扎。

这里我想要的图像Image。但是,它像普通页面一样开放。

0 个答案:

没有答案