ModalPopupExtender dosenot show up and display blank page - asp.net

hi,
I had aproblem on model popup extender as I used it well , I did my code well .but when I was testing it it didnot show up only blank page appeared.
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
.ModalPopupBG
{
background-color: #666699;
filter: alpha(opacity=50);
opacity: 0.7;
width: 500px;
height: 300px;
}
.btnadd
{
background-image: url('Content/Images/add.png');
height: 27px;
width: 78px;
border: none;
background-repeat: no-repeat;
cursor: pointer;
}
.calhover
{
cursor: pointer;
vertical-align: baseline;
}
.z
{
clear: both;
height: 1px;
}
.tile
{
background-image: url('Content/Images/tile.png');
background-repeat: repeat-y;
width: 437px;
background-position: right;
color: White;
font-weight: bold;
}
.activetab
{
background-color: Green;
font-size: 50px;
}
.accordion
{
width: 770px;
}
.accordionHeader
{
border: 1px solid #2F4F4F;
color: white;
background-color: #2E4d7B;
font-family: Arial, Sans-Serif;
font-size: 12px;
font-weight: bold;
padding: 5px;
margin-top: 5px;
cursor: pointer;
}
.accordionHeaderSelected
{
border: 1px solid #2F4F4F;
color: white;
background-color: #5078B3;
font-family: Arial, Sans-Serif;
font-size: 12px;
font-weight: bold;
padding: 5px;
margin-top: 5px;
cursor: pointer;
}
.accordionContent
{
background-color: #D3DEEF;
border: 1px dashed #2F4F4F;
border-top: none;
padding: 5px;
padding-top: 10px;
}
</style>
<script type="text/javascript">
function ValidateCheckBox1(sender, args) {
if (document.getElementById("<%=CheckBox1.ClientID %>").checked == true) {
args.IsValid = true;
} else {
args.IsValid = false;
}
}
</script>
<script type="text/javascript">
function ValidateCheckBox2(sender, args) {
if (document.getElementById("<%=CheckBox2.ClientID %>").checked == true) {
args.IsValid = true;
} else {
args.IsValid = false;
}
}
</script>
<script type="text/javascript">
function ValidateCheckBox3(sender, args) {
if (document.getElementById("<%=CheckBox3.ClientID %>").checked == true) {
args.IsValid = true;
} else {
args.IsValid = false;
}
}
</script>
<ContentTemplate>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="body_con ">
<div class="bf_body_d">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr valign="top">
<td>
</td>
<td class="body_content" valign="top">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="3">
<tr>
<td style="border: #3399FF">
<table width="100%" border="0" cellspacing="3" cellpadding="2">
<tr>
<td width="100%" class="style1" align="left">
<h3 style="color: Gray; font-size: large;">
Questions</h3>
<h2>
Please be aware that your answer on both questions might be used by HR to screen
your application.</h2>
</td>
</tr>
<tr>
<td class="style1" align="left">
<asp:DataList ID="Dl_Question" runat="server" OnItemDataBound="Dl_Question_ItemDataBound"
OnItemCommand="Dl_Question_ItemCommand">
<ItemTemplate>
<asp:Label ID="lbl_QID" runat="server" Text='<%# Eval("ID") %>' Visible="false"></asp:Label><br />
<asp:Label ID="Lbl_Question" runat="server" Text='<%# Eval("Question") %>'></asp:Label><br />
<textarea id="Txt_Answer" cols="75" rows="3" runat="server"></textarea>
<asp:RequiredFieldValidator ID="RequiredFieldValidator22" runat="server" ControlToValidate="Txt_Answer"
ErrorMessage="*" Display="Dynamic" SetFocusOnError="True" ForeColor="Red" ValidationGroup="question">*</asp:RequiredFieldValidator>
</ItemTemplate>
</asp:DataList>
</td>
</tr>
<tr>
<td width="100%" class="style1" align="left" valign="top">
<h3 style="color: Gray; font-size: medium;">
Upload Your CV
</h3>
<asp:FileUpload ID="FU_CV" runat="server" />
<asp:CustomValidator ID="CustomValidator" runat="server" ControlToValidate="FU_CV"
ErrorMessage="File size should not be greater than 4 MB." OnServerValidate="CustomValidator1_ServerValidate"></asp:CustomValidator>
<asp:RequiredFieldValidator ID="RequiredFieldValidator22" runat="server" ControlToValidate="FU_CV"
ErrorMessage="*" Display="Dynamic" SetFocusOnError="True" ForeColor="Red" ValidationGroup="question">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td valign="top">
<div>
<asp:Panel ID="Panel2" runat="server">
<h2 style="color: Blue; font-size: medium;">
Please certify the information supplied before submitting your CV by checking the
checkbox below .</h2>
<h2 class="dark_gray">
<asp:CheckBox ID="CheckBox1" runat="server" />
<span>I certify that all answers given herein are true and complete.
<asp:CustomValidator ID="CustomValidator1" runat="server" ForeColor="Red" ErrorMessage="*"
ClientValidationFunction="ValidateCheckBox1" ValidationGroup="question"></asp:CustomValidator>
</span>
<br />
<asp:CheckBox ID="CheckBox2" runat="server" />
<span>I authorize investigation of all statements contained in this application for
employment as may be necessary in arriving at an employment decision.
<asp:CustomValidator ID="CustomValidator2" runat="server" ForeColor="Red" ErrorMessage="*"
ClientValidationFunction="ValidateCheckBox2" ValidationGroup="question"></asp:CustomValidator></span>
<br />
<asp:CheckBox ID="CheckBox3" runat="server" />
<span>I hereby certify that all the above data is true and correct. If proven otherwise,
I will be dismissed without any notice or commitment from the employer.
<asp:CustomValidator ID="CustomValidator3" runat="server" ForeColor="Red" ErrorMessage="*"
ClientValidationFunction="ValidateCheckBox3" ValidationGroup="question"></asp:CustomValidator>
</span>
</h2>
</asp:Panel>
<div align="center" style="padding-top: 10px;">
<asp:ImageButton ID="preup" runat="server" ImageUrl="~/Content/Images/down.png" OnClick="preup_Click" />
<asp:ImageButton ID="BT_submit" runat="server" ImageUrl="~/Content/Images/finish.png"
OnClick="BT_submit_Click" ValidationGroup="question" /></div>
</div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
</tr>
</table>
</td>
<!-- Kareem end here plz -->
</tr>
</table>
</div>
</td>
</tr>
</table>
</ContentTemplate>
</cc1:TabPanel>
</cc1:TabContainer>
<cc1:ModalPopupExtender ID="modalpopup" runat="server" OkControlID="btnOkay" TargetControlID="hfield"
PopupControlID="display" PopupDragHandleControlID="PopupHeader" Drag="true" BackgroundCssClass="ModalPopupBG">
</cc1:ModalPopupExtender>
<asp:HiddenField ID="hfield" runat="server" />
<asp:Panel ID="display" Style="display: none" runat="server">
<div>
<img src="Content/Images/warning.png" />
</div>
<div align="center">
<input id="btnOkay" type="button" value="OK" />
</div>
</asp:Panel>
protected void BT_submit_Click(object sender, ImageClickEventArgs e)
{
string File = "~/CvFiles/" + FU_CV.FileName;
if (FU_CV.FileBytes.Length > 4194304)
{
modalpopup.Show();
}
}

I had solved this problem as I added TargetControlID to hidden field's ID but when I replaced it with the ID of submit button "BT_submit" it worked well.

Related

Insert into database not fire using Jquery in asp.net

its been a whole day trying to short out my problem.
Now i am here..
i am trying to create a student registration page and on submit it should go to next tab..
here is the .aspx and jquery :
<%# Page Title="" Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="Default8.aspx.vb" Inherits="Default8" %>
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<style type="text/css">
.tdText
{
font: 12px Verdana;
color: #333333;
font-weight: 600;
}
</style>
<script type="text/javascript">
$(function () {
$("#<% =txtRmobile.ClientID%>").keydown(function (e) {
if (e.shiftKey || e.ctrlKey || e.altKey) {
e.preventDefault();
} else {
var key = e.keyCode;
if (!((key == 8) || (key == 46) || (key >= 35 && key <= 40) || (key >= 48 && key <= 57) || (key >= 96 && key <= 105))) {
e.preventDefault();
}
}
});
});
</script>
<script type="text/javascript">
$(function () {
$("#<% =btnRsubmit.ClientID%>").click(function () {
var uid = $("#<% =txtRmobile.ClientID%>").val();
var mob = $("#<% =txtRmobile.ClientID%>").val();
var email = $("#<% =txtRemail.ClientID%>").val();
var dob = $("#<% =txtRdob.ClientID%>").val();
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "Default8.aspx/InsertData",
data: "{'uid':'" + uid + "','mob':'" + mob + "','email':'" + email + "','dob':'" + dob + "'}",
dataType: "json",
success: function (data) {
var obj = data.d;
if (obj == 'true') {
$("#<% =txtRmobile.ClientID%>").val('');
$("#<% =txtRmobile.ClientID%>").val();
$("#<% =txtRemail.ClientID%>").val('');
$("#<% =txtRdob.ClientID%>").val();
//alert("Details Submitted Successfully");
enableTab('3');
SelectTab('3');
}
},
error: function (result) {
alert("Error");
return false;
}
});
});
});
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" EnablePageMethods="true">
</asp:ToolkitScriptManager>
<div runat="server">
<fieldset class="fieldsetAbout" style="margin-left: 10px; width: 95%; text-align: center">
<legend style="font-size: 20px; font-family: Arial; color: red">CANDIDATE REGISTRATION</legend>
<table style="width: 100%; height: 100%">
<tr>
<td style="vertical-align: middle; text-align: left">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<table style="width: 100%">
<tr>
<td colspan="4" style="font-size: 14px; font-family: Verdana; color: red; width: 100%; height: 100%; text-align: right">
<input type="button" value="IF ALREADY REGISTRED GO TO LOGIN PAGE"
onclick="gotologin();" class="button" />
</td>
</tr>
<tr>
<td colspan="4"> </td>
</tr>
<tr>
<td style="vertical-align: middle; padding-top: 5px; text-align: right; width: 30%" class="tdtext">Enter Mobile Number:
</td>
<td colspan="1" style="vertical-align: Top; text-align: left; width: 30%" class="tdtext">
<asp:TextBox ID="txtRmobile" runat="server" CssClass="textbox" MaxLength="10"
placeholder="Mobile Number" Width="220px" Style="vertical-align: top"
OnTextChanged="txtRmobile_TextChanged"
AutoPostBack="True"></asp:TextBox>
<span style="vertical-align: bottom; color: red; font-size: large">*</span>
<td style="vertical-align: middle; padding-top: 5px; text-align: right; width: 5%" class="tdtext">
<asp:Image ID="ImageMmessage" runat="server" Height="17px"
Style="z-index: 1; left: 445px; top: 138px; height: 20px; width: 24px"
Width="17px" />
</td>
<td style="text-align: left; vertical-align: top; padding-top: 13px; width: 30%">
<asp:Label ID="lblMmessage" runat="server"
Style="z-index: 1; left: 474px; top: 138px; height: 19px; width: 203px"
Text="Label"></asp:Label>
</td>
</td>
</tr>
<tr>
<td colspan="4"> </td>
</tr>
<tr>
<td style="vertical-align: middle; padding-bottom: 15px; text-align: right; width: 30%" class="tdtext">Enter Email ID:
</td>
<td colspan="1" style="vertical-align: Top; text-align: left" class="tdtext">
<asp:TextBox ID="txtRemail" runat="server" CssClass="textbox"
placeholder="E-Mail" Width="220px" OnTextChanged="txtRemail_TextChanged"
AutoPostBack="True" />
<span style="vertical-align: bottom; color: red; font-size: large">*</span>
</td>
<td style="vertical-align: middle; padding-top: 5px; text-align: right; width: 5%" class="tdtext">
<asp:Image ID="ImageEmessage" runat="server" Height="17px"
Style="z-index: 1; left: 445px; top: 138px; height: 20px; width: 24px"
Width="17px" />
</td>
<td colspan="1" style="text-align: left; vertical-align: top; padding-top: 13px; width: 30%">
<asp:Label ID="lblEmessage" runat="server"
Style="z-index: 1; left: 474px; top: 138px; height: 19px; width: 203px"
Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td colspan="4"> </td>
</tr>
<tr>
<td style="vertical-align: middle; text-align: right; width: 40%" class="tdtext">Date of Birth (dd/MM/yyyy) :
</td>
<td style="vertical-align: Top; text-align: left" class="tdtext">
<asp:TextBox ID="txtRdob" runat="server" CssClass="textbox"
placeholder="DD/MM/YYYY" Width="150px" Style="float: left" />
<asp:ImageButton ID="ImageButton1" ImageUrl="~/Images/Calendar.png"
ImageAlign="Left" AlternateText="Click here to display calendar"
runat="server" Style="vertical-align: middle; padding-top: 6px" />
<asp:CalendarExtender ID="CalendarExtender1" PopupButtonID="ImageButton1" runat="server"
TargetControlID="txtRdob" Format="dd/MM/yyyy">
</asp:CalendarExtender>
<span style="vertical-align: top; color: red; font-size: large">*</span>
</td>
<td colspan="3" style="text-align: left; vertical-align: top; padding-top: 13px; width: 30%">
<asp:Label ID="Label1" runat="server" Style="vertical-align: top"></asp:Label>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="txtRemail" Display="Dynamic" CssClass="ErrorMsg"
ErrorMessage="Required" ValidationGroup="reg" ForeColor="Maroon" />
</td>
</tr>
<tr>
<td colspan="4"> </td>
</tr>
<tr>
<td colspan="4" style="vertical-align: middle; text-align: center">
<input id="btnRsubmit" runat="server" type="button" value=" REGISTER "
class="button" style="Height: 40px; Width: 200px" />
</td>
</tr>
<tr>
<td style="vertical-align: middle; text-align: center; color: red; font-family: Verdana; font-size: 14px" colspan="4">
<asp:Label ID="lblmsg" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td colspan="4" style="vertical-align: middle; text-align: right; font-family: Forte" class="tdtext">
<span style="color: red; font-size: larger">*</span> Mandatory fields
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</fieldset>
</div>
</asp:Content>
and here is my vb code :
<WebMethod()> _
<ScriptMethod()> _
Public Shared Function InsertData(ByVal uid As String, ByVal mob As String, ByVal email As String, ByVal dob As String) As String
Dim msg As String = String.Empty
Dim strConnString As String = System.Configuration.ConfigurationManager.ConnectionStrings("kckcmsDB").ConnectionString
Using con As New SqlConnection(strConnString)
Using cmd As New SqlCommand("insert into sturegI(uid,mobile,email,dob) VALUES(#uid, " _
& " #mobile,#email,#dob)", con)
con.Open()
cmd.Parameters.AddWithValue("#uid", uid)
cmd.Parameters.AddWithValue("#mobile", mob)
cmd.Parameters.AddWithValue("#email", email)
cmd.Parameters.AddWithValue("#dob", dob)
Dim i As Integer = cmd.ExecuteNonQuery()
con.Close()
If i = 1 Then
msg = "true"
Else
msg = "false"
End If
End Using
End Using
Return msg
End Function
In ViewPageSource it showing :
<script type="text/javascript">
$(document).ready(function () {
$("#ContentPlaceHolder1_btnRsubmit").click(function () {
var uid = $("#ContentPlaceHolder1_txtRmobile").val();
var mob = $("#ContentPlaceHolder1_txtRmobile").val();
var email = $("#ContentPlaceHolder1_txtRemail").val();
var dob = $("#ContentPlaceHolder1_txtRdob").val();
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "Default8.aspx/InsertData",
data: "{'uid':'" + uid + "','mob':'" + mob + "','email':'" + email + "','dob':'" + dob + "'}",
dataType: "json",
success: function (data) {
var obj = data.d;
if (obj == 'true') {
$("#ContentPlaceHolder1_txtRmobile").val('');
$("#ContentPlaceHolder1_txtRmobile").val();
$("#ContentPlaceHolder1_txtRemail").val('');
$("#ContentPlaceHolder1_txtRdob").val();
//alert("Details Submitted Successfully");
enableTab('3');
SelectTab('3');
}
},
error: function (result) {
alert("Error");
return false;
}
});
});
});
</script>
its not firing as i wish.
please help.....

How to disable controls inside a <TD> for FF and Chrome. IE ok

I have a few checkbox controls inside a <td> that I need to disable so users cannot check the checkboxes.
This all works in IE8 and above, but FF or Chrome, the disable="disabled" is ignored. Why and how can I get around this please?
<td id="tdDocs" runat="server" style="table-layout: fixed; visibility: visible; overflow: auto; border-collapse: separate; font-size: 12pt; vertical-align: top; text-align: left; font-weight: bold; font-family: Arial; background-color: transparent; width: 799px; background-image: none;" colspan="2">
<strong>What documents will be required for today's tasks?<br /></strong>
<span style="font-size: 9pt">(Please ensure supporting documentation is attached)</span>
<asp:CustomValidator ID="CustomValidator12" runat="server"
ErrorMessage='Tick one of the "Documents required today" section tick boxes.' OnServerValidate="CustomValidator12_ServerValidate" ValidationGroup="ValidationGroup1" Font-Names="Arial" Font-Size="9pt">*</asp:CustomValidator><br />
<table style="width: 651px; font-weight: bold; font-size: 10pt; font-family: Arial;">
<tr>
<td style="font-size: 10pt; font-family: Arial; height: 22px; font-weight: bold; width: 247px;">
<strong>
<asp:CheckBox ID="chkJSEA" runat="server" Text="JSEA" Width="200px" Font-Names="Arial" Font-Size="10pt" ValidationGroup="ValidationGroup1" /></strong></td>
<td style="height: 22px; font-weight: bold; font-size: 10pt; width: 278px; font-family: Arial;"><asp:CheckBox ID="chkRISKA" runat="server" Text="Risk Assessment" Width="200px" Font-Bold="True" Font-Names="Arial" Font-Size="10pt" ValidationGroup="ValidationGroup1" /></td>
<td style="height: 22px; font-weight: bold; font-size: 10pt; width: 121px; font-family: Arial;"><asp:CheckBox ID="chkWMS" runat="server" Text="Work Method Statement" Width="200px" Font-Bold="True" Font-Names="Arial" Font-Size="10pt" ValidationGroup="ValidationGroup1" /></td>
</tr>
<tr>
<td style="font-size: 12pt; width: 247px; font-family: Arial; height: 22px;">
<strong>
<asp:CheckBox ID="chkSOP" runat="server" Text="Safe Operating Procedures" Width="200px" Font-Names="Arial" Font-Size="10pt" ValidationGroup="ValidationGroup1" /></strong></td>
<td style="height: 22px" colspan="2">
<asp:CheckBox ID="chkOTHER" runat="server" Text="Other" OnCheckedChanged="chkOTHER_CheckedChanged" AutoPostBack="true" ValidationGroup="ValidationGroup1" />
<asp:TextBox ID="txtOtherFlag" runat="server" AutoPostBack="True" ValidationGroup="ValidationGroup1" ></asp:TextBox>
</td>
</tr>
</table>
</td>
In code-behind, I have logic to disable this row and everything in it with one line...
tdDocs.Disabled = True;
IE does indeed disable all controls inside a td (or any container) if you set its disabled attribute. I didn't even know that!
But the problem is that other browsers don't. disabled is not a valid attribute for a td. See this fiddle, where the checkbox in the table becomes unclickable in IE, but not in the other browsers.
Solution: disable all controls individually by running a quick loop over all the controls in the td.
So instead of
tdDocs.Disabled = true;
write
foreach (Control ctrl in tdDocs.Controls) {
if (ctrl is WebControl) ((WebControl)ctrl).Enabled = false;
}

How to show DIV just on top of button

I have a custom control, which has a Button + image, if image(down arrow) is clicked, a DIV should display, just like Dropdownlist.
However, its pushing the page contents to down to display the DIV. How to fix this.
It should just behave like dropdown
List should display on top of Button instead button
<table id="container" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<asp:Button ID="btnPost" runat="server" CssClass="postButton" OnClick="btnPost_Click" />
<asp:Button ID="btnDropDown" runat="server" CssClass="dropdownButton" OnClick="btnDropDown_Click" />
</td>
</tr>
<tr>
<td>
<div runat="server" id="divDropDownPanel" visible="false" style="text-align: left;
overflow: scroll; float: left; border: thin solid lightgrey; width: 160px; height: 120px;
background-color: #FFFFFF; position: absolute; z-index: 999;">
<asp:Repeater ID="rptDropDownContent" runat="server" OnItemDataBound="rptDropDownContent_ItemDataBound">
<HeaderTemplate>
<table>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td align="left">
<asp:CheckBox ID="chkChannel" runat="server" />
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</tr> </table>
</FooterTemplate>
</asp:Repeater>
<br />
</div>
</td>
</tr>

Keep width even when column changes. (HTML)

I have a login on the left sidebar of my website. When a user is logged in, the sidebar width doesn't remain the same as it was when the user wasn't logged in.
Is there a way to keep the width the same?
<!-- Start Sidebar -->
<td id="sidebar" valign="top" height="400px" style="width: 200px">
<!-- Login Form -->
<table id="TABLE2">
<tr>
<td valign="top">
<asp:LoginView ID="LoginView1" runat="server">
<LoggedInTemplate>
<br />
<br />
You are currently logged in.
</LoggedInTemplate>
<AnonymousTemplate>
<asp:Login ID="Login1" runat="server" BorderPadding="0" BorderStyle="None" BorderWidth="0px"
Font-Names="Verdana" Font-Size="0.8em" CreateUserText="Sign Up Now!" CreateUserUrl="http://www.tiltonindustries.com/Tilton/Login/CreateAccount.aspx"
Height="1px" PasswordRecoveryText="Forgot your password?" PasswordRecoveryUrl="http://www.tiltonindustries.com/Tilton/Login/ForgotPassword.aspx"
TextLayout="TextOnTop" Width="200px" DestinationPageUrl="http://www.tiltonindustries.com/Tilton/default.aspx">
<TitleTextStyle Font-Bold="True" Font-Size="0.9em"/>
<InstructionTextStyle Font-Italic="True" ForeColor="Black" />
<TextBoxStyle Font-Size="0.8em" />
<LoginButtonStyle BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="0.8em"
ForeColor="#990000" />
<LayoutTemplate>
<table border="0" cellpadding="4" cellspacing="0" style="border-collapse: collapse;
height: 159px;">
<tr>
<td style="height: 176px; width: 135px;">
<table border="0" cellpadding="0" style="width: 219px; height: 1px" id="TABLE1">
<tr>
<td align="center" style="font-weight: bold; font-size: 0.9em; color: white; height: 18px;
background-color: #990000; text-align: center" colspan="2">
Log In</td>
</tr>
<tr>
<td style="width: 94px; height: 10px;">
</td>
<td style="height: 10px; width: 78px;">
</td>
</tr>
<tr>
<td style="width: 94px; height: 20px; text-align: right">
<asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User Name:</asp:Label>
</td>
<td style="height: 20px; text-align: left; width: 78px;">
<asp:TextBox ID="UserName" runat="server" Font-Size="0.9em" EnableViewState="False"
Width="100px" MaxLength="20"></asp:TextBox><asp:RequiredFieldValidator ID="UserNameRequired"
runat="server" ControlToValidate="UserName" ErrorMessage="User Name is required."
ToolTip="User Name is required." ValidationGroup="ctl01$Login1">*</asp:RequiredFieldValidator></td>
</tr>
<tr>
<td style="width: 94px; text-align: right">
<asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label>
</td>
<td style="text-align: left; width: 78px;">
<asp:TextBox ID="Password" runat="server" Font-Size="0.9em" TextMode="Password" Width="100px"></asp:TextBox><asp:RequiredFieldValidator
ID="PasswordRequired" runat="server" ControlToValidate="Password" ErrorMessage="Password is required."
ToolTip="Password is required." ValidationGroup="ctl01$Login1">*</asp:RequiredFieldValidator></td>
</tr>
<tr>
<td style="height: 20px; width: 94px;">
</td>
<td style="height: 20px; text-align: left; width: 78px;">
<asp:CheckBox ID="chkRememberMe" runat="server" Text="Remember Me" Width="104px" /></td>
</tr>
<tr>
<td align="center" style="color: red; width: 94px; height: 20px;">
</td>
<td align="center" style="color: red; text-align: left; width: 78px; height: 20px;">
<asp:Button ID="LoginButton" runat="server" BorderStyle="Solid" BorderWidth="1px"
CommandName="Login" Font-Names="Verdana" Font-Size="1.0 em" Text="Log In" ValidationGroup="ctl01$Login1"
Width="59px" BackColor="Gray" BorderColor="Black" Height="20px" /></td>
</tr>
<tr>
<td align="center" style="width: 250px; color: red; height: 35px; text-align: center;"
colspan="2">
<asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal></td>
</tr>
<tr>
<td style="height: 26px; width: 94px;">
<asp:HyperLink ID="CreateUserLink" runat="server" NavigateUrl="http://www.tiltonindustries.com/Tilton/Login/CreateAccount.aspx">Sign Up Now!</asp:HyperLink>
</td>
<td style="width: 78px; height: 26px">
<asp:HyperLink ID="PasswordRecoveryLink" runat="server" NavigateUrl="http://www.tiltonindustries.com/Tilton/Login/ForgotPassword.aspx">Forgot your password?</asp:HyperLink></td>
</tr>
</table>
</td>
</tr>
</table>
</LayoutTemplate>
</asp:Login>
</AnonymousTemplate>
</asp:LoginView>
<!-- End Login Form -->
<!-- Quick Links -->
<br />
<br />
<p style="font-size: 14px; font-weight: bold; color: White">
Quick Links:<br />
</p>
<br />
<p id="quicklinks">
Home<br />
Services<br />
Color Matching<br />
Custom Packaging<br />
Decorals<br />
Delivery<br />
Items<br />
MSDS<br />
Plant Capabilities<br />
Standard Colors<br />
Special Effects<br />
Spray Coatings<br />
Warranty<br />
My Account<br />
Gallery<br />
About<br />
F.A.Q<br />
Links<br />
Careers<br />
Contact<br />
<br />
</p>
</td>
</tr>
</table>
</td>
<!-- End Sidebar -->
If the markup is the same, you could always just add a fixed width to it in CSS:
<div id="sidebar">
...
</div>
#sidebar { width: 200px; }
This, of course, assumes the markup for the sidebar itself is the same both when logged in and when not logged in.
...assuming you use a non-table layout. You can still set a fixed width on the sidebar-cell, but tables should generally not be used for layout purposes.
Edit: Ah, and there is the code. I advice you to read up on CSS (google "CSS tutorial" and the like) and remove all the style-attributes from your code. The way it looks today makes it really, really unreadable and not very easily changeable.

Modalpopup issue with Frame

I have a problem with my modalpopup style when I use frame in my page. I don't get trouble with modalpopup style if I don't use frames in page. Following HTML code and CSS work in normal aspx without a problem. In a page with frame, panel gets top of the page and background colour (grey colour) covers just half of page. And link button goes to right of page. Why does this happen?
CSS style:
/* dialog frame */
.modal-dialog
{
position:absolute;
}
/* dialog contents container */
.modal-dialog .container
{
font-family:tahoma,helvetica,arial,sans-serif;
font-size:11px;
width:340px;
border:solid 1px #99aabd;
background-color:#F2F9FF;
}
/* dialog header */
.modal-dialog .header
{
background:url(img/sprite.gif) repeat-x 0px -1100px;
height:25px;
padding-top:5px;
}
/* dialog header message */
.modal-dialog .header .msg
{
vertical-align:middle;
padding-left:6px;
color:#fff;
font-size:12px;
font-weight:bold;
}
/* dialog body */
.modal-dialog .body
{
height:40px;
background-color:#F2F9FF;
}
/* dialog body message */
.modal-dialog .body h2
{
padding-top:10px;
background-color: #F2F9FF;
font-size:14px;
text-align:center;
font-weight:normal;
}
/* dialog footer */
.modal-dialog .footer
{
height:30px;
background-color: #F2F9FF;
}
/* dialog footer buttons */
.modal-dialog .footer .right
{
background-color: #F2F9FF;
float:none;
text-align:center;
padding-bottom:6px;
}
/* dialog footer checkbox */
.modal-dialog .footer .left
{
background-color: #F2F9FF;
float:left;
text-align:left;
padding-bottom:6px;
padding-left:6px;
}
/* dialog close */
.modal-dialog .close
{
right:4px;
background: url(img/icons.gif) no-repeat -732px 0px;
width:16px;
cursor:hand;
position:absolute;
top:5px;
height:16px;
}
/* dialog close hover */
.modal-dialog .close:hover { background: url(img/icons.gif) no-repeat -749px 0px; }
/* modal overlay */
.modalBackground
{
background-color:Gray;
filter:alpha(opacity=50);
opacity:0.5;
}
Page's code. It works properly when I don't use frame:
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<div>
<TABLE id="Table1" style="Z-INDEX: 101; POSITION: absolute; WIDTH: 685px; HEIGHT: 192px; TOP: 45px; LEFT: 8px"
cellSpacing="1" cellPadding="1" width="685" border="0">
<TR>
<TD noWrap>
<TABLE id="Table2" cellSpacing="0" cellPadding="2" width="100%" border="0">
<TR>
<TD style="WIDTH: 129px; HEIGHT: 6px" noWrap><asp:label id="Label3" runat="server">Personel Tipi</asp:label></TD>
<TD style="HEIGHT: 6px" noWrap><asp:dropdownlist id="cboID_PERSONAL_TYPE" runat="server" Width="200px" AutoPostBack="True"></asp:dropdownlist></TD>
</TR>
<TR>
<TD style="WIDTH: 129px" noWrap><asp:label id="Label1" runat="server" Width="112px"> Personel Name</asp:label></TD>
<TD noWrap><asp:textbox id="txtDS_NAME" runat="server" Width="200px" BorderColor="LightSteelBlue" BorderWidth="1px" Height="20px" BorderStyle="Solid"></asp:textbox></TD>
</TR>
<TR>
<TD style="WIDTH: 129px" noWrap></TD>
<TD noWrap>
<asp:checkbox id="chkActive" runat="server" Text="Active"></asp:checkbox></TD>
</TR>
<TR>
<TD style="WIDTH: 129px" noWrap><asp:label id="Label4" runat="server" Width="112px">Temsilci No</asp:label></TD>
<TD noWrap><asp:textbox id="txtTEMSILCI_NO" runat="server" Width="80px" BorderColor="LightSteelBlue" BorderWidth="1px"
Height="20px" BorderStyle="Solid" MaxLength="10"></asp:textbox></TD>
</TR>
<TR>
<TD style="WIDTH: 129px" noWrap><asp:label id="Label2" runat="server" Width="112px">Director (TSM)</asp:label></TD>
<TD noWrap><asp:dropdownlist id="cboID_DIRECTOR" runat="server" Width="200px"></asp:dropdownlist></TD>
</TR>
<TR>
<TD style="WIDTH: 129px" noWrap>
<asp:label id="Label5" runat="server" Width="136px">Expert. (TC)</asp:label></TD>
<TD noWrap>
<asp:dropdownlist id="cboID_EXPERT" runat="server" Width="200px"></asp:dropdownlist></TD>
</TR>
<TR>
<TD style="WIDTH: 129px; HEIGHT: 14px" noWrap>
<asp:label id="Label31" runat="server" Width="88px">Type</asp:label></TD>
<TD noWrap style="HEIGHT: 14px">
<asp:dropdownlist id="cboID_Type" runat="server"></asp:dropdownlist></TD>
</TR>
<TR>
<TD style="WIDTH: 129px" noWrap>
<asp:label id="Label6" runat="server" Width="88px">Rut</asp:label></TD>
<TD noWrap>
<asp:dropdownlist id="cbo_ID_RT" runat="server"></asp:dropdownlist></TD>
</TR>
</TABLE>
</TD>
</TR>
<TR>
<TD noWrap align="right" style="HEIGHT: 21px"><asp:button id="btnSave" runat="server" Width="65px" Text="Save" CssClass="MY_BUTTON"></asp:button>
<asp:button id="btnCancel" runat="server" Width="65px" Text="Delete" CssClass="MY_BUTTON"></asp:button> <asp:button id="btnDelete" runat="server" Width="65px" Text="Sil" CssClass="MY_BUTTON"></asp:button></TD>
</TR>
<TR>
<TD noWrap align="right" height="20"><asp:label id="lblStatus" runat="server" Height="16px" ForeColor="Red" Font-Bold="True"></asp:label></TD>
</TR>
<TR>
<TD noWrap>
</TD>
</TR>
</TABLE>
<asp:label id="Label29" style="Z-INDEX: 103; POSITION: absolute; TOP: 8px; LEFT: 8px" runat="server"
Width="168px" Height="8px" ForeColor="#0000C0" Font-Bold="True" Font-Size="12pt">Parametreler > Bayi ></asp:label><asp:label id="Label30" style="Z-INDEX: 102; POSITION: absolute; TOP: 8px; LEFT: 184px" runat="server"
Width="200px" Height="8px" ForeColor="#C00000" Font-Bold="True" Font-Size="12pt">Personel / Temsilci Girişi</asp:label><asp:textbox id="hdnID" style="Z-INDEX: 104; POSITION: absolute; TOP: 8px; LEFT: 472px" runat="server"
Width="33px" BorderColor="LightSteelBlue" BorderWidth="1px" BorderStyle="Solid" Visible="False"></asp:textbox>
<cc1:modalpopupextender ID="mdlDelete" runat="server"
PopupControlID="pnlDelete" BackgroundCssClass="modalBackground" OkControlID="btnDeleteOk" CancelControlID="btnDeleteCancel"
TargetControlID="btnDelete">
</cc1:modalpopupextender>
<asp:Panel ID="pnlDelete" runat="server" CssClass="modal-dialog" style="display:none">
<div class="frame">
<div class="container">
<div class="header">
<div class="msg">Warning</div>
<asp:LinkButton ID="LinkButton1" runat="server" CssClass="close" OnClientClick="$find('mdlDelete').hide(); return false;" />
</div>
<div class="body">
<h2>Are u sure?h2>
</div>
<div class="footer">
<div class="right">
<asp:Button
ID="btnDeleteOk" runat="server" Text="Yes" Width="40px" />
<input id="btnDeleteCancel" type="button" value="No" style="width:40px" />
</div>
</div>
</div>
</div>
</asp:Panel>
</div>
</form>
</body>
Background color: I assume, that only the Frame will be grey. This is OK, since you should not change HTML Code in another Frame.
Position: The Modal Extender calculates the dialog position. So your CSS values are ignored. Use the Property X and Y on the modalpopupextender to set a fixed position.
<cc1:modalpopupextender ID="mdlDelete" runat="server"
PopupControlID="pnlDelete" BackgroundCssClass="modalBackground"
OkControlID="btnDeleteOk" CancelControlID="btnDeleteCancel"
TargetControlID="btnDelete" X="10" Y="10" />
OK,i solved my problem.I am migrating my project from 2003 to 2008.I copied my page to 2008,not created new page.So when i create new page in 2008,page runs without problem.

Resources