I have a UpdatePanel and UpdateProgress inside a User Control.
The position of usercontrol can be controlled from the backend. So need a css which makes the ajax-loader.gif is positioned center to the Div id="main" of my usercontrol. How can i position it ?
Right now, i use the below code...
HTML Rendered :
<div id="ctl00_ContentPlaceHolder1_ltlsectionRight2">
<style type="text/css">
#UpdateProgress1 {
background-color:#CF4342;
color:#fff;
top:0px;
right:0px;
position:absolute;
display:inline;
}
#UpdateProgress1 img {
vertical-align:middle;
margin:2px;
}
</style>
<div style="visibility:hidden;display:block;" id="ctl00_ContentPlaceHolder1_GovermentSchemes_UpdateProgress1" role="status" aria-hidden="true">
<img src="Images/ajax-loader.gif">
</div>
<div class="title">
<div class="title-text">
<div class="title-text-brown">
Assistance
</div>
<div class="title-text-white">
Schemes</div>
</div>
</div>
<div id="Main" class="green-box">
<div class="box-content">
<table>
<tbody><tr>
<td>
</td>
</tr>
<tr>
<td class="style3">
<div id="ctl00_ContentPlaceHolder1_GovermentSchemes_UP1">
<select style="width:208px;" id="ctl00_ContentPlaceHolder1_GovermentSchemes_ddlTypes" onchange="javascript:setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$GovermentSchemes$ddlTypes\',\'\')', 0)" name="ctl00$ContentPlaceHolder1$GovermentSchemes$ddlTypes">
<option value="0" selected="selected">Select Type</option>
<option value="17">type 1</option>
<option value="19">type 2</option>
</select>
</div>
</td>
</tr>
<tr>
<td class="style3">
<div id="ctl00_ContentPlaceHolder1_GovermentSchemes_UP2">
<select style="width:208px;" id="ctl00_ContentPlaceHolder1_GovermentSchemes_ddlSchemes" onchange="javascript:setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$GovermentSchemes$ddlSchemes\',\'\')', 0)" name="ctl00$ContentPlaceHolder1$GovermentSchemes$ddlSchemes">
<option value="-1">Type is not selected</option>
<option value="0" selected="selected">Select Scheme</option>
</select>
</div>
</td>
</tr>
<tr>
<td align="right">
<div id="ctl00_ContentPlaceHolder1_GovermentSchemes_UP3">
<a title="Select Type & Schemes to view." disabled="disabled" id="ctl00_ContentPlaceHolder1_GovermentSchemes_HypView"><img src="uploadedimages/System/Static_Images/search_button.png"></a>
</div>
</td>
</tr>
</tbody></table>
</div>
</div>
</div>
ASPX Code :
<style type="text/css">
#UpdateProgress1 {
background-color:#CF4342;
color:#fff;
top:0px;
right:0px;
position:fixed;
}
#UpdateProgress1 img {
vertical-align:middle;
margin:2px;
}
</style>
<asp:UpdateProgress ID="UpdateProgress2" runat="server" DynamicLayout="false">
<ProgressTemplate>
<div class="progress">
<img src="Images/ajax-loader.gif" />
Please Wait...
</div>
</ProgressTemplate>
</asp:UpdateProgress>
<div id="Main">
<table>
<tr>
<td class="style3">
<asp:UpdatePanel ID="UP1" runat="server">
<ContentTemplate>
<asp:DropDownList ID="ddlTypes" runat="server" AutoPostBack="true"
Width="208px" />
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
<tr>
<td class="style3">
<asp:UpdatePanel ID="UP2" runat="server">
<ContentTemplate>
<asp:DropDownList ID="ddlSchemes" runat="server" Width="208px" AutoPostBack="true"
EnableViewState="true">
</asp:DropDownList>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ddlTypes" />
</Triggers>
</asp:UpdatePanel>
</td>
</tr>
<tr>
<td align="right">
<asp:UpdatePanel ID="UP3" runat="server">
<ContentTemplate>
<asp:HyperLink ID="HypView" runat="server"><img src="uploadedimages/System/Static_Images/search_button.png" /></asp:HyperLink>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ddlSchemes" />
</Triggers>
</asp:UpdatePanel>
</td>
</tr>
</table>
</div>
Related
This is my aspx code
<div id="tabs-1">
<table id="BookingTable" runat="server" class="tableResultClass">
<tr>
<th>ID</th>
<th>PlanTime</th>
</tr>
</table>
</div>
<div id="tabs-2">
<div id="circleG" style="margin-left: auto; margin-right: auto; padding-top: 50px; padding-bottom: 50px;">
<div id="circleG_1" class="circleG"></div>
<div id="circleG_2" class="circleG"></div>
<div id="circleG_3" class="circleG"></div>
</div>
</div>
<div id="tabs-3">
<p>
Date:
<input type="text" id="datepicker" runat="server">
</p>
<asp:ScriptManager ID="ScriptManager" runat="server" />
<asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:Button ID="BookingForDate" runat="server" OnClick="BookingForDate_Click" Text="Search" />
<span style="color: red" id="errorDateMessage" runat="server"></span>
<div runat="server" id="circleG2" style="margin-left: auto; margin-right: auto; margin-left: 400px; padding-bottom: 60px;">
<div id="circleG_1" class="circleG"></div>
<div id="circleG_2" class="circleG"></div>
<div id="circleG_3" class="circleG"></div>
</div>
<table id="DateBookingTable" runat="server" class="tableResultClass">
<tr>
<th>ID</th>
<th>PlanTime</th>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</div>
It is simple code that have three div as tabs.
I want to know which tab is selected in a specific moment. how please?
I think it is something about session but I don't know what it is
You can do the following:-
1) Declare a global variable.
2) Attach a onClick event for each div. Whenever this event is fired, set this global variable with the id of corresponding div.
3) Access this global variable in the required function.
I have three taps. with drop down list as this:
I want that when I change the Drop down list, I want to do something in the server side and then update the first two tabs. I can do that.
my problem
If I were in the second tab and I changed the drop down, the page is loaded and set to the first tap.
I tried to
I tried to surrown the table in the second tab with update panel like this:
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:UpdatePanel ID="UpdatePanel2" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<table id="BookingTableTomorrow" runat="server" class="tableResultClass">
<tr>
<th>ID</th>
<th>PlanTime</th>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
see the bellow all code, and note that I have another update panel in the third tab, and that third tab is working perfectly
<div id="tabs">
<ul>
<li>Today</li>
<li>Tomorrow</li>
<li>Any Date</li>
<label style="float: right">
<asp:DropDownList AutoPostBack="true" runat="server" ID="mealTimeSelector" OnSelectedIndexChanged="TodayTab_Click">
<asp:ListItem Value="1">Breakfast</asp:ListItem>
<asp:ListItem Value="2">Lunch</asp:ListItem>
<asp:ListItem Value="3">Dinner</asp:ListItem>
</asp:DropDownList>
</label>
</ul>
<div id="tabs-1">
<table id="BookingTable" runat="server" class="tableResultClass">
<tr>
<th>ID</th>
<th>PlanTime</th>
</tr>
</table>
</div>
<div id="tabs-2">
<div id="circleG" style="margin-left: auto; margin-right: auto; padding-top: 50px; padding-bottom: 50px;">
<div id="circleG_1" class="circleG"></div>
<div id="circleG_2" class="circleG"></div>
<div id="circleG_3" class="circleG"></div>
</div>
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:UpdatePanel ID="UpdatePanel2" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<table id="BookingTableTomorrow" runat="server" class="tableResultClass">
<tr>
<th>ID</th>
<th>PlanTime</th>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div id="tabs-3">
<p>
Date:
<input type="text" id="datepicker" runat="server">
</p>
<asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:Button ID="BookingForDate" runat="server" OnClick="BookingForDate_Click" Text="Search" />
<span style="color: red" id="errorDateMessage" runat="server"></span>
<div runat="server" id="circleG2" style="margin-left: auto; margin-right: auto; margin-left: 400px; padding-bottom: 60px;">
<div id="circleG_1" class="circleG"></div>
<div id="circleG_2" class="circleG"></div>
<div id="circleG_3" class="circleG"></div>
</div>
<table id="DateBookingTable" runat="server" class="tableResultClass">
<tr>
<th>ID</th>
<th>PlanTime</th>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
You can set a the dropdownlist as asynchronous postback trigger...
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Dropdownlist1" />
</Triggers>
</asp:UpdatePanel>
My page is not displaying in IE8. It works fine if I debug in IE and change it to IE7 standards under Internet Explorer 8 browser mode. I'm not sure what is wrong. If I add a meta tag with IE7 specified, it loads the page, and then looks like it forwards it to a blank page. All of the html is there in the debug information, and it works fine in IE7 browser mode, or in Firefox. Any ideas? Here is my header:
Master Page:
<%# Master Language="C#" AutoEventWireup="true" CodeFile="Site2.master.cs" Inherits="Site2" %>
<%# Register TagPrefix="uc" TagName="Header" Src="~/Controls/Header.ascx" %>
<%# Register TagPrefix="uc" TagName="Footer" Src="~/Controls/Footer.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
<link href="Styles/Site.css" rel="Stylesheet" type="text/css" />
<script src="<%= ResolveClientUrl("Scripts/jquery-1.4.1.js") %>" type="text/javascript" > </script>
<script src="<%= ResolveClientUrl("Scripts/Jquery.min.js") %>" type="text/javascript" > </script>
<script src="<%= ResolveClientUrl("Scripts/menu.js") %>" language="javascript" type="text/javascript" > </script>
<script src="<%= ResolveClientUrl("Scripts/jquery-ui-1.8.10.custom.min.js") %>" type="text/javascript" > </script>
<script src="<%= ResolveClientUrl("Scripts/EasyConfirm.js") %>" type="text/javascript" > </script>
<link href="<%= ResolveClientUrl("Styles/jquerySmoothness.css") %>" rel="stylesheet" type="text/css" />
</head>
<body >
<form id="form1" runat="server" enctype="multipart/form-data" method ="post" >
<asp:ScriptManager ID="ScriptManager1" AjaxFrameworkMode="Enabled" EnablePartialRendering="true" runat="server" />
<div class="container">
<uc:Header runat="server" ID="headerTest" Title="RTSC SCM" Subtitle="Logistics SOS" />
<div class="content2 " style ="position:relative; padding-bottom: 10px" >
<asp:ContentPlaceHolder ID="ContentPlaceHolder2" runat="server"/>
<%--</asp:ContentPlaceHolder>--%>
<!-- end .content --></div>
<uc:Footer runat="server" ID="footer" TeamName="RTSC Logistics SOS Tool Support Team" />
<!-- end .container --></div>
</form>
</body>
</html>
Page:
<%# Page Title="RTSC SOS - Storage Request View" Language="C#" MasterPageFile="~/Site2.master" AutoEventWireup="true" CodeFile="StorageRequest.aspx.cs" Inherits="Forms_StorageRequest" ContentType="IE7" %>
<%# Register TagPrefix="uc" TagName="EmployeeSearch" Src="~/Controls/TinyEmployeeSearch.ascx" %>
<%# Register Src="~/Controls/AdditionalInfo.ascx" TagPrefix="R" TagName="AddInfo" %>
<%# Register Src="~/Controls/LamEditComments.ascx" TagPrefix="R" TagName="StorageLocation" %>
<%# Register Src="~/Controls/RequestHeader.ascx" TagPrefix="R" TagName="reqheader" %>
<%# Register Src="~/Controls/HandlingUnitInfo.ascx" TagPrefix="R" TagName="handlingView" %>
<%# Register Src="~/Controls/DocumentGrid.ascx" TagPrefix="R" TagName="docView" %>
<%# Register Src="~/Controls/EmailGrid.ascx" TagPrefix="R" TagName="emailView" %>
<%# Register src="~/Controls/RequestInfo.ascx" tagname="requestinfo" tagprefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
<script type ="text/javascript" src="../Forms/FormsJS/StorageRequest.js"></script>
<script type ="text/javascript" src="../Scripts/ajaxfileupload.js"></script>
<div id="input" runat ="server" style="width: 960px" >
<R:reqheader id="m_reqHeaderCtr" runat="server" />
<r:docView ID="docView" runat="server" Visible = "true" />
<r:emailView ID="emailView" runat="server" Visible = "true"/>
<uc1:requestinfo ID="requestinfo1" runat="server" Visible = "false" />
<%-- Request Edit Information --%>
<fieldset id="RequestEdit" runat ="server" style="border-color: #CCC; width: 960px;" >
<legend style="border-style: none;font-size:small; color: Blue;">Request Information</legend>
<div style="margin: 0px; padding: 0px; float:left" >
<table>
<tr style="height: 25px;">
<td class ="BDecoNone bold" width="60px">
<img id="star1" runat ="server" src="../Images/red_star.gif" alt="Red Star" class="RedStars"/> Program:
</td>
<td width="120px">
<asp:DropDownList ID="strgProg_DD" Height="20px" runat="server" AutoPostBack="false" CssClass="TBDecoSmall">
</asp:DropDownList>
<span id="Program_Span" runat="server" />
</td>
<td runat="server" id="Other_TR" class="bold" style="text-align:right;display:none;">
<img id="star3" runat ="server" src="../Images/red_star.gif" alt="red_star" class="RedStars" />
<asp:Label ID="OtherTD" Text = "Other Program:" Width = "73px" runat ="server" ></asp:Label>
</td>
<td width="100px">
<asp:TextBox ID="m_otherProgramTB" runat="server" CssClass="TBDecoNone" ViewStateMode="Enabled" Height="12px" Wrap="False"></asp:TextBox>
</td>
<td width="100px">
</td>
</tr>
</table>
<table>
<tr>
<td class="bold TBDecoSmall " >
<img id="star4" runat ="server" src="../Images/red_star.gif" alt="Red Star" class="RedStars"/>Ownership:
</td>
<td colspan="1">
<span id="m_ownershipSpan" runat="server" class="bold" />
<asp:RadioButtonList ID="OwnRadioButtonList" runat="server" CssClass="bold" RepeatColumns="5" RepeatDirection="Horizontal"></asp:RadioButtonList>
</td>
<td>
</td>
</tr>
</table>
<table>
<tr>
<td class="bold TBDecoQuan" style ="width:150px">
<img id="star5" runat ="server" src="../Images/red_star.gif" alt="Red Star" class="RedStars"/>Check to Certify:
</td>
<td colspan="1">
<span ID="Material_CB_Span" runat="server"></span>
<asp:CheckBox ID="Material_CB" runat="server" AutoPostBack="false" CssClass="cb bold" Text="Material is NOT Classified" Width="150px" />
</td>
</tr>
</table>
<table>
<tr>
<td class="bold TBDecoSmall" style="width: 150px; height: 24px;">
<img id="star6" runat ="server" src="../Images/red_star.gif" alt="Red Star" class="RedStars"/>Storage Requirements:
</td>
<td colspan="1" style="height: 24px">
<asp:CheckBoxList ID="m_storageList" runat="server" AutoPostBack="false" CssClass="Space bold" RepeatColumns="5" />
</td>
</tr>
</table>
<table>
<tr ID="TempStorageInstruction_TR" runat="server" >
<td class="bold TBDecoSmall" colspan="1" style="width: 180px">
<img id="star7" runat ="server" src="../Images/red_star.gif" alt="Red Star" class="RedStars"/>Temperature Storage Instructions:
</td>
<td >
<span ID="TempStorageSpan" runat="server" class="bold"></span>
<asp:TextBox ID="TempStorageInstruction_TB" runat="server" CssClass="Bmar TBDecoLong" ValidationGroup="saveAll" ViewStateMode="Enabled" Height="20px" TextMode="MultiLine" Width="220px"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr ID="OtherStorageInstruction_TR" runat="server" >
<td class="bold TBDecoSmall" style="width: 150px">
<img id="star8" runat ="server" src="../Images/red_star.gif" alt="Red Star" class="RedStars"/> Other Storage Instructions:
</td>
<td >
<span ID="m_otherInstSpan" runat="server" class="bold"></span>
<asp:TextBox ID="OtherStorageInstruction_TB" runat="server" CssClass="Bmar TBDecoLong" Height="20px"
TextMode="MultiLine" ValidationGroup="saveAll" ViewStateMode="Enabled" Width="220px"></asp:TextBox>
</td>
<td>
</td>
</tr>
</table>
</div>
<div style="position: relative; width: 360px; float: right; height: auto; padding-top: 5px; top: 0px;" >
<div class="TBDecoNone" style ="padding: 0x; margin: 0px; float: left" >
<img id="star2" runat ="server" src="../Images/red_star.gif" alt="Red Star" class="RedStars"/> Program Point of Contact:
</div>
<div style ="float : left">
<uc:employeesearch id="progrmPointOfContact_TB" runat="server" scheme="Red" Enabled="false" />
</div>
</div>
</fieldset>
<fieldset runat="server" id ="EditGrid" style="border-color: #CCC; width: 960px;">
<legend style="border-style: none;font-size:small; color: Blue;">
Handling Unit Information</legend>
<div id="GridHolder">
<R:handlingView ID="handlingViewGrid" runat="server" Visible = "true" />
<br />
</div>
<div>
<input type="button" id="m_addNewItem" value="Add Material" style="border-color:#87BF83;color:Black" class="AddB" onclick="AddMaterial()" />
</div>
<div id="m_detailsView" runat="server" style="display:none">
<table cellpadding="1" cellspacing="1">
<tr>
<td class="TextDeco"><img src="../Images/red_star.gif" alt="red_star" class="RedStars"/>Material Number:</td>
<td class="TextDeco"><img src="../Images/red_star.gif" alt="red_star" class="RedStars"/>Description: </td>
<td class="TextDeco"> Manufacturer:</td>
<td class="TextDeco"> Model:</td>
</tr>
<!-- End Header section-->
<tr style="height: 20px; vertical-align: top;">
<!--Material TextBox ID=MatNum_TB-->
<td>
<asp:TextBox ID="MatNum_TB" runat="server" CssClass="TBDeco" Width="175px" Wrap="False"></asp:TextBox>
<br />
</td>
<!--Description TextBox-->
<td>
<asp:TextBox ID="Des_TB" runat="server" CssClass="TBDeco" Width="175px" Wrap="False"></asp:TextBox>
</td>
<!--Manufacturer TextBox-->
<td class="TBDeco">
<asp:TextBox ID="Manufac_TB" runat="server" CssClass="TBDeco" Width="250px" Wrap="False"></asp:TextBox>
<br />
</td>
<!--Model TextBox-->
<td>
<asp:TextBox ID="Model_TB" runat="server" CssClass="TBDeco" Wrap="False" Width="100px"></asp:TextBox>
<br />
</td>
</tr>
<tr>
<td class="TextDeco">
<img src="../Images/red_star.gif" alt="red_star" class="RedStars"/>Material Type:
</td>
<td class="TextDeco" style ="width:150px">
<img src="../Images/red_star.gif" class="RedStars" alt="red_star"/>Inv. Classification:
</td>
<td class="TextDeco" >
<img src="../Images/red_star.gif" alt="red_star" class="RedStars"/>Shelf-Life:
</td>
<td class="TextDeco" >
</td>
</tr>
<tr valign="top">
<td>
<!--Material Type DropDownList-->
<asp:DropDownList ID="MatType_DD" Height="20px" runat="server" CssClass="TBDeco" Width="150px" ></asp:DropDownList>
<br />
</td>
<!--Inventory DropDownList-->
<td>
<asp:DropDownList ID="Inv_DD" Height="20px" runat="server" CssClass="TBDeco" Width="150px"></asp:DropDownList>
<br />
</td>
<td width="240px">
<div style="float: left; height: 20px auto; width: 130px;" >
<asp:TextBox ID="SLife_TB" runat="server" CssClass="TBDecoSmall" Wrap="False" Width="120px" onclick="document.getElementById('ContentPlaceHolder2_SLife_TB').focus();"></asp:TextBox>
<br />
</div>
<div style="float:right; height: 20px auto;" >
<asp:CheckBox ID="Unlimit_CB" runat="server" AutoPostBack="false" CssClass="TBDecoSmall" Height="20px" Text="Unlimited" />
</div>
</td>
</tr>
<!--Header-->
<tr>
<td class="TextDeco">
<img src="../Images/red_star.gif" alt="red_star" class="RedStars"/>Charge Number:
</td>
<td class="TextDeco" style="margin-left:15px;">
Owning Cost Center:
</td>
<td class="TextDeco" style="margin-left:15px;">
Unit Value:
</td>
</tr>
<tr class="bold" style="vertical-align: top">
<!--Charge Number TextBox-->
<td width="250px">
<asp:TextBox ID="Charge_TB" runat="server" CssClass="TBDeco" Width="143px"></asp:TextBox>
<br />
</td>
<!--Owning Cost Center TextBox-->
<td>
<asp:TextBox ID="Own_TB" runat="server" CssClass="TBDeco" Width="143px"></asp:TextBox>
<br />
</td>
<td>
<asp:TextBox ID="Line_TB" runat="server" CssClass="TBDeco" Width="120px"></asp:TextBox>
<br /><br />
</td>
</tr>
</table>
<table cellpadding="1" cellspacing="1" rules="none" frame="void" style="margin: 0px; padding: 0px" >
<tr class="bold ">
<td width="108px">
<img src="../Images/red_star.gif" alt="red_star" class="RedStars" />Serialized:
</td>
<td width="60px" >
<asp:RadioButtonList ID="Seri_RB" runat="server" RepeatDirection="Horizontal" AutoPostBack="false" Width="80px" >
<asp:ListItem Value="1">Yes</asp:ListItem>
<asp:ListItem Value="0">No</asp:ListItem>
</asp:RadioButtonList>
</td>
<td width="193px">
<img id="starForQuantity" runat ="server" src="../Images/red_star.gif" alt="Red Star" class="RedStars"/> Quantity:
<br />
<asp:TextBox ID="Quan_TB" runat="server" Width="143px" Wrap="False" CssClass="TBDecoNone"></asp:TextBox>
</td>
<td width="300px" id="SerialNumber" runat ="server" >
<img id="starForSerial" runat ="server" src="../Images/red_star.gif" alt="Red Star" class="RedStars"/> Serial Number:
<br />
<asp:TextBox ID="Seri_TB" runat="server" Width="120px" CssClass="TBDecoNone" Wrap ="false" ></asp:TextBox>
</td>
</tr>
<tr class="bold " >
<td>
<img src="../Images/red_star.gif" alt="red_star" class="RedStars"/>Moisture Sensitive:
</td>
<td width="60px">
<asp:RadioButtonList ID="Moist_RB" runat="server" AutoPostBack="false" RepeatDirection="Horizontal" >
<asp:ListItem Value="1">Yes</asp:ListItem>
<asp:ListItem Value="0">No</asp:ListItem>
</asp:RadioButtonList>
</td>
</tr>
<tr class="bold " >
<td >
<img src="../Images/red_star.gif" alt="red_star" class="RedStars"/>Hazardous:
</td>
<td width="80px">
<asp:RadioButtonList ID="Haz_RB" runat="server" RepeatDirection="Horizontal" AutoPostBack="false" >
<asp:ListItem Value="1">Yes</asp:ListItem>
<asp:ListItem Value="0">No</asp:ListItem>
</asp:RadioButtonList>
</td>
</tr>
</table>
<table>
<tr class="bold" runat="server" id="MSDS_TR" style="display:none">
<td width="130px;">
<img src="../Images/red_star.gif" alt="red_star" class="RedStars"/>
<asp:Label ID="MSDSLabel" runat="server" Text="MSDS Number:"></asp:Label>
</td>
<td width="100px">
<asp:TextBox ID="MSDS_TB" runat="server" CssClass="TBDecoSmall" Wrap="False" Width="100px"></asp:TextBox>
</td>
<td></td>
<td width="440px" colspan="1" >
<div style="float:left" > Attached MSDS: </div>
<input type="file" id="MSDSFileUpload" runat="server" style="width:330px;height:20px" />
</td>
</tr>
</table>
<table id="pkg" runat ="server" >
<tr class="bold" >
<%-- Pack_TR is to make the red star image visible/invisible--%>
<td runat="server" id="Pack_TR" visible="true" >
<img src="../Images/red_star.gif" alt="red_star" class="RedStars"/>Packaging Requirement:
</td>
<td colspan="3" style="width: 468px; text-align:left;" align="left">
<asp:CheckBoxList ID="PackingReq_CBL" runat="server" AutoPostBack="false"
CssClass="Space" RepeatDirection="Horizontal" Visible="true" />
</td>
</tr>
</table>
<table id ="pkgOther" runat ="server" style="display:none">
<tr id="OtherPkgRequirent_TR" runat="server" class="bold " style ="vertical-align:middle;" >
<td>
<img src="../Images/red_star.gif" alt="red_star" class="RedStars"/>Other Packaging Requirement:
</td>
<td colspan="2" align="left">
<asp:TextBox ID="OtherPkgRequirent_TB" runat="server" Width="550px" Wrap="False"></asp:TextBox>
</td>
<td>
</td>
</tr>
</table>
<center>
<div id="mat_err" style="color:red" runat="server" ></div>
<div style="">
<input type="button" id="btnSave" value="Save Material Number" onclick="return SaveMaterialData();" />
<input type="button" id="btnSaveAddMaterial" value="Save and Add Material Number" />
<input type="button" id="btnCancel" value="Cancel" onclick="Cancel()" />
</div>
</center>
</div>
</fieldset>
</div>
</asp:Content>
Have you tried running it through the XHTML validator?
http://validator.w3.org/
you may find errors in there that are compromising the rest of the page's html.
I have a one dropdown box in webpage that is with autopostback = true and one modal popup extender in same webp age.. When i changed the selection and then open modal popup and enter value then close the modal popup.. It will postback and entered value does not display when open modal popup again....How i prevent postback when close modalpopup and getting same value again...
Please help for the same...My code is given below:
<asp:DropDownList runat="server" ID="ddlDBANameFormField" AutoPostBack="true" >
<asp:ListItem Selected="True" Text="Select"></asp:ListItem>
<asp:ListItem Text="One"></asp:ListItem>
<asp:ListItem Text="Two"></asp:ListItem>
<asp:ListItem Text="Three"></asp:ListItem>
</asp:DropDownList>
<div id="tempHotelStatistic">
<div id="MainHotelStatistic" style="width: 998px;" runat="server">
<div style="width: 330px; height: 30px; float: left;" id="RoomsRentedAfterAudit"
runat="server">
<div style="width: 150px; float: left;">
<asp:Label ID="lblRoomsRentedAfterAudit" runat="server" Text="After Audit Rooms:"
Width="175px" CssClass="label"></asp:Label>
</div>
<asp:UpdatePanel UpdateMode="Conditional" runat="server" ID="UpdatePanel3">
<ContentTemplate>
<div style="width: 150px; float: left;">
<table>
<tr>
<td>
<asp:TextBox ID="txtRoomsRentedAfterAudit" runat="server" CssClass="textboxpopup"></asp:TextBox>
<cc1:ModalPopupExtender ID="ModalPopupExtender4" OkControlID="ModalOKButtonRoomsRented"
runat="server" TargetControlID="btnpopupRoomsRented" CancelControlID="btnpopupCancelRoomsRented"
PopupControlID="PanelRoomRented" Drag="true" PopupDragHandleControlID="PopupHeader1" >
</cc1:ModalPopupExtender>
</td>
<td>
<asp:Button ID="btnpopupRoomsRented" runat="server" Text="...." CssClass="buttonpopup"
Style="color: #333333; margin-left: 0; margin-right: 0; width: 35px;" />
</td>
</tr>
</table>
</div>
<div id="PanelRoomRented" style="display: none;" class="popupConfirmation">
<div class="popup_Container">
<div class="popup_Titlebar" id="Div3">
<div class="TitlebarLeft">
Reason :
</div>
<div>
<asp:Button ID="btnpopupCancelRoomsRented" class="TitlebarRight " runat="server" />
</div>
</div>
<div>
<table>
<tr>
<td valign="top" height="5px">
</td>
</tr>
<tr>
<td valign="bottom">
<textarea id="txtRoomsRentedAfterAuditReason" runat="server" rows="20" cols="20"
style="width: 270px; height: 100px;"></textarea>
</td>
</tr>
<tr>
<td valign="top" height="5px">
</td>
</tr>
</table>
</div>
</div>
<div class="popup_Container" align="right">
<asp:Button ID="ModalOKButtonRoomsRented" runat="server" Width="60px" Text="OK" CssClass="buttonForPopUp" />
</div>
</div>
<cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender111" runat="server" FilterType="Custom,Numbers"
ValidChars="-" FilterMode="ValidChars" TargetControlID="txtRoomsRentedAfterAudit">
</cc1:FilteredTextBoxExtender>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="btnpopupRoomsRented" />
</Triggers>
</asp:UpdatePanel>
</div>
</div>
</div>
Solved the problem by applying trigger for the update panel , in which modal popup resides...
<Triggers>
<asp:PostBackTrigger ControlID="ddlDBANameFormField" />
</Triggers>
I've been goin at it now for an 1.5hrs and I just can't figure out a way to make it the way I want. I'm kind of new with all things web, and it takes about as much time (maybe more?) trying to get things where I want and doing it in a way that is elegant.
Anyways, I have two text boxes, with two labels above them and centered over the box. I want to simply put a button in between them and about centered with the textboxes' height.
This is as close as I can make it get to what I want. I would like the left textbox moved over so it lines up with the words "Jump To:, "Customer:," and "Customer #:" and then have the right box be the same distance on the right with the Next button maybe a just 10px higher but still centered as it is. The problem with this picture is that it only works when the text boxes are shown and expanded, if they are hidden, then the panel actually renders half-way above the Customer # part because of how I manipulated the margins I'm guessing.
http://img192.imageshack.us/img192/259/controls.jpg http://img192.imageshack.us/img192/259/controls.jpg
Here's my attempt with <div>s
<div style="position:relative; overflow:auto; margin-top:15px; margin-bottom:10px;">
<div style="width:40%; float:left; margin-left:10px;">
<div><asp:Label runat="server" ID="lblInfoDesc" /></div>
<div><asp:TextBox ID="txtInfoDescription" runat="server" TextMode="MultiLine" Rows="3" MaxLength="500" Width="100%" /></div>
</div>
<%--<div style="position:absolute; margin-top:25px; margin-left:-10px;"><asp:Button ID="Button1" runat="server" Text="Next" /></div>--%>
<div style="width:40%; float:right; margin-right:16px;">
<div><asp:Label runat="server" ID="lblInfoData" /></div>
<div><asp:TextBox ID="txtInfoData" runat="server" TextMode="MultiLine" Rows="3" MaxLength="500" Width="100%" /></div>
</div>
</div>
And here's my attempt with table elements
<div style="margin-bottom:10px;">
<table style="position:relative; width:100%; margin-bottom:15px;">
<tr style="text-align:center";>
<td><asp:Label runat="server" ID="lblInfoDesc" /></td>
<td></td><td></td><td></td><td></td>
<td><asp:Label runat="server" ID="lblInfoData" /></td>
</tr>
<tr>
<td style="margin-left: 0px;"><asp:TextBox ID="txtInfoDescription" runat="server" TextMode="MultiLine" Rows="3" MaxLength="500" Width="80%" /></td>
<td></td><td></td><td></td><td></td>
<td style="margin-right:10px;"><asp:TextBox ID="txtInfoData" runat="server" TextMode="MultiLine" Rows="3" MaxLength="500" Width="80%" /></td>
</tr>
</table>
<div style="position:inherit; text-align:center; margin-top:-55px; margin-bottom:25px;">
<asp:Button ID="Button2" runat="server" Text="Next" />
</div>
</div>
All of those <td></td><td></td><td> was to attempt to put spaces between the button and the text boxes because I couldn't get float nor margin to work. Any help would be much appreciated!
And here's the complete page source:
<asp:Panel ID="pnlCustomer" runat="server" style="background-color:#ccccff; width:500px; height:90%; position:relative;" BorderColor="DarkBlue" BorderWidth="2px">
<div style="position:relative; margin-top:10px; margin-left:10px;">
<div style="color:#003399; font-size:18px; text-align:left;">Jump To:
<asp:DropDownList ID="ddlCategory" runat="server" AutoPostBack="True"
onselectedindexchanged="ddlCategory_SelectedIndexChanged"
style="margin-left:40px;"/>
</div>
</div>
<div style="position:relative; margin-top:10px; margin-left:10px;">
<div style="color:#003399; font-size:18px; text-align:left;">Customer:
<asp:DropDownList ID="ddlCustomersList" runat="server" AutoPostBack="true"
OnSelectedIndexChanged="ddlCustomersList_SelectedIndexChanged"
style="margin-left:35px;"/>
<asp:Button ID="btnAddCustomer" runat="server" Text="Add" OnClick="btnAddCustomer_Click" OnClientClick="return confirm('Warning: This will redirect you from the page');" />
</div>
</div>
<div style="position:relative; margin-top:10px; margin-left:10px;">
<div style="color:#003399; font-size:18px; text-align:left;">Customer #:
<asp:DropDownList ID="ddlCustomerNumber" runat="server" AutoPostBack="true"
OnSelectedIndexChanged="ddlCustomerNumber_SelectedIndexChanged"
style="margin-left:20px;"/>
<asp:TextBox ID="txtCustomerNumber" runat="server" style="margin-left:20px;" />
<asp:Button ID="btnModify" runat="server" Text="Modify" OnClick="btnModify_Click" />
<asp:Button ID="btnCreateNew" runat="server" Text="Create New" OnClick="btnCreateNew_Click" />
<asp:Button ID="btnUpdate" runat="server" Text="Update" OnClick="btnUpdate_Click" />
<asp:Button ID="btnDelete" runat="server" Text="Delete" OnClick="btnDelete_Click" OnClientClick="return confirm('Do you want to delete the record ?');" />
<asp:Button ID="btnSaveNew" runat="server" Text="Save" OnClick="btnSaveNew_Click" />
<asp:Button ID="btnCancel" runat="server" Text="Cancel" OnClick="btnCancel_Click" />
</div>
</div>
<%-- <div style="margin-bottom:10px;">
<table style="position:relative; width:100%; margin-bottom:15px;">
<tr style="text-align:center";>
<td><asp:Label runat="server" ID="lblInfoDesc" /></td>
<td></td><td></td><td></td><td></td>
<td><asp:Label runat="server" ID="lblInfoData" /></td>
</tr>
<tr>
<td style="margin-left: 0px;"><asp:TextBox ID="txtInfoDescription" runat="server" TextMode="MultiLine" Rows="3" MaxLength="500" Width="80%" /></td>
<td></td><td></td><td></td><td></td>
<td style="margin-right:10px;"><asp:TextBox ID="txtInfoData" runat="server" TextMode="MultiLine" Rows="3" MaxLength="500" Width="80%" /></td>
</tr>
</table>
<div style="position:inherit; text-align:center; margin-top:-55px; margin-bottom:25px;">
<asp:Button ID="Button2" runat="server" Text="Next" />
</div>
</div>--%>
<div style="position:relative; overflow:auto; margin-top:15px; margin-bottom:10px;">
<div style="text-align:center; margin-bottom:-20px; ">
<asp:Button ID="btnNextInfo" runat="server" Text="Next" />
</div>
<div style="width:40%; float:left; margin-left:10px;">
<div><asp:Label runat="server" ID="lblInfoDesc" /></div>
<div><asp:TextBox ID="txtInfoDescription" runat="server" TextMode="MultiLine" Rows="3" MaxLength="500" Width="100%" /></div>
</div>
<div style="width:40%; float:right; margin-right:16px;">
<div><asp:Label runat="server" ID="lblInfoData" /></div>
<div><asp:TextBox ID="txtInfoData" runat="server" TextMode="MultiLine" Rows="3" MaxLength="500" Width="100%" /></div>
</div>
</div>
<div style="margin-top:-20px; position:absolute; font-size:12px;"><asp:Label runat="server" ID="lblErrorMessage" /></div>
</asp:Panel>
It seems like this is more of a CSS and HTML question than an ASP.Net question.
To be clear, centering things vertically in their parent with CSS isn't easy, the trick is:
The parent element must have a position:relative or absolute.
The child must be wrapped in a div or something positionable.
The child must have the top:50%
The child must declare a height.
the child must have a margin-top = it's height / 2 * -1. (basically you move it up by half it's height.)
Try this:
<style>
div.textboxArea {
text-align:center;
float:left;
width:40%;
height:400px;
}
.textboxArea textarea {
width:80%;
height:400px;
}
.centerMeVertically div {
position:absolute;
top:50%;
vertical-align:middle;
height:30px;
width:100%;
margin-top:-15px;
text-align:center;
}
div.centerMeVertically {
float:left;
width:20%;
text-align:center;
height:400px;
position:relative;
}
p {
height:35px;
margin:-35px 0 0 0;
}
.container {
margin-top:35px;
}
</style>
<div class="container">
<div style="width:100%;">
<div class="textboxArea">
<p>Label 1</p>
<textarea></textarea>
</div>
<div class="centerMeVertically">
<div><button>Button2</button></div>
</div>
<div class="textboxArea">
<p>Label 2</p>
<textarea></textarea>
</div>
</div>
</div>
EDIT: Having seen your revised question, I've revised my answer to center the button only to the textarea vertically.
You have to do some stupid CSS tricks with the top-margin, but it gets the job done. Also notice the container div. This is to make sure that if you place anything "above" this snippet in your markup, it doesn't get overlapped by the labels.
if I haven't misunderstood, it's not that tough. see if following code renders the layout your image says.
<table cellpadding="3px" cellspacing="0" border="0" style="width: 100%;">
<tr>
<td align="center" valign="top">
Label
</td>
<td align="center" valign="top">
</td>
<td align="center" valign="top">
Label
</td>
</tr>
<tr>
<td align="center" valign="top">
<asp:TextBox ID="TextBox1" TextMode="MultiLine" Rows="7" runat="server"></asp:TextBox>
</td>
<td align="center" valign="top">
<asp:Button ID="Button1" runat="server" Text="Button" />
</td>
<td align="center" valign="top">
<asp:TextBox ID="TextBox2" TextMode="MultiLine" Rows="7" runat="server"></asp:TextBox>
</td>
</tr>
</table>
I would stick with something simple like this table... then add padding as needed.
<table>
<tr>
<td align="center">label a</td>
<td></td>
<td align="center">label b</td>
</tr>
<tr>
<td valign="top"><textarea id="txtinfodescription" rows="3" maxlength="500" width="80%"></textarea></td>
<td valign="middle"><input type="button" id="button2" value="next"/></td>
<td valign="top"><textarea id="txtinfodata" rows="3" maxlength="500" width="80%"></textarea></td>
</tr>
</table>
don't get me wrong, you can go the pure CSS route too... but if you layout get much more complex and you need to maintain a fairly rigid "grid-like" structure... tables help.