弹出窗口无法正常显示 [英] Popup is not displaying properly

查看:76
本文介绍了弹出窗口无法正常显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好团队,其实我试图在我的代码中显示特定的div但是我试图在弹出显示中显示1秒然后消失。所以任何人都可以帮我解决这里是我的aspx文件

Hello team, Actually i am trying to show particular div in my code but the div i am trying to display in popup displays for 1 sec then vanishes.So can any one help me through it here is my aspx file

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <link href="App_Themes/StyleSheet3.css" rel="stylesheet" />
    <script type="text/javascript" src="Scripts/Timer/jquery.ui.timepicker.js?v=0.3.3"></script>
    <link rel="stylesheet" href="Scripts/Timer/jquery.ui.timepicker.css?v=0.3.3" type="text/css" />
    <link href="CSS/CustomShared.css" rel="stylesheet" />

</asp:Content>


<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <style>
			.ontop {
				z-index: 999;
				width: 100%;
				height: 100%;
				top: 0;
				left: 0;
				display: none;
				position: absolute;				
				background-color: #cccccc;
				color: #aaaaaa;
				opacity: .4;
				filter: alpha(opacity = 50);
			}
			#popup {
				width: 300px;
				height: 200px;
				position: absolute;
				color: #000000;
				background-color: #ffffff;
				/* To align popup window at the center of screen*/
				top: 50%;
				left: 50%;
				margin-top: -100px;
				margin-left: -150px;
			}
		</style>
		<script type="text/javascript">
		    function pop(div) {
		        document.getElementById(div).style.display = 'block';
		    }
		    function hide(div) {
		        document.getElementById(div).style.display = 'none';
		    }
		    //To detect escape button
		    document.onkeydown = function (evt) {
		        evt = evt || window.event;
		        if (evt.keyCode == 27) {
		            hide('popDiv');
		        }
		    };
		</script>
    <div class="clear"></div>
    <hr />
    <div>
            <asp:FileUpload ID="FileUpload1" runat="server" ForeColor="Red" />
            <asp:RegularExpressionValidator 
            id="FileUpLoadValidator" runat="server" 
            ErrorMessage="Upload only xlsx." 
            ValidationExpression="^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))(.xlsx)$" 
            ControlToValidate="FileUpload1" ForeColor="Red"></asp:RegularExpressionValidator>
    
            <asp:Button id="UploadBtn" Text="Upload File"  OnClick="UploadBtn_Click" runat="server" Width="105px" />
            <asp:Label ID="lblMessage" ForeColor="Red" runat="server"></asp:Label>
        </div>
    <asp:GridView ID="gvDetails" runat="server" CssClass="grid clsWrap" AutoGenerateColumns="False"  PageSize="20" Width="960px">
        <Columns>
            <asp:BoundField DataField="taskdescription" HeaderText="Work Item"></asp:BoundField>
            <asp:BoundField DataField="fromdate" HeaderText="From Date"></asp:BoundField>
            <asp:BoundField HeaderStyle-CssClass="gridB" DataField="todate" HeaderText="To Date"></asp:BoundField>

        </Columns>
        <HeaderStyle Font-Bold="False" CssClass="Font gvheaderstyle" Wrap="False" />
        <PagerStyle CssClass="gridB" ForeColor="WhiteSmoke" />
        <RowStyle HorizontalAlign="Center" />
    </asp:GridView>
     <%--Start--%>
      <div class="name">Manual Insert Task</div>
    <hr />
    <br />
    <br />
     <div class="clear"></div>
    <div id="error" style="padding-left: 10px" runat="server" visible="true">
        <asp:Label ID="lblError" runat="server" ForeColor="Red"></asp:Label>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BackColor="Black" ForeColor="White" BorderColor="white"  OnRowCommand="GridView1_RowCommand" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" AllowPaging="True" OnPageIndexChanging="GridView1_PageIndexChanging" PageSize="5" BorderWidth="2px" CellPadding="2" CellSpacing="5" GridLines="None" >
           
            <RowStyle BackColor="Black" />
                <AlternatingRowStyle BackColor="Black" />
                <FooterStyle BackColor="Black" />
                <HeaderStyle BackColor="#ff9933" Font-Bold="True" ForeColor="Black" />
                <PagerStyle BackColor="#ff9933" ForeColor="Black"
                    HorizontalAlign="Center" />
                <SortedAscendingCellStyle BackColor="#F1F1F1" />
                <SortedAscendingHeaderStyle BackColor="#ff9933" />
                <SortedDescendingCellStyle BackColor="Black" />
                <SortedDescendingHeaderStyle BackColor="#00547E" />

             <Columns>
                <asp:TemplateField HeaderText="Task Id">
                    <ItemTemplate>
                        <asp:Label ID="lblTaskId" Text='<%# Eval("TaskId") %>' runat="server" ></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>                           
                <asp:TemplateField HeaderText="Description">
                    <ItemTemplate>
                        <asp:Label ID="lblDescription" Text='<%# Eval("Description") %>' runat="server"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Project Name">
                    <ItemTemplate>
                        <asp:Label ID="lblProjectName" Text='<%# Eval("ProjectName") %>' runat="server"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Area">
                    <ItemTemplate>
                        <asp:Label ID="lblArea" Text='<%# Eval("Area") %>' runat="server"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Work Type">
                    <ItemTemplate>
                        <asp:Label ID="lblWorkType" Text='<%# Eval("WorkItemType") %>' runat="server"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Channel">
                    <ItemTemplate>
                        <asp:Label ID="lblChannel" Text='<%# Eval("Channel") %>' runat="server"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Tags">
                    <ItemTemplate>
                        <asp:Label ID="lblTags" Text='<%# Eval("Tags") %>' runat="server"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Team Name">
                    <ItemTemplate>
                        <asp:Label ID="lblTeamName" Text='<%# Eval("TeamName") %>' runat="server"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Task Name">
                    <ItemTemplate>
                        <asp:Label ID="lblTaskName" Text='<%# Eval("TaskName") %>' runat="server"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Edit">
                    <ItemTemplate>
                        <asp:Button ID="btnEdit" runat="server" Text="Edit" CommandName="EditRow" CausesValidation="false"/>
                    </ItemTemplate>
                </asp:TemplateField>             
            </Columns>
        </asp:GridView>    
    </div>
    <br />
    <div>
        <table>
        <tr>
        <td style="position:relative; left:-35%;"><a href="#" onClick="pop('popDiv')"> <asp:Button ID="btnadd" ValidationGroup="tab2" CssClass="col-centered ts-btn normalbtnsize" runat="server" Text="Add" BackColor="#ff9933" OnClick="btnadd_Click"/></a></td>          
        </tr>
        </table>
    </div>
    <br />
    <div class="clear"></div>
    <div id="popDiv" class="ontop"  >
        <div id="fade" class="black_overlay"></div>
        <div id="tab1" class="tab active">
            <table  class="formwrap center-block2">
               <tr>
                    <td class="auto-style5"></td>
                    <td class="auto-style7"style="color:#fff">Task Id
                        <label style="color: #FF3300">*</label></td>
                    <td class="auto-style4">
                        <table>
                            <tr>
                                <td>
                                    <asp:TextBox ID="txtEmpId" ClientIDMode="Static" placeholder="Task Id" CssClass="ts-inputbox4 left" ValidationGroup="tab1" runat="server" MaxLength="5"></asp:TextBox>
                                </td>
                                <td >
                                    <asp:RequiredFieldValidator ID="rfvEmpId" runat="server" ControlToValidate="txtEmpId" ErrorMessage="Task Id cannot be blank" Display="None" ForeColor="#FF3300"></asp:RequiredFieldValidator>
                                    <
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                  <tr>
                    <td class="auto-style5"></td>
                    <td class="auto-style7"style="color:#fff">Description
                        <label style="color: #FF3300">*</label></td>
                    <td class="auto-style4">
                        <table >
                            <tr>
                                <td>
                                    <asp:TextBox ID="TextBox1" ClientIDMode="Static" placeholder="Description" CssClass="ts-inputbox4 left" ValidationGroup="tab1" runat="server"></asp:TextBox>
                                </td>
                                 <td style="padding-left:200px;">
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtEmpId" ErrorMessage="Description cannot be blank" Display="None" ForeColor="#FF3300"></asp:RequiredFieldValidator>

                                </td>
                            </tr>

                        </table>
                    </td>
                </tr>
                <tr>
                    <td class="auto-style5"></td>
                    <td class="auto-style7"style="color:#fff">Project Name
                        <label style="color: #FF3300">*</label></td>
                    <td class="auto-style4">
                        <table>
                            <tr>
                                <td>
                                    <asp:TextBox ID="TextBox2" ClientIDMode="Static" placeholder="Project Name" CssClass="ts-inputbox4 left" ValidationGroup="tab1" runat="server"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtEmpId" ErrorMessage="Project Name cannot be blank" Display="None" ForeColor="#FF3300"></asp:RequiredFieldValidator>

                                </td>
                            </tr>

                        </table>
                    </td>
                </tr>
                <tr>
                    <td class="auto-style5"></td>
                    <td class="auto-style7"style="color:#fff">Area
                        <label style="color: #FF3300">*</label></td>
                    <td class="auto-style4">
                        <table>
                            <tr>
                                <td>
                                    <asp:TextBox ID="TextBox3" ClientIDMode="Static" placeholder="Area" CssClass="ts-inputbox4 left" ValidationGroup="tab1" runat="server"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtEmpId" ErrorMessage="Area cannot be blank" Display="None" ForeColor="#FF3300"></asp:RequiredFieldValidator>

                                </td>
                            </tr>

                        </table>
                    </td>
                </tr>
                <tr>
                    <td class="auto-style5"></td>
                    <td class="auto-style7"style="color:#fff">Work Type
                        <label style="color: #FF3300">*</label></td>
                    <td class="auto-style4">
                        <table>
                            <tr>
                                <td>
                                    <asp:TextBox ID="TextBox4" ClientIDMode="Static" placeholder="Work Type" CssClass="ts-inputbox4 left" ValidationGroup="tab1" runat="server"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtEmpId" ErrorMessage="Work Type cannot be blank" Display="None" ForeColor="#FF3300"></asp:RequiredFieldValidator>

                                </td>
                            </tr>

                        </table>
                    </td>
                </tr>
                <tr>
                    <td class="auto-style5"></td>
                    <td class="auto-style7"style="color:#fff">Channel
                        <label style="color: #FF3300">*</label></td>
                    <td class="auto-style4">
                        <table>
                            <tr>
                                <td>
                                    <asp:TextBox ID="TextBox5" ClientIDMode="Static" placeholder="Channel" CssClass="ts-inputbox4 left" ValidationGroup="tab1" runat="server"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtEmpId" ErrorMessage="Channel cannot be blank" Display="None" ForeColor="#FF3300"></asp:RequiredFieldValidator>

                                </td>
                            </tr>

                        </table>
                    </td>
                </tr>
                <tr>
                    <td class="auto-style5"></td>
                    <td class="auto-style7"style="color:#fff">Tags
                        <label style="color: #FF3300">*</label></td>
                    <td class="auto-style4">
                        <table>
                            <tr>
                                <td>
                                    <asp:TextBox ID="TextBox6" ClientIDMode="Static" placeholder="Tags" CssClass="ts-inputbox4 left" ValidationGroup="tab1" runat="server"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="txtEmpId" ErrorMessage="Tags cannot be blank" Display="None" ForeColor="#FF3300"></asp:RequiredFieldValidator>

                                </td>
                            </tr>

                        </table>
                    </td>
                </tr>
                <tr>
                    <td class="auto-style5"></td>
                    <td class="auto-style7"style="color:#fff">Team Name
                        <label style="color: #FF3300">*</label></td>
                    <td class="auto-style4">
                        <table>
                            <tr>   
                                <td >
                        <asp:DropDownList ID="List" CssClass="ts-inputbox4 left" runat="server" style="width:220px">
                            <asp:ListItem Value="-1">-SELECT-</asp:ListItem>
                            <asp:ListItem Text="Abacus" Value="Analysis"></asp:ListItem>
                             <asp:ListItem Text="MMR" Value="Planning"></asp:ListItem>
                              <asp:ListItem Text="Product" Value="Execution"></asp:ListItem>                            
                        </asp:DropDownList>
                               </td>
                            </tr>

                        </table>
                    </td>
                </tr>
              <tr>
                    <td class="auto-style5"></td>
                    <td class="auto-style7"style="color:#fff">Task Name
                        <label style="color: #FF3300">*</label></td>
                    <td class="auto-style4">
                        <table>
                            <tr>
                                <td>
                                    <asp:TextBox ID="TextBox9" ClientIDMode="Static" placeholder="Task Name" CssClass="ts-inputbox4 left" ValidationGroup="tab1" runat="server"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" ControlToValidate="txtEmpId" ErrorMessage="Task Name cannot be blank" Display="None" ForeColor="#FF3300"></asp:RequiredFieldValidator>

                                </td>
                            </tr>

                        </table>
                      </td>      
                </tr>  
              </table>
            <br />
            <table>
             <tr>                           
                  <td style="position:relative; right:15%;"><asp:Button  ID="btnsubmit" ValidationGroup="tab2" CssClass="col ts-btn normalbtnsize" runat="server" Text="Submit" BackColor="#ff9933"/></td>
                  <td style="position:relative; left:-17%;"> <asp:Button ID="btnfinddata" ValidationGroup="tab2" CssClass="col-centered ts-btn normalbtnsize" runat="server" Text="Cancel" BackColor="#ff9933"  /></td>
                                
                </tr>
                </table>
            </div>
        </div> 





我的尝试:



单击此按钮



What I have tried:

ON click of this button

<table>
        <tr>
        <td style="position:relative; left:-35%;"><a href="#" onClick="pop('popDiv')"> <asp:Button ID="btnadd" ValidationGroup="tab2" CssClass="col-centered ts-btn normalbtnsize" runat="server" Text="Add" BackColor="#ff9933" OnClick="btnadd_Click"/></a></td>          
        </tr>
        </table>



i我试图展示这个div






i am trying to show this div


<div class="clear"></div>
    <div id="popDiv" class="ontop"  >
        <div id="fade" class="black_overlay"></div>
        <div id="tab1" class="tab active">
            <table  class="formwrap center-block2">
               <tr>
                    <td class="auto-style5"></td>
                    <td class="auto-style7"style="color:#fff">Task Id
                        <label style="color: #FF3300">*</label></td>

推荐答案

?)(\\(\\\ [[\ w]。*))(。 xlsx)
?)(\\(\w[\w].*))(.xlsx)



ControlToValidate =FileUpload1ForeColor =Red>< / asp:RegularExpressionValidator>

< asp:Button id =UploadBtnText =上传文件OnClick =UploadBtn_Clickrunat =serverWidth =105px/>
< asp:Label ID =lblMessageForeColor =Redrunat = server>< / asp:Label>
< / div>
< asp:GridView ID =gvDetailsrunat =serverCssClass =grid clsWrapAutoGenerateColumns =False PageSize =20Width =960px>
< Columns>
< asp:BoundField DataField =taskdescriptionHeaderText =Work Item>< / asp:BoundField>
< asp:BoundField D. ataField =fromdateHeaderText =From Date>< / asp:BoundField>
< asp:BoundField HeaderStyle-CssClass =gridBDataField =todateHeaderText =To Date>< / asp:BoundField>

< / Columns>
< HeaderStyle Font-Bold =FalseCssClass =Font gvheaderstyleWrap =False/>
< PagerStyle CssClass =gridBForeColor =WhiteSmoke/>
< RowStyle Horizo​​ntalAlign =Center/>
< / asp:GridView>
<% - 开始 - %>
< div class =name>手动插入任务< / div>
< hr />
< br />
< br />
< div class =clear>< / div>
< div id =errorstyle =padding-left:10pxrunat =servervisible =true>
< asp:Label ID =lblErrorrunat =serverForeColor =Red>< / asp:Label>
< asp:GridView ID =GridView1runat =serverAutoGenerateColumns =FalseBackColor =BlackForeColor =WhiteBorderColor =whiteOnRowCommand =GridView1_RowCommandOnSelectedIndexChanged =GridView1_SelectedIndexChangedAllowPaging =TrueOnPageIndexChanging =GridView1_PageIndexChangingPageSize =5BorderWidth =2pxCellPadding =2CellSpacing =5GridLines =None>

< RowStyle BackColor =Black/>
< AlternatingRowStyle BackColor =Black/>
< FooterStyle BackColor =Black/>
< HeaderStyle BackColor =#ff9933Font-Bold =TrueForeColor =Black/>
< PagerStyle BackColor =#ff9933ForeColor =Black
Horizo​​ntalAlign =Center/>
< SortedAscendingCellStyle BackColor =#F1F1F1/>
< SortedAscendingHeaderStyle BackColor =#ff9933/>
< SortedDescendingCellStyle BackColor =Black/>
< SortedDescendingHeaderStyle BackColor =#00547E/>

< Columns>
< asp:TemplateField HeaderText =Task Id>
< ItemTemplate>
< asp:Label ID =lblTask​​IdText ='<%#Eval(TaskId)%>'runat =server>< / asp:Label>
< / ItemTemplate>
< / asp:TemplateField>
< asp:TemplateField HeaderText =Description>
< ItemTemplate>
< asp:Label ID =lblDescriptionText ='<%#Eval(Description)%>'runat =server>< / asp:Label>
< / ItemTemplate>
< / asp:TemplateField>
< asp:TemplateField HeaderText =项目名称>
< ItemTemplate>
< asp:Label ID =lblProjectNameText ='<%#Eval(ProjectName)%>'runat =server>< / asp:Label>
< / ItemTemplate>
< / asp:TemplateField>
< asp:TemplateField HeaderText =Area>
< ItemTemplate>
< asp:Label ID =lblAreaText ='<%#Eval(Area)%>'runat =server>< / asp:Label>
< / ItemTemplate>
< / asp:TemplateField>
< asp:TemplateField HeaderText =工作类型>
< ItemTemplate>
< asp:Label ID =lblWorkTypeText ='<%#Eval(WorkItemType)%>'runat =server>< / asp:Label>
< / ItemTemplate>
< / asp:TemplateField>
< asp:TemplateField HeaderText =频道>
< ItemTemplate>
< asp:Label ID =lblChannelText ='<%#Eval(Channel)%>'runat =server>< / asp:Label>
< / ItemTemplate>
< / asp:TemplateField>
< asp:TemplateField HeaderText =Tags>
< ItemTemplate>
< asp:标签ID =lblTagsText ='<%#Eval(Tags)%>'runat =server>< / asp:Label>
< / ItemTemplate>
< / asp:TemplateField>
< asp:TemplateField HeaderText =团队名称>
< ItemTemplate>
< asp:Label ID =lblTeamNameText ='<%#Eval(TeamName)%>'runat =server>< / asp:Label>
< / ItemTemplate>
< / asp:TemplateField>
< asp:TemplateField HeaderText =任务名称>
< ItemTemplate>
< asp:Label ID =lblTask​​NameText ='<%#Eval(TaskName)%>'runat =server>< / asp:Label>
< / ItemTemplate>
< / asp:TemplateField>
< asp:TemplateField HeaderText =编辑>
< ItemTemplate>
< asp:Button ID =btnEditrunat =serverText =EditCommandName =EditRowCausesValidation =false/>
< / ItemTemplate>
< / asp:TemplateField>
< / Columns>
< / asp:GridView>
< / div>
< br />
< div>
< table>
< tr>
< td style =position:relative; left:-35%;>< a href =#onClick =pop('popDiv')> < asp:Button ID =btnaddValidationGroup =tab2CssClass =col-centered ts-btn normalbtnsizerunat =serverText =AddBackColor =#ff9933OnClick =btnadd_Click/> < / A>< / TD>
< / tr>
< / table>
< / div>
< br />
< div class =clear>< / div>
< div id =popDivclass =ontop>
< div id =fadeclass =black_overlay>< / div>
< div id =tab1class =tab active>
< table class =formwrap center-block2>
< tr>
< td class =auto-style5>< / td>
< td class =auto-style7style =color:#fff>任务ID
< label style =color:#FF3300> *< / label>< ; / TD>
< td class =auto-style4>
< table>
< tr>
< td>
< asp:TextBox ID =txtEmpIdClientIDMode =Static占位符=任务IDCssClass =ts-inputbox4 leftValidationGroup =tab1runat =serverMaxLength =5> < / ASP:文本框>
< / td>
< td>
< asp:RequiredFieldValidator ID =rfvEmpIdrunat =serverControlToValidate =txtEmpIdErrorMessage =任务ID不能为空显示=无ForeColor =#FF3300>< / asp :使用RequiredFieldValidator>
<
< / td>
< / tr>
< / table>
< / td>
< / tr>
< tr>
< td class =auto-style5>< / td>
< td class =auto-style7style =color:#fff>说明
< label style =color:#FF3300> *< / label>< / TD>
< td class =auto-style4>
< table>
< tr>
< td>
< asp:TextBox ID =TextBox1ClientIDMode =Static占位符=描述CssClass =ts-inputbox4 leftValidationGroup =tab1runat =server>< / asp:TextBox> ;
< / td>
< td style =padding-left:200px;>
< asp:RequiredFieldValidator ID =RequiredFieldValidator1runat =serverControlToValidate =txtEmpIdErrorMessage =描述不能为空Display =NoneForeColor =#FF3300>< / asp:的RequiredFieldValidator>

< / td>
< / tr>

< / table>
< / td>
< / tr>
< tr>
< td class =auto-style5>< / td>
< td class =auto-style7style =color:#fff>项目名称
< label style =color:#FF3300> *< / label>< ; / TD>
< td class =auto-style4>
< table>
< tr>
< td>
< asp:TextBox ID =TextBox2ClientIDMode =Static占位符=项目名称CssClass =ts-inputbox4 leftValidationGroup =tab1runat =server>< / asp:文本框>
< / td>
< td>
< asp:RequiredFieldValidator ID =RequiredFieldValidator2runat =serverControlToValidate =txtEmpIdErrorMessage =项目名称不能为空显示=无ForeColor =#FF3300>< / asp :使用RequiredFieldValidator>

< / td>
< / tr>

< / table>
< / td>
< / tr>
< tr>
< td class =auto-style5>< / td>
< td class =auto-style7style =color:#fff> Area
< label style =color:#FF3300> *< / label>< / TD>
< td class =auto-style4>
< table>
< tr>
< td>
< asp:TextBox ID =TextBox3ClientIDMode =Static占位符=区域CssClass =ts-inputbox4 leftValidationGroup =tab1runat =server>< / asp:TextBox> ;
< / td>
< td>
< asp:RequiredFieldValidator ID =RequiredFieldValidator3runat =serverControlToValidate =txtEmpIdErrorMessage =Area not not blankDisplay =NoneForeColor =#FF3300>< / asp:的RequiredFieldValidator>

< / td>
< / tr>

< / table>
< / td>
< / tr>
< tr>
< td class =auto-style5>< / td>
< td class =auto-style7style =color:#fff>工作类型
< label style =color:#FF3300> *< / label>< ; / TD>
< td class =auto-style4>
< table>
< tr>
< td>
< asp:TextBox ID =TextBox4ClientIDMode =Static占位符=工作类型CssClass =ts-inputbox4 leftValidationGroup =tab1runat =server>< / asp:文本框>
< / td>
< td>
< asp:RequiredFieldValidator ID =RequiredFieldValidator4runat =serverControlToValidate =txtEmpIdErrorMessage =工作类型不能为空显示=无ForeColor =#FF3300>< / asp :使用RequiredFieldValidator>

< / td>
< / tr>

< / table>
< / td>
< / tr>
< tr>
< td class =auto-style5>< / td>
< td class =auto-style7style =color:#fff>频道
< label style =color:#FF3300> *< / label>< / TD>
< td class =auto-style4>
< table>
< tr>
< td>
< asp:TextBox ID =TextBox5ClientIDMode =Static占位符=频道CssClass =ts-inputbox4 leftValidationGroup =tab1runat =server>< / asp:TextBox> ;
< / td>
< td>
< asp:RequiredFieldValidator ID =RequiredFieldValidator5runat =serverControlToValidate =txtEmpIdErrorMessage =频道不能为空显示=无ForeColor =#FF3300>< / asp:的RequiredFieldValidator>

< / td>
< / tr>

< / table>
< / td>
< / tr>
< tr>
< td class =auto-style5>< / td>
< td class =auto-style7style =color:#fff>标签
< label style =color:#FF3300> *< / label>< / TD>
< td class =auto-style4>
< table>
< tr>
< td>
< asp:TextBox ID =TextBox6ClientIDMode =Static占位符=标签CssClass =ts-inputbox4 leftValidationGroup =tab1runat =server>< / asp:TextBox> ;
< / td>
< td>
< asp:RequiredFieldValidator ID =RequiredFieldValidator6runat =serverControlToValidate =txtEmpIdErrorMessage =标签不能为空Display =NoneForeColor =#FF3300>< / asp:的RequiredFieldValidator>

< / td>
< / tr>

< / table>
< / td>
< / tr>
< tr>
< td class =auto-style5>< / td>
< td class =auto-style7style =color:#fff>团队名称
< label style =color:#FF3300> *< / label>< ; / TD>
< td class =auto-style4>
< table>
< tr>
< td>
< asp:DropDownList ID =ListCssClass =ts-inputbox4 leftrunat =serverstyle =width:220px>
< asp:ListItem Value = - 1> -SELECT-< / asp:ListItem>
< asp:ListItem Text =AbacusValue =Analysis>< / asp:ListItem>
< asp:ListItem Text =MMRValue =Planning>< / asp:ListItem>
< asp:ListItem Text =ProductValue =Execution>< / asp:ListItem>
< / asp:DropDownList>
< / td>
< / tr>

< / table>
< / td>
< / tr>
< tr>
< td class =auto-style5>< / td>
< td class =auto-style7style =color:#fff>任务名称
< label style =color:#FF3300> *< / label>< ; / TD>
< td class =auto-style4>
< table>
< tr>
< td>
< asp:TextBox ID =TextBox9ClientIDMode =Static占位符=任务名称CssClass =ts-inputbox4 leftValidationGroup =tab1runat =server>< / asp:文本框>
< / td>
< td>
< asp:RequiredFieldValidator ID =RequiredFieldValidator9runat =serverControlToValidate =txtEmpIdErrorMessage =任务名称不能为空显示=无ForeColor =#FF3300>< / asp :使用RequiredFieldValidator>

< / td>
< / tr>

< / table>
< / td>
< / tr>
< / table>
< br />
< table>
< tr>
< td style =position:relative; right:15%;>< asp:Button ID =btnsubmitValidationGroup =tab2CssClass =col ts-btn normalbtnsizerunat =server Text =提交BackColor =#ff9933/>< / td>
< td style =position:relative; left:-17%;> < asp:Button ID =btnfinddataValidationGroup =tab2CssClass =col-centered ts-btn normalbtnsizerunat =serverText =CancelBackColor =#ff9933/>< / td>

< / tr>
< / table>
< / div>
< / div>
" ControlToValidate="FileUpload1" ForeColor="Red"></asp:RegularExpressionValidator> <asp:Button id="UploadBtn" Text="Upload File" OnClick="UploadBtn_Click" runat="server" Width="105px" /> <asp:Label ID="lblMessage" ForeColor="Red" runat="server"></asp:Label> </div> <asp:GridView ID="gvDetails" runat="server" CssClass="grid clsWrap" AutoGenerateColumns="False" PageSize="20" Width="960px"> <Columns> <asp:BoundField DataField="taskdescription" HeaderText="Work Item"></asp:BoundField> <asp:BoundField DataField="fromdate" HeaderText="From Date"></asp:BoundField> <asp:BoundField HeaderStyle-CssClass="gridB" DataField="todate" HeaderText="To Date"></asp:BoundField> </Columns> <HeaderStyle Font-Bold="False" CssClass="Font gvheaderstyle" Wrap="False" /> <PagerStyle CssClass="gridB" ForeColor="WhiteSmoke" /> <RowStyle HorizontalAlign="Center" /> </asp:GridView> <%--Start--%> <div class="name">Manual Insert Task</div> <hr /> <br /> <br /> <div class="clear"></div> <div id="error" style="padding-left: 10px" runat="server" visible="true"> <asp:Label ID="lblError" runat="server" ForeColor="Red"></asp:Label> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BackColor="Black" ForeColor="White" BorderColor="white" OnRowCommand="GridView1_RowCommand" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" AllowPaging="True" OnPageIndexChanging="GridView1_PageIndexChanging" PageSize="5" BorderWidth="2px" CellPadding="2" CellSpacing="5" GridLines="None" > <RowStyle BackColor="Black" /> <AlternatingRowStyle BackColor="Black" /> <FooterStyle BackColor="Black" /> <HeaderStyle BackColor="#ff9933" Font-Bold="True" ForeColor="Black" /> <PagerStyle BackColor="#ff9933" ForeColor="Black" HorizontalAlign="Center" /> <SortedAscendingCellStyle BackColor="#F1F1F1" /> <SortedAscendingHeaderStyle BackColor="#ff9933" /> <SortedDescendingCellStyle BackColor="Black" /> <SortedDescendingHeaderStyle BackColor="#00547E" /> <Columns> <asp:TemplateField HeaderText="Task Id"> <ItemTemplate> <asp:Label ID="lblTaskId" Text='<%# Eval("TaskId") %>' runat="server" ></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Description"> <ItemTemplate> <asp:Label ID="lblDescription" Text='<%# Eval("Description") %>' runat="server"></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Project Name"> <ItemTemplate> <asp:Label ID="lblProjectName" Text='<%# Eval("ProjectName") %>' runat="server"></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Area"> <ItemTemplate> <asp:Label ID="lblArea" Text='<%# Eval("Area") %>' runat="server"></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Work Type"> <ItemTemplate> <asp:Label ID="lblWorkType" Text='<%# Eval("WorkItemType") %>' runat="server"></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Channel"> <ItemTemplate> <asp:Label ID="lblChannel" Text='<%# Eval("Channel") %>' runat="server"></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Tags"> <ItemTemplate> <asp:Label ID="lblTags" Text='<%# Eval("Tags") %>' runat="server"></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Team Name"> <ItemTemplate> <asp:Label ID="lblTeamName" Text='<%# Eval("TeamName") %>' runat="server"></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Task Name"> <ItemTemplate> <asp:Label ID="lblTaskName" Text='<%# Eval("TaskName") %>' runat="server"></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Edit"> <ItemTemplate> <asp:Button ID="btnEdit" runat="server" Text="Edit" CommandName="EditRow" CausesValidation="false"/> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> </div> <br /> <div> <table> <tr> <td style="position:relative; left:-35%;"><a href="#" onClick="pop('popDiv')"> <asp:Button ID="btnadd" ValidationGroup="tab2" CssClass="col-centered ts-btn normalbtnsize" runat="server" Text="Add" BackColor="#ff9933" OnClick="btnadd_Click"/></a></td> </tr> </table> </div> <br /> <div class="clear"></div> <div id="popDiv" class="ontop" > <div id="fade" class="black_overlay"></div> <div id="tab1" class="tab active"> <table class="formwrap center-block2"> <tr> <td class="auto-style5"></td> <td class="auto-style7"style="color:#fff">Task Id <label style="color: #FF3300">*</label></td> <td class="auto-style4"> <table> <tr> <td> <asp:TextBox ID="txtEmpId" ClientIDMode="Static" placeholder="Task Id" CssClass="ts-inputbox4 left" ValidationGroup="tab1" runat="server" MaxLength="5"></asp:TextBox> </td> <td > <asp:RequiredFieldValidator ID="rfvEmpId" runat="server" ControlToValidate="txtEmpId" ErrorMessage="Task Id cannot be blank" Display="None" ForeColor="#FF3300"></asp:RequiredFieldValidator> < </td> </tr> </table> </td> </tr> <tr> <td class="auto-style5"></td> <td class="auto-style7"style="color:#fff">Description <label style="color: #FF3300">*</label></td> <td class="auto-style4"> <table > <tr> <td> <asp:TextBox ID="TextBox1" ClientIDMode="Static" placeholder="Description" CssClass="ts-inputbox4 left" ValidationGroup="tab1" runat="server"></asp:TextBox> </td> <td style="padding-left:200px;"> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtEmpId" ErrorMessage="Description cannot be blank" Display="None" ForeColor="#FF3300"></asp:RequiredFieldValidator> </td> </tr> </table> </td> </tr> <tr> <td class="auto-style5"></td> <td class="auto-style7"style="color:#fff">Project Name <label style="color: #FF3300">*</label></td> <td class="auto-style4"> <table> <tr> <td> <asp:TextBox ID="TextBox2" ClientIDMode="Static" placeholder="Project Name" CssClass="ts-inputbox4 left" ValidationGroup="tab1" runat="server"></asp:TextBox> </td> <td> <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtEmpId" ErrorMessage="Project Name cannot be blank" Display="None" ForeColor="#FF3300"></asp:RequiredFieldValidator> </td> </tr> </table> </td> </tr> <tr> <td class="auto-style5"></td> <td class="auto-style7"style="color:#fff">Area <label style="color: #FF3300">*</label></td> <td class="auto-style4"> <table> <tr> <td> <asp:TextBox ID="TextBox3" ClientIDMode="Static" placeholder="Area" CssClass="ts-inputbox4 left" ValidationGroup="tab1" runat="server"></asp:TextBox> </td> <td> <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtEmpId" ErrorMessage="Area cannot be blank" Display="None" ForeColor="#FF3300"></asp:RequiredFieldValidator> </td> </tr> </table> </td> </tr> <tr> <td class="auto-style5"></td> <td class="auto-style7"style="color:#fff">Work Type <label style="color: #FF3300">*</label></td> <td class="auto-style4"> <table> <tr> <td> <asp:TextBox ID="TextBox4" ClientIDMode="Static" placeholder="Work Type" CssClass="ts-inputbox4 left" ValidationGroup="tab1" runat="server"></asp:TextBox> </td> <td> <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtEmpId" ErrorMessage="Work Type cannot be blank" Display="None" ForeColor="#FF3300"></asp:RequiredFieldValidator> </td> </tr> </table> </td> </tr> <tr> <td class="auto-style5"></td> <td class="auto-style7"style="color:#fff">Channel <label style="color: #FF3300">*</label></td> <td class="auto-style4"> <table> <tr> <td> <asp:TextBox ID="TextBox5" ClientIDMode="Static" placeholder="Channel" CssClass="ts-inputbox4 left" ValidationGroup="tab1" runat="server"></asp:TextBox> </td> <td> <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtEmpId" ErrorMessage="Channel cannot be blank" Display="None" ForeColor="#FF3300"></asp:RequiredFieldValidator> </td> </tr> </table> </td> </tr> <tr> <td class="auto-style5"></td> <td class="auto-style7"style="color:#fff">Tags <label style="color: #FF3300">*</label></td> <td class="auto-style4"> <table> <tr> <td> <asp:TextBox ID="TextBox6" ClientIDMode="Static" placeholder="Tags" CssClass="ts-inputbox4 left" ValidationGroup="tab1" runat="server"></asp:TextBox> </td> <td> <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="txtEmpId" ErrorMessage="Tags cannot be blank" Display="None" ForeColor="#FF3300"></asp:RequiredFieldValidator> </td> </tr> </table> </td> </tr> <tr> <td class="auto-style5"></td> <td class="auto-style7"style="color:#fff">Team Name <label style="color: #FF3300">*</label></td> <td class="auto-style4"> <table> <tr> <td > <asp:DropDownList ID="List" CssClass="ts-inputbox4 left" runat="server" style="width:220px"> <asp:ListItem Value="-1">-SELECT-</asp:ListItem> <asp:ListItem Text="Abacus" Value="Analysis"></asp:ListItem> <asp:ListItem Text="MMR" Value="Planning"></asp:ListItem> <asp:ListItem Text="Product" Value="Execution"></asp:ListItem> </asp:DropDownList> </td> </tr> </table> </td> </tr> <tr> <td class="auto-style5"></td> <td class="auto-style7"style="color:#fff">Task Name <label style="color: #FF3300">*</label></td> <td class="auto-style4"> <table> <tr> <td> <asp:TextBox ID="TextBox9" ClientIDMode="Static" placeholder="Task Name" CssClass="ts-inputbox4 left" ValidationGroup="tab1" runat="server"></asp:TextBox> </td> <td> <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" ControlToValidate="txtEmpId" ErrorMessage="Task Name cannot be blank" Display="None" ForeColor="#FF3300"></asp:RequiredFieldValidator> </td> </tr> </table> </td> </tr> </table> <br /> <table> <tr> <td style="position:relative; right:15%;"><asp:Button ID="btnsubmit" ValidationGroup="tab2" CssClass="col ts-btn normalbtnsize" runat="server" Text="Submit" BackColor="#ff9933"/></td> <td style="position:relative; left:-17%;"> <asp:Button ID="btnfinddata" ValidationGroup="tab2" CssClass="col-centered ts-btn normalbtnsize" runat="server" Text="Cancel" BackColor="#ff9933" /></td> </tr> </table> </div> </div>





我的尝试:



单击此按钮



What I have tried:

ON click of this button

<table>
        <tr>
        <td style="position:relative; left:-35%;"><a href="#" onClick="pop('popDiv')"> <asp:Button ID="btnadd" ValidationGroup="tab2" CssClass="col-centered ts-btn normalbtnsize" runat="server" Text="Add" BackColor="#ff9933" OnClick="btnadd_Click"/></a></td>          
        </tr>
        </table>



i am trying to show this div






i am trying to show this div


<div class="clear"></div>
    <div id="popDiv" class="ontop"  >
        <div id="fade" class="black_overlay"></div>
        <div id="tab1" class="tab active">
            <table  class="formwrap center-block2">
               <tr>
                    <td class="auto-style5"></td>
                    <td class="auto-style7"style="color:#fff">Task Id
                        <label style="color: #FF3300">*</label></td>


When you are clicking that button (which is actually an ASP.NET button wrapped in an anchor), two things are happening:

1. Client side onclick of the anchor, which displays the pop-up

2. Server side onclick of the button, which reloads the entire page...

So you see the pop-up only of the time the page reloads...

You have to understand what post and post-back is. What client and server separation is. What AJAX is.

And what do you actually want to do when creating such a hybrid code...
When you are clicking that button (which is actually an ASP.NET button wrapped in an anchor), two things are happening:
1. Client side onclick of the anchor, which displays the pop-up
2. Server side onclick of the button, which reloads the entire page...
So you see the pop-up only of the time the page reloads...
You have to understand what post and post-back is. What client and server separation is. What AJAX is.
And what do you actually want to do when creating such a hybrid code...


这篇关于弹出窗口无法正常显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆