Insert into database not fire using Jquery in asp.net - 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.....

Related

ModalPopupExtender dosenot show up and display blank page

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.

ASP ImageButton in Repeater not firing

I have a usercontrol that contains a repeater. Within this repeater there is an ImageButton, that when clicked is supposed to call an expand method. However, the ImageButton is not firing anything, not even a PostBack.
AutoEventWireUp on the usercontrol is set to true. the Repeater ItemDataBound is set in Markup. But even with all of that the ImageButton still will not fire any type of action.
What would be the reason that no firing is occuring at all?
Below is the HTML Markup:
<%# Control Language="vb" AutoEventWireup="true" Codebehind="BiddersGroupList.ascx.vb"
Inherits="FXWB.BidPackage.BiddersGroupList" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
<%# Register TagPrefix="fxwb" TagName="GridLabel" Src="~/Secure/Controls/GridLabel.ascx" %>
<telerik:RadCodeBlock ID="rcbScripts" runat="server">
<script>
function pb(ctrl,FolderId, B, BID, CID)
{
// debugger;
var lblid = ctrl.parentElement.parentElement.cells[7].childNodes[0].id;
SethdnUpdatedValues(lblid, (B=='WB') ? 'Yes' : 'No');
NoRefreshRequestProcessor_SendRequest('changeBidStatus:'+B+':'+BID+':'+CID);
}
function ir(ctrl,FolderId, BID, CID)
{
debugger;
if(ctrl.checked ==true)
B = '1';
else
B = '0';
NoRefreshRequestProcessor_SendRequest('changeAdminIsRceived:'+B+':'+BID+':'+CID);
}
function pw(BPID, SUID, FID){
var BID ='Owner';
window.open('Bidpackage/ReplyToBid.aspx?BPID='+ BPID + '&SUID='+SUID+'&BID='+BID + '&FID='+ FID + '&a=edit','_blank','height=600,width=800,status=yes,toolbar=no,menubar=no,location=no, scrollbars=yes, resizable = yes');
}
function be(BID, BPID,CSI){
window.open('Bidpackage/EditBidderInfo.aspx?BidderID='+BID+'&BidPackageID='+BPID+'&CSI='+CSI,'bidder_edit','height=550,width=950,status=yes,toolbar=no,menubar=no,location=no, scrollbars=yes, resizable = yes')
}
function one(sender,NID,CsiValue,lblid){
//debugger;
NoteLabelID=lblid;
var url = 'Bidpackage/BidderNoteEdit.aspx?NoteID='+escape(NID)+'&CSI='+CsiValue;
var Top = (screen.availHeight / 2) - 100; //getY(sender) - document.getElementById('FolderBody').scrollTop + 226;
var Left = (screen.availWidth / 2) - 150; //getX(sender) + 280;
var params = 'height=200, width=300, location=0, top='+Top+', left='+Left+', status=0, scrollbars=0, toolbar=0';
var arr=NID.split(':');
window.open(url,'BDR_NOTE_'+escape(arr[0]),params);
//window.open(url,'BDR_NOTE_'+escape(NID.replace(':','_')),params);
//window.open(url,params);
}
function SelectAll(chkMain)
{
//debugger;
var mainchk = chkMain.getAttribute("Division");
var chk = document.documentElement.getElementsByTagName("input");
var i;
for(i=0;i<chk.length; i++)
{
if(chk[i].type=='checkbox')
{
csiChild = chk[i].getAttribute("Division");
if (csiChild != null)
{
if(csiChild == mainchk)
{
if(chkMain.checked == true)
{
chk[i].checked = true;
SelectCodes(chk[i])
}
else
{
chk[i].checked = false;
SelectCodes(chk[i])
}
}
}
}
}
}
function SelectCodes(chkMain)
{
// debugger;
var mainchk = chkMain.getAttribute("CSI");
var chk = document.documentElement.getElementsByTagName("input");
var i;
for(i=0;i<chk.length; i++)
{
if(chk[i].type=='checkbox')
{
csiChild = chk[i].getAttribute("CSI");
if (csiChild != null)
{
if(csiChild == mainchk)
{
if(chkMain.checked == true)
{
chk[i].checked = true;
}
else
{
chk[i].checked = false;
}
}
}
}
}
}
function CheckAllBidders(chkMain)
{
// debugger;
var mainCSI = chkMain.getAttribute("CSI");
var csi;
var csiChild;
var bidder;
var chkChildID;
var chk = document.documentElement.getElementsByTagName("input");
var i;
for(i=0;i<chk.length; i++)
{
if(chk[i].type=='checkbox')
{
// chkChildID = chk[i].id;
// s = chkChildID.indexOf(":");
csiChild = chk[i].getAttribute("CSI");
bidder = chk[i].getAttribute("Bidder");
if (csiChild != null && bidder != null)
{
if(csiChild==mainCSI)
{
// debugger;
if(chkMain.checked == true)
{
chk[i].checked = true;
}
else
{
chk[i].checked = false;
}
}
}
}
}
}
var btnReloadExpandedID = '<%=ButtonReloadExpanded.ClientID %>';
var hdnExpandBidderID = '<%=hdnExpandBidder.ClientID %>';
var btnBindBiddingStatus = '<%=ButtonBindBiddingStatus.ClientID %>';
var btnBindNotes = '<%=ButtonBindNotes.ClientID %>';
var hdnNoteCSI = '<%=hdnNoteCSI.ClientID %>';
var hdnCSIId1 = '<%=hdnCSIId1.ClientID %>';
var hdnExpandCSIs = '<%=hdnCSIIs.ClientID %>';
var NoteLabelID;
</script>
<script>
function BindNote(csivalue1,note)
{
// var ButtonBindNotes1 = document.getElementById(btnBindNotes);
// var HiddenNotesCSI1 = document.getElementById(hdnNoteCSI);
// HiddenNotesCSI1.value = csivalue1;
// ButtonBindNotes1.click();
document.getElementById(NoteLabelID).innerHTML = note;
SethdnUpdatedValues(NoteLabelID,note);
}
function SethdnUpdatedValues(id,value)
{
//debugger;
if (id!=undefined)
{
var hdnUpdatedValues = document.getElementById('<%=hdnUpdatedValues.ClientID %>');
if(hdnUpdatedValues.value!="")
if(hdnUpdatedValues.value.indexOf(id) !=-1)
{
var st = hdnUpdatedValues.value.indexOf(id);
var end = hdnUpdatedValues.value.indexOf("|~|",st);
var valToReplace = hdnUpdatedValues.value.substring(st,end);
var valReplaceBy = id + "=" + value;
hdnUpdatedValues.value = hdnUpdatedValues.value.replace(valToReplace, valReplaceBy);
}
else
hdnUpdatedValues.value = hdnUpdatedValues.value + id + '=' + value + '|~|';
else
hdnUpdatedValues.value = id + '=' + value + '|~|';
}
}
function SetUpdatedValues()
{
//debugger;
try
{
var hdnUpdatedValues = document.getElementById('<%=hdnUpdatedValues.ClientID %>');
if (hdnUpdatedValues.value != "")
{
var values = hdnUpdatedValues.value.split('|~|');
var ctrlValue;
var i;
for(i=0; i<values.length-1;i++)
{
ctrlValue = values[i].split('=');
document.getElementById(ctrlValue[0]).innerHTML = ctrlValue[1];
}
}
}
catch(ex)
{
}
}
</script>
</telerik:RadCodeBlock>
<asp:UpdateProgress ID="UpdateProgress1" runat="server" DynamicLayout="true">
<ProgressTemplate>
<div style="background-color: White; position: absolute; z-index: 10; left: expression((this.offsetParent.clientWidth/2)-(this.clientWidth/2)+this.offsetParent.scrollLeft);
top: expression((this.offsetParent.clientHeight/2)-(this.clientHeight/2)+this.offsetParent.scrollTop);">
<img src="../Images/LoadingIcon.gif" height="80" width="150" />
</div>
</ProgressTemplate>
</asp:UpdateProgress>
<asp:UpdatePanel ID="UpdatePannel1" runat="server">
<ContentTemplate>
<%--<script type="text/javascript" language=javascript>
function ShowData()
{
var trValues = document.getElementById('<%=trRptrDivision.ClientID %>');
trValues.style.visibility="visible";
}
</script>--%>
<asp:HiddenField ID="hdnUpdatedValues" runat="server" />
<script language="javascript">
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
function EndRequestHandler(sender, args)
{
SetUpdatedValues();
}
</script>
<asp:Label ID="lblTestStatus" runat="server"></asp:Label>
<input type="button" id="ButtonReloadExpanded" runat="server" style="display: none;"
value="Reload Expanded" />
<input type="button" id="ButtonBindBiddingStatus" runat="server" style="display: none;"
value="Bind BiddingStatus" />
<input type="button" id="ButtonBindNotes" runat="server" style="display: none;" value="Bind Notes" />
<asp:HiddenField ID="hdnExpandBidder" runat="server" />
<asp:HiddenField ID="hdnNoteCSI" runat="server" />
<asp:HiddenField ID="hdnCSIId1" runat="server" />
<asp:HiddenField ID="hdnCSIIs" runat="server" />
<table border="1" cellpadding="0" cellspacing="0" style="background: skyblue; border-style: solid;
border-width: 1px; border-color: black;" width="100%" id="tblBiddersList">
<tr>
<td colspan="3">
<asp:Label ID="lblError" runat="server" Font-Size="8pt" ForeColor="Red" Font-Bold="True"
EnableViewState="False" Font-Names="Arial"></asp:Label>
</td>
</tr>
<asp:Repeater ID="rptdivision" runat="server" EnableViewState="true" OnItemDataBound="rptdivision_ItemDataBound">
<HeaderTemplate>
<tr>
<td class="MasterHeader">
<asp:Button ID="ButtonExpandCollapse" UseSubmitBehavior="false" runat="server" Text="Expand All" CssClass="button"
CommandName="ExpandCollapse" />
Divisions
</td>
<td class="MasterHeader">
Divisions Description
</td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr style="background-color: #66cc99;">
<td>
<input type="checkbox" id="chkDivision" biddercount='<%#DataBinder.Eval(Container, "DataItem.countBidders")%>'
runat="server" onclick="javascript:SelectAll(this);" />
<%-- <asp:CheckBox ID="chkDivision" runat="server" onclick="javascript:SelectAll(this);" />--%>
<asp:ImageButton runat="server" ID="ImageButton1" CommandName="ExpandDivision" ImageUrl="~/Secure/Images/plus_big.gif" />
<asp:Label ID="lbDivisionName" runat="server" Text='<%#DataBinder.Eval(Container, "DataItem.classifier_name")%>'></asp:Label>
<%-- <asp:HiddenField ID="hfcgroup" runat="server" Value='<%#DataBinder.Eval(Container, "DataItem.csigroup")%>' />--%>
</td>
<td>
<asp:Label ID="Label1" runat="server" Text='<%#DataBinder.Eval(Container, "DataItem.classifier_description")%>'></asp:Label>
</td>
</tr>
<tr class="trup" id="trRptrDivision" runat="server" style="background: white;">
<td>
<asp:Repeater ID="rptrBidPackage" runat="server" OnItemCommand="rptrBidPackage_ItemCommand">
<%--<HeaderTemplate>
<tr>
<td class="MasterHeader">
<asp:Button ID="ButtonExpandCollapse" runat="server" Text="Expand All" CssClass="button"
CommandName="ExpandCollapse" />
CSI Code
</td>
<td class="MasterHeader">
CSI Description
</td>
</tr>
</HeaderTemplate>--%>
<ItemTemplate>
<tr class="trup" style="margin: 0px 0px 0px 0px; height: 0%; display: none" id="trMaster"
runat="server">
<td class="tdupMaster">
<asp:ImageButton runat="server" ID="ImageColapseExpand" CommandName="Expand" CommandArgument='<%#DataBinder.Eval(Container, "DataItem.CSIValue")%>'
ImageUrl="~/Secure/Images/plus_big.gif" />
<b>
<input type="checkbox" id="chkCodes" biddercount='<%#DataBinder.Eval(Container, "DataItem.countBidders")%>'
runat="server" onclick="javascript:SelectCodes(this);" />
<%-- <asp:CheckBox ID="chkCodes" runat="server" onclick="javascript:CheckCodes();" /> --%>
<asp:Label ID="LabelCSI" runat="server" Text='<%#DataBinder.Eval(Container, "DataItem.CSIValue")%>'></asp:Label>
</b>
</td>
<td class="tdupMaster">
<em>
<%#DataBinder.Eval(Container, "DataItem.CSIDesc")%>
</em>
</td>
</tr>
<tr class="trup" id="trRptrBidders" runat="server" style="background: white; display: none">
<td colspan="2">
<table border="1" width="100%" cellpadding="1" cellspacing="1" style="background: #eeeeee;">
<asp:Repeater ID="rptrBidders" runat="server" EnableViewState="true" OnItemDataBound="rptrBidders_ItemCreated">
<HeaderTemplate>
<tr style="background: #cccccc; color: #205f7d; font-weight: bold; font-size: x-small;"
class="DetailHeader">
<td class="DetailHeader" align="right">
<input type="checkbox" id="chkSelectAll" runat="server" onclick="javascript:CheckAllBidders(this);" />
</td>
<td class="DetailHeader">
Action
</td>
<td class="DetailHeader">
Company name
</td>
<td class="DetailHeader">
Contact
</td>
<td class="DetailHeader">
Phone
</td>
<td class="DetailHeader">
Fax
</td>
<td class="DetailHeader">
Email</td>
<td class="DetailHeader">
Will Bid</td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr class="trup" runat="server" id="trBidder">
<td rowspan="2" style="width: 50px;" id="tdCheckBox" align="right">
<asp:Label runat="server" ID="lblIsReceived" Text="+" Font-Bold="true" Visible="false"></asp:Label>
<input type="checkbox" id="chkBidder" runat="server" />
<input type="hidden" runat="server" id="hdnFaxStatus" value='<%#DataBinder.Eval(Container, "DataItem.FaxStatus")%>' />
<input type="hidden" runat="server" id="hdnIsReceived" value='<%#DataBinder.Eval(Container, "DataItem.IsReceived")%>' />
</td>
<td rowspan="2" style="width: 0%;">
<img style="margin: 0px;" onclick="pw('<%#DataBinder.Eval(Container, "DataItem.BidpackageID")%>','<%#DataBinder.Eval(Container, "DataItem.SiteUserID")%>','<%#DataBinder.Eval(Container, "DataItem.FolderID")%>');"
src="Images/tool_preview.gif" alt="View"></img><img style="margin: 0px;" src="Images/BidPackage/tool_bidder_edit.gif"
alt="Edit Bidder Info" onclick="be('<%#DataBinder.Eval(Container, "DataItem.BidderID")%>','<%#DataBinder.Eval(Container, "DataItem.BidpackageID")%>','<%#DataBinder.Eval(Container, "DataItem.CSIs!2!CSI")%>')"></img><img
style="margin: 0px;" src="Images/BidPackage/tool_approve_f2.gif" alt="Will Bid"
onclick="pb(this,'<%#DataBinder.Eval(Container, "DataItem.FolderID")%>','WB','<%#DataBinder.Eval(Container, "DataItem.BidderID")%>','<%#DataBinder.Eval(Container, "DataItem.CsiID")%>');"></img><img
style="margin: 0px;" src="Images/BidPackage/tool_decline_f2.gif" alt="Will Not Bid"
onclick="pb(this,'<%#DataBinder.Eval(Container, "DataItem.FolderID")%>','NB','<%#DataBinder.Eval(Container, "DataItem.BidderID")%>','<%#DataBinder.Eval(Container, "DataItem.CsiID")%>');"></img><asp:CheckBox
ID="chkIsReceived" ToolTip="Admin IsReceived" runat="server" FolderID='<%#DataBinder.Eval(Container, "DataItem.FolderID")%>'
Checked='<%#DataBinder.Eval(Container, "DataItem.AdminIsReceived")%>' />
</td>
<td class="fn">
<input type="hidden" runat="server" id="hdnBidder" value='<%#DataBinder.Eval(Container, "DataItem.BidderID")%>' />
<input type="hidden" runat="server" id="hdnCsiID" value='<%#DataBinder.Eval(Container, "DataItem.CsiID")%>' />
<%#DataBinder.Eval(Container, "DataItem.Organization")%>
</td>
<td class="fn">
<%#DataBinder.Eval(Container, "DataItem.FullName")%>
</td>
<td class="fn">
<nobr>
<%#DataBinder.Eval(Container, "DataItem.Phone")%>
</nobr>
</td>
<td class="fn">
<nobr>
<%#DataBinder.Eval(Container, "DataItem.Fax")%>
</nobr>
</td>
<td class="fn">
<nobr>
<%#DataBinder.Eval(Container, "DataItem.EMail")%>
</nobr>
</td>
<td class="fn">
<asp:Label ID="lblWillBid" runat="server">
<%#DataBinder.Eval(Container, "DataItem.WillBid")%>
</asp:Label>
</td>
</tr>
<tr id="trBidderNote">
<td colspan="6" style="font-size: xx-small; background-color: #FEFEFE; padding: 0px;">
<span id="spanBidderNote" runat="server" class="Note">Note:</span> 
<input type="hidden" runat="server" id="hdnBidderNoteID" value='<%#DataBinder.Eval(Container, "DataItem.BidderNoteID")%>' />
<div style="height: 100%; width: 210px; border: solid 0px gray; display: inline;"
id="note">
<asp:Label ID="lblBidderNote" runat="server">
<%#DataBinder.Eval(Container, "DataItem.BidderNote")%>
</asp:Label>
</div>
   
<%#DataBinder.Eval(Container, "DataItem.Qualifications")%>
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
<%-- <asp:GridView ID="GridViewBidders" runat="server" EnableViewState="true" Visible="false">
</asp:GridView>--%>
</table>
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
</ContentTemplate>
</asp:UpdatePanel>
your repeater is inside the update panel so use trigger of async type like follow:
<Triggers>
<asp:AsyncPostBackTrigger ControlID="imagebtn" EventName="CLICK" />
</Triggers>
And make some changes in repeater's code...
<asp:ImageButton runat="server" ID="ImageColapseExpand" onclick="ImageColapseExpand_Click" CommandArgument='<%#DataBinder.Eval(Container, "DataItem.CSIValue")%>'
ImageUrl="~/Secure/Images/plus_big.gif" />
<b>
Create a click event in code behind like bellow:
protected void ImageColapseExpand_Click(object sender, ImageClickEventArgs e)
{
}
Hope this will work for you......

Display XML with XPath

I just started using XML, and i have a form where the user adds some information, and is saved into an XML, this is the code to do it, it working fine:
<%# Page Language="C#" AutoEventWireup="true"CodeBehind="DatosFinancieros.aspx.cs"
Inherits="Tablero.DatosFinancieros" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%# Import Namespace="System.Xml" %>
<script runat="server">
protected void btnSave_Click(object sender, EventArgs e)
{
string xmlPath = MapPath("Datos/DatosFinancieros.xml");
XmlDocument doc = new XmlDocument();
//Check if the file already exists or not
if (System.IO.File.Exists(xmlPath))
{
doc.Load(xmlPath);
XmlNode DatosNodo = CreateDatosNodo(doc);
//Get reference to the Datos node and append the Datos node to it
XmlNode DatosFinancierosNodo = doc.SelectSingleNode("DatosFinancieros");
DatosFinancierosNodo.AppendChild(DatosNodo);
lblResult.Text = "El documento ha sido actualizado";
}
else
{
XmlNode declarationNode = doc.CreateXmlDeclaration("1.0", "", "");
doc.AppendChild(declarationNode);
XmlNode comment = doc.CreateComment("Este archivo representa un fragmento de lo almacenado");
doc.AppendChild(comment);
XmlNode DatosFinancierosNodo = doc.CreateElement("DatosFinancieros");
XmlNode DatosNodo = CreateDatosNodo(doc);
//Append the datos node to the DatosFinancieros node
DatosFinancierosNodo.AppendChild(DatosNodo);
//Append the DatosFinancieros node to the document
doc.AppendChild(DatosFinancierosNodo);
lblResult.Text = "El documento ha sido creado";
}
doc.Save(xmlPath);
}
XmlNode CreateDatosNodo(XmlDocument doc)
{
XmlNode datosNodo = doc.CreateElement("Datos");
// Add Neta Mensual attribute to the Datos Node
XmlAttribute NetaMensualAttribute = doc.CreateAttribute("NetaMensual");
NetaMensualAttribute.Value = txtNetaMensual.Text;
datosNodo.Attributes.Append(NetaMensualAttribute);
XmlAttribute NetaAcumuladoAttribute = doc.CreateAttribute("NetaAcumulado");
NetaAcumuladoAttribute.Value = txtNetaAcumulado.Text;
datosNodo.Attributes.Append(NetaAcumuladoAttribute);
XmlAttribute MensualAttribute = doc.CreateAttribute("Mensual");
MensualAttribute.Value = txtMensual.Text;
datosNodo.Attributes.Append(MensualAttribute);
XmlAttribute AcumuladoAttribute = doc.CreateAttribute("Acumulado");
AcumuladoAttribute.Value = txtAcumulado.Text;
datosNodo.Attributes.Append(AcumuladoAttribute);
XmlAttribute LiquidezAttribute = doc.CreateAttribute("Liquidez");
LiquidezAttribute.Value = txtLiquidez.Text;
datosNodo.Attributes.Append(LiquidezAttribute);
XmlAttribute AccionMensualAttribute = doc.CreateAttribute("AccionMensual");
AccionMensualAttribute.Value = TextAccionMensual.Text;
datosNodo.Attributes.Append(AccionMensualAttribute);
XmlAttribute AccionAcumuladaAttribute = doc.CreateAttribute("AccionAcumulada");
AccionAcumuladaAttribute.Value = TextAccionAcumulada.Text;
datosNodo.Attributes.Append(AccionAcumuladaAttribute);
return datosNodo;
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table>
<tr>
<td colspan="2" style="width: 200px; height: 40px">
<b style="font-size: x-large">Datos Financieros</b>
</td>
</tr>
<tr>
<td colspan="2" style="width: 174px; height: 40px">
<b>Utilidad Neta/Capital</b>
</td>
</tr>
<tr>
<td style="width: 101px; height: 44px">
Mensual:
</td>
<td style="width: 204px; height: 44px">
<asp:TextBox ID="txtNetaMensual" runat="server" Width="201px"></asp:TextBox>
</td>
</tr>
<tr>
<td style="width: 101px; height: 44px">
Acumulado:
</td>
<td style="width: 204px; height: 44px">
<asp:TextBox ID="txtNetaAcumulado" runat="server" Width="201px"></asp:TextBox>
</td>
</tr>
<tr>
<td colspan="2" style="width: 174px; height: 40px">
<b>Utilidad Neta/Ventas</b>
</td>
</tr>
<tr>
<td style="width: 101px; height: 41px">
Mensual:
</td>
<td style="width: 204px; height: 41px">
<asp:TextBox ID="txtMensual" runat="server" Width="201px"></asp:TextBox>
</td>
</tr>
<tr>
<td style="width: 101px; height: 41px">
Acumulado:
</td>
<td style="width: 204px; height: 41px">
<asp:TextBox ID="txtAcumulado" runat="server" Width="201px"></asp:TextBox>
</td>
</tr>
<tr>
<td style="width: 101px; height: 41px">
Liquidez:
</td>
<td style="width: 204px; height: 41px">
<asp:TextBox ID="txtLiquidez" runat="server" Width="201px"></asp:TextBox>
</td>
</tr>
<tr>
<td colspan="2" style="width: 174px; height: 40px">
<b>Acción</b>
</td>
</tr>
<tr>
<td style="width: 101px; height: 41px">
Mensual:
</td>
<td style="width: 204px; height: 41px">
<asp:TextBox ID="TextAccionMensual" runat="server" Width="201px"></asp:TextBox>
</td>
</tr>
<tr>
<td style="width: 101px; height: 41px">
Acumulada:
</td>
<td style="width: 204px; height: 41px">
<asp:TextBox ID="TextAccionAcumulada" runat="server" Width="201px"></asp:TextBox>
</td>
</tr>
<tr>
<td colspan="2" style="width: 101px; height: 41px">
<asp:Button Text="Guardar" runat="server" ID="btnSave" Width="95px" OnClick="btnSave_Click" />
</td>
</tr>
<tr>
<td colspan="2" style="width: 101px; height: 41px">
<asp:Label Text="Guardar" runat="server" ID="lblResult" Width="295px" />
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
Now, i want to display that information on this form, i have this made, is running. doesn't give me any errors but doesn't display anything, just the blank screen:
<body>
<form id="form1" runat="server">
<div>
<asp:XmlDataSource ID="XmlDataSource1" runat="server" XPath="datos" DataFile="Datos/DatosFinancieros.xml" />
<asp:FormView ID="FormView1" runat="server" DataSourceID="XmlDataSource1">
<ItemTemplate>
<hr />
<asp:Repeater ID="Repeater1" runat="server" DataSource='<%# XPathSelect("datos") %>'>
<ItemTemplate>
Neto Mensual:
<%# XPath("NetaMensual") %>
<br />
Neta Acumulado:
<%# XPath("NetaAcumulado") %>
<br />
<hr />
</ItemTemplate>
</asp:Repeater>
</ItemTemplate>
</asp:FormView>
</div>
</form>
Anyone has an idea what i'm doing wrong so the information isn't displayed??? Sorry for the long post but is to give a better idea of what i'm doing!
Look at the source code for your screen and see if the XML is appearing.
If it does appear, then the problem is that HTML is a variant of XML and browsers interpret anything with XML-style tags as markup rather than info.
You need to HTML-encode your XML within the <%# %> tags.
<%# Server.HtmlEncode(XPath(xyz)) %>

#include file vs iframe or is there a better way [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
ok simple question about including large mostly static html and asp.net code I am using as of right now #include and I was wondering if iframes would be a better way of handling what I wish to do or is there a better way to do it. here is the current way i'm handling the includes
default.aspx
<%# Page Language="C#" AutoEventWireup="true" ValidateRequest="false" %>
<%# Import Namespace="YAF.Classes.Core" %>
<script runat="server">
protected void Page_Load(object sender, System.EventArgs e)
{
btnSearch.Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(btnSearch, "") + ";this.disabled = true;");
if (forum.PageUserID != 1)
{
Page.FindControl("divGuest").Visible = false;
Page.FindControl("divUser").Visible = true;
lblUserName.Text = forum.PageUserName;
}
else
{
Page.FindControl("divGuest").Visible = true;
Page.FindControl("divUser").Visible = false;
lblUserName.Text = null;
}
}
public void Page_Error(object sender, System.EventArgs e)
{
Exception x = Server.GetLastError();
YAF.Classes.Data.DB.eventlog_create(YafServices.InitializeDb.Initialized ? (int?)YafContext.Current.PageUserID : null, this, x);
YAF.Classes.Core.CreateMail.CreateLogEmail(x);
}
protected void btnSearch_Click(object sender, EventArgs e)
{
if (txtSearch.Text.Length > 4)
{
if(ddlCriteria.SelectedValue == "Posts")
Response.Redirect("default.aspx?g=search&search=" + txtSearch.Text);
if(ddlCriteria.SelectedValue == "Posted By")
Response.Redirect("default.aspx?g=search&postedby=" + txtSearch.Text);
}
}
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="YafHead" runat="server">
<meta id="YafMetaDescription" runat="server" name="description" content="Yet Another Forum.NET -- A bulletin board system written in ASP.NET" />
<meta id="YafMetaKeywords" runat="server" name="keywords" content="Yet Another Forum.net, Forum, ASP.NET, BB, Bulletin Board, opensource" />
<title>Forums</title>
<style type="text/css">
.sbutton
{
background-color:#361800;
border:medium none;
border-collapse:collapse;
color:#FFFFFF;
font-family:Tahoma,Arial,Helvetica;
font-size:10px;
font-weight:bold;
vertical-align:middle;
}
</style>
<link href="images/favicon.ico" type="image/ico" rel="shortcut icon" />
<link rel="stylesheet" href="navTopStyle.css" type="text/css" media="screen" />
</head>
<body style="margin: 0">
<form id="form1" runat="server" enctype="multipart/form-data">
<table align="center" style="background-color: #ffffff" cellpadding="0" cellspacing="0"
width="790px">
<tr>
<td>
<!--#include file="CComHeader.html"-->
</td>
</tr>
<tr>
<td>
<YAF:Forum runat="server" ID="forum"></YAF:Forum>
</td>
</tr>
</table>
</form>
</body>
</html>
CComHeader.html
<table cellpadding="0" cellspacing="0" width="790px">
<tr>
<td align="left">
<img src="images/smokechair.jpg" alt="Cigar.com" /><img src="images/cigarcomTitle.gif"
alt="Cigar.com" />
</td>
<td align="right">
<table width="310px" height="73px" cellpadding="0" cellspacing="0" style="padding-right: 6px">
<tr>
<td width="109px" class="welcome" align="left">
Welcome to Cigar.com
</td>
<td width="195px" class="welcome" align="left">
<div runat="server" id="divUser">
<table cellpadding="0" cellspacing="0" align="right">
<tr>
<td width="126px" align="left">
<asp:Label ID="lblUserName" CssClass="welcome" runat="server"></asp:Label></td>
<td width="65px" align="left">
Help</td>
</tr>
</table>
</div>
<div runat="server" id="divGuest">
Sign In | Join |
Help
</div>
</td>
</tr>
<tr>
<td colspan="2">
<table cellpadding="0" cellspacing="0" >
<tr>
<td width="234px" align="right">
<asp:DropDownList ID="ddlCriteria" runat="server">
<asp:ListItem>Posts</asp:ListItem>
<asp:ListItem>Posted By</asp:ListItem>
</asp:DropDownList>
<asp:TextBox Width="120px" ID="txtSearch" runat="server"></asp:TextBox>
</td>
<td width="70px" align="center">
<asp:Button ID="btnSearch" runat="server" Text="Search" CssClass="sbutton" OnClick="btnSearch_Click" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2">
<!--#include file="commonTabBar.html" -->
</td>
</tr>
</table>
commonTabBar.html
<div class="CommonTabBar">
<script language="javascript">
function tabOver(e) {
if (e.className != 'CommonSimpleTabStripSelectedTab')
e.className = 'CommonSimpleTabStripTabHover';
}
function tabOut(e) {
if (e.className != 'CommonSimpleTabStripSelectedTab')
e.className = 'CommonSimpleTabStripTab';
}
function tabOverSub(e) {
if (e.className != 'CommonSimpleTabStripSelectedTabSub')
e.className = 'CommonSimpleTabStripTabHoverSub';
}
function tabOutSub(e) {
if (e.className != 'CommonSimpleTabStripSelectedTabSub')
e.className = 'CommonSimpleTabStripTabSub';
}
</script>
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr valign="middle">
<td class="CommonSimpleTabStripTab" style="padding: 0px">
</td>
<td class="CommonSimpleTabStripTab" onmouseover="tabOver(this);" onmouseout="tabOut(this);"
onclick="window.location = 'http://www.cigar.com/index.asp'">
<a style="float: right; display: block; height: 30px; line-height: 30px; padding-left: 12px;
padding-right: 12px; vertical-align: middle;" href="http://www.cigar.com/index.asp">
Home</a>
</td>
<td class="CommonSimpleTabStripTab" onmouseover="tabOver(this); document.getElementById('ComDropDown2').style.display = 'inline';"
onmouseout="tabOut(this); document.getElementById('ComDropDown2').style.display = 'none';">
<a style="float: right; display: block; height: 30px; line-height: 30px; padding-left: 12px;
padding-right: 12px; vertical-align: middle;" href="http://www.cigar.com/cigars/index.asp">
Cigars</a>
<div id="ComDropDown2" style="border: 1px solid rgb(71, 42, 24); margin: 28px 0px 0px;
display: none; background-color: rgb(235, 230, 208); color: rgb(71, 42, 24);
position: absolute; float: left; z-index: 200;" onmouseover="document.getElementById('ComDropDown2').style.display = 'inline';"
onmouseout="document.getElementById('ComDropDown2').style.display = 'none';">
<ul style="margin: 0px; padding: 0px; width: 100px;">
<li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left;
list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); "
onclick="window.location = 'http://www.cigar.com/cigars/index.asp'"><a href="http://www.cigar.com/cigars/index.asp"
style="line-height: 25px; color: rgb(71, 42, 24);" id="BrandsLink">Brands </a>
</li>
<li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left;
list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); "
onclick="window.location = 'http://www.cigar.com/cigars/privatelabel.asp?brand=419'">
<a href="http://www.cigar.com/cigars/privatelabel.asp?brand=419" style="line-height: 25px;
color: rgb(71, 42, 24);" id="SamplersLink">Aging Room </a></li>
<li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left;
list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); "
onclick="window.location = 'http://www.cigar.com/cigars/samplers.asp'"><a href="http://www.cigar.com/cigars/samplers.asp"
style="line-height: 25px; color: rgb(71, 42, 24);" id="SamplersLink">Samplers
</a></li>
<li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left;
list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); "
onclick="window.location = 'http://www.cigar.com/cigars/suggestions.asp'"><a href="http://www.cigar.com/cigars/suggestions.asp"
style="line-height: 25px; color: rgb(71, 42, 24);" id="SuggestionsLink">Suggestions
</a></li>
<li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left;
list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); "
onclick="window.location = 'http://www.cigar.com/DailyDeal/ccCigarDeals.asp'"><a
href="http://www.cigar.com/DailyDeal/ccCigarDeals.asp" style="line-height: 25px;
color: rgb(71, 42, 24);" id="SuggestionsLink">Suggestions </a></li>
</ul>
</div>
Redid the example I was trying to make this into a UC but I ran into a problem with the server script and it not allowing me to obfuscate it more.
There's no reason to use IFRAMEs in this scenario. Their disadvantages are:
They are fixed in size
They don't count for the SEO on your page
You can't access the DOM for items in them (to do scripting)
So I would "include" a file. With ASP.NET your best bet is User Controls or Master Pages.
Using an iframe will cause the client browser to make another HTTP request in order to retrieve its contents. Unless you have a really specific need (like sticking your code into someone else's website) you probably never want to use an iframe.
I don't really see the point of iframes, but I'm open to suggestion. If you need dynamic content, you can use AJAX and normal divs. If your server for some reason needs to include content from another domain or server, you can use curl.

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