首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

弹出层停不住解决办法

2012-04-18 
弹出层停不住div class Dialog idAddOrEditRoleDialog styletop: 80px width: 480px display:

弹出层停不住
<div class=" Dialog" id="AddOrEditRoleDialog" style="top: 80px; width: 480px; display: none;
  text-align: center; margin: aotu;">
  <div class=" DialogHeader" onmousedown="javascript:Drag(this,$get('AddOrEditRoleDialog'),event)">
  <div class="DialogHeaderLeft">
  <div class="DialogExpandImage">
  <img src="../Resourse/Theme/images/add.gif" /></div>
  </div>
  <div id="PerAddMenu" class="DialogHeaderCenter">
  添加产品分类</div>
  <div id="PerEditRole" class="DialogHeaderCenter" style="display: none;">
  编辑产品名称</div>
  </div>
  <div class=" DialogContent" style="padding-top: 15px; padding-bottom: 15px;">
  <asp:UpdatePanel ID="UpdatePanelNewPerAssetReg" runat="server" UpdateMode="Conditional"
  ChildrenAsTriggers="false">
  <ContentTemplate>
  <table style="width: 90%;" class="styleTable">
  <tr>
  <td class="FormItemText">
  品牌名称:
  </td>
  <td class="FromItemLeft">
  <asp:DropDownList ID="DDL_CompanyName" runat="server" Width="155px">
  </asp:DropDownList>
  </td>
  <td class="FormItemText">
   
  </td>
  </tr>
  <tr>
  <td class="FormItemText">
  分类名称:
  </td>
  <td class="FromItemLeft">
  <asp:TextBox ID="TB_ProType" runat="server"></asp:TextBox>
  </td>
  <td class="FormItemText">
   
  </td>
  </tr>
   
  <tr>
  <td colspan="2" align="center">
  <asp:Button ID="SavePerRoletRegButton" AccessKey="F" onmouseover="javascript:this.className='ButtonOver'"
  onmouseout="javascript:this.className='Button'" runat="server" CssClass="Button"
  Text=" 添加(F) " OnClientClick="javascript:return checkSubmit();" OnClick="SavePerRoletRegButton_Click"
  UseSubmitBehavior="True" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  <input class=" Button" accesskey="C" onmouseover="javascript:this.className='ButtonOver'"
  onmouseout="javascript:this.className='Button'" type="button" value=" 取消(C) "


  onclick="javascript:cancelSave();" />
  </td>
  </tr>
  </table>
  </ContentTemplate>
  </asp:UpdatePanel>
  </div>

JS
//编辑
  function editRole() { 
  if ($get("<%=TB_rolId.ClientID%>").value.trim() == "") {
  alert("你没有选择要编辑的选项,请选择!");
  return false;
  }
   
   
  var table = $get("<%=GV_RoleList.ClientID %>");
  if (table && table.rows.length > 0) {
  var row = table.rows[table.rowIndex];
  $get("<%=TB_ProType.ClientID %>").value = row.getAttribute("FTypeName");
   
  }
  $get("<%=TB_addOreditRole.ClientID %>").value = "edit";
  $get("<%=SavePerRoletRegButton.ClientID %>").value = " 编辑(F) ";
   
  $get('AddOrEditRoleDialog').style.display = 'block';
  $get('PerEditRole').style.display = 'block';
  $get('DialogMask').style.display = 'block';

  __doPostBack("<%=LBTN_BindDDLCompany.UniqueID %>", "");

  }


应该是JS有问题

[解决办法]
弹出的层还是在当前页面中,并且目前的js还没有办法实现阻塞(不知道HTML5咋样),所以你弹出层后再执行提交,肯定是没办法停住的。因此,你需要将弹出层的操作与你提交后台的操作进行分开写,你可以将你的提交事件放在弹出层的按钮里面,也可以在弹出层的按钮里面回调doPostBack

热点排行