I have an old site that I am trying to take down, but before I do I need to export all the data. The original site design includes an ASP file that is designed to take the data from the database tables and compile them into an excel file, but when you click on the link on the site, all it does is download the ASP file (it also only does that on IE or Edge not Chrome).
The code is below, any help making this work would be appreciated. I have done many searches and tried many suggestions but none have worked.
<% Response.ContentType = "application/vnd.ms-excel"%>
<head>
<style type="text/css">
.style1 {
text-align: left;
}
</style>
</head>
<!--#include file="../../low/connectDB.asp"-->
<!--#include file="../../low/functions.inc"-->
<body style="margin: 0">
<table style="width: 100%" cellpadding="4" cellspacing="0">
<tr>
<td colspan="10"><strong>Lake of the Woods Association, Inc.</strong></td>
</tr>
<tr>
<td colspan="10"><strong>Schedule of Those Who Have Passed the LOWA Boat Certification
Course</strong></td>
</tr>
<tr>
<td colspan="10"><strong>As of <%=date%></strong></td>
</tr>
<tr>
<td style="width: 150"><strong>Type</strong></td>
<td style="width: 250"><strong>First Name</strong></td>
<td style="width: 250"><strong>Last Name</strong></td>
<td style="width: 250"><strong>Address</strong></td>
<td style="width: 120"><strong>Lot</strong></td>
<td style="width: 120"><strong>Section</strong></td>
<td style="width: 120"><strong>Course</strong></td>
<td style="width: 120"><strong>VA Boat Id</strong></td>
<td style="width: 120"><strong>Minutes</strong></td>
<td style="width: 120"><strong>Grade</strong></td>
<td style="width: 120"><strong>Status</strong></td>
</tr>
<% tottimes=1
Set DB1 = Server.CreateObject("ADODB.Connection")
DB1.Open(lowdbstring)
Set RS1 = DB1.Execute ("SELECT * FROM course_applicants WHERE passfail = 'pass' ORDER BY MID ASC, grade DESC, ID DESC")
Do until RS1.EOF
IF LSTMID<>RS1("MID") THEN
ncount=ncount+1
IF RS1("test_id") = "2" THEN
course="Short"
ELSE
course="Long"
END IF
Set RS0 = DB1.Execute ("SELECT * FROM members WHERE ID = '"& RS1("MID") &"'")
Do until RS0.EOF
IF RS0("mtype") = "G" THEN
mt="Guest"
ELSE
mt="Member"
END IF
%>
<tr>
<td style="width: 150"><%=mt%></td>
<td style="width: 250"><%=RS0("fname")%></td>
<td style="width: 250"><%=RS0("lname")%></td>
<td style="width: 250"><%=RS0("address1")%></td>
<td style="width: 120"><%=RS0("lot")%></td>
<td style="width: 120"><%=RS0("section")%></td>
<td style="width: 120"><%=course%></td>
<td class="style1" style="width: 120"><%=RS1("VBcustID")%></td>
<td class="style1" style="width: 120"><%=RS1("tottesttime")%></td>
<td class="style1" style="width: 120"><%=FormatPercent(RS1("grade"),0)%></td>
<td class="style1" style="width: 120"><%=RS1("passfail")%></td>
</tr>
<%
RS0.MoveNext
loop
RS0.Close
tottimes=1
LSTMID=RS1("MID")
ELSE
tottimes=tottimes+1
END IF
RS1.MoveNext
loop
RS1.Close
DB1.Close
%>
</table>
Try this at the top of your page
<%
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-Disposition", "attachment; filename=whatever-you-want-to-call-it.xls"
%>
I should add that if you're using Chrome it will ask you for loads of permissions before it launches the file in Excel
I know this doesn't solve the original problem, but I found a workaround. The site has a search engine with a three character minimum and I found that if I put in three underscores (SQL wildcards) then I could pull up all the info that I need onto the search results page and I could then copy and paste into excel.
Thanks for your help.
i use datatable export to ms excel
try these pages.
https://datatables.net/extensions/buttons/examples/initialisation/export.html
I am having trouble validating the use inputs once the calculate button is clicked. Any help would be greatly appreciated. All text fields must be validated using the Validation Controls and should include a summary to show errors. I would like the error messages to appear in my lblMessage.Text but nothing is showing once Calculate is clicked. (SIDE NOTE: I also cannot get my Clear button to reset the textboxes to NULL. Help with that would be great too)
HTML
<body>
<form id="form1" runat="server">
<div>
<img src="images/header.jpg" alt="Get Fit" title="GetFit" width="100%"/>
</div>
<h1>Body Mass Index Calculator</h1>
<table align="center">
<tr>
<td class="auto-style4">Enter your first name:</td>
<td class="auto-style6">
<asp:TextBox ID="txtName" runat="server" TabIndex="1"></asp:TextBox>
</td>
<td class="auto-style5"> </td>
<td class="auto-style7"> </td>
</tr>
<tr>
<td class="auto-style4">Enter your age:
</td>
<td class="auto-style6">
<asp:TextBox ID="txtAge" runat="server" TabIndex="2"></asp:TextBox>
</td>
<td class="auto-style5">
</td>
<td class="auto-style7">
<asp:CompareValidator ID="cv" runat="server" ControlToValidate="txtAge" Type="Integer" Operator="DataTypeCheck" ErrorMessage="Enter a valid age" >*</asp:CompareValidator>
</td>
</tr>
<tr>
<td class="auto-style4">Enter your email:
</td>
<td class="auto-style6">
<asp:TextBox ID="txtEmail" runat="server" TabIndex="3"></asp:TextBox>
</td>
<td class="auto-style5">
</td>
<td class="auto-style7">
<asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" ControlToValidate="txtEmail" Display="Dynamic" ErrorMessage="Enter a valid email" ValidationExpression="\w+([-+.']\w+)*#\w+([-.]\w+)*\.\w+([-.]\w+)*">*</asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td class="auto-style4">Enter your height:
</td>
<td class="auto-style6">
<asp:TextBox ID="txtHeight" runat="server" TabIndex="4"></asp:TextBox>
</td>
<td class="auto-style5">
<asp:Label ID="lblHeight" runat="server" Text="INCHES"></asp:Label>
</td>
<td class="auto-style7">
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtHeight" Display="Dynamic" ErrorMessage="You must enter a valid height">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="auto-style4">Enter your weight:</td>
<td class="auto-style6">
<asp:TextBox ID="txtWeight" runat="server" TabIndex="5"></asp:TextBox>
</td>
<td class="auto-style5">
<asp:Label ID="lblWeight" runat="server" Text="POUNDS"></asp:Label>
</td>
<td class="auto-style7">
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtWeight" Display="Dynamic" ErrorMessage="You must enter a valid weight">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td colspan="4">
<asp:Label ID="lblMessage" runat="server" Text="Label"></asp:Label>
</td>
</tr>
</table>
<br />
<table align="center">
<tr>
<td class="auto-style2">
<asp:Button ID="btnCalculate" runat="server" Text="Calculate BMI" align="center" TabIndex="6"/>
<span style="color:darkblue;">|</span>
<asp:Button ID="btnCancel" runat="server" Text="Cancel" align="center" TabIndex="7"/>
</td>
</tr>
</table>
<br />
<table align="center">
<tr>
<td>
<h1>Your BMI:</h1>
</td>
</tr>
<tr>
<td>
<asp:TextBox ID="txtBMI" runat="server" ReadOnly="True" TabIndex="8"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<h2>This means you are:
</h2>
</td>
</tr>
<tr>
<td>
<asp:TextBox ID="txtResults" runat="server" ReadOnly="True" TabIndex="9"></asp:TextBox>
</td>
</tr>
</table>
</form>
</body>
ASPX.VB
Partial Class _Default
Inherits System.Web.UI.Page
Public Sub ClearAll()
txtName.Text = ""
txtAge.Text = ""
txtEmail.Text = ""
txtHeight.Text = ""
txtWeight.Text = ""
End Sub
Protected Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click
ClearAll()
'txtName.Text = String.Empty
'txtAge.Text = String.Empty
'txtEmail.Text = String.Empty
End Sub
Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click
Calculate()
End Sub
Public Sub Calculate()
'Name
If txtName.Text = String.Empty Then
lblMessage.Text = "Please enter a name."
Else
End If
'Age
If txtAge.Text = String.Empty Then
lblMessage.Text = "Please enter an age."
Else
End If
'Email
If txtEmail.Text = String.Empty Then
lblMessage.Text = "Please enter an email."
Else
End If
'Height
If txtHeight.Text = String.Empty Then
lblMessage.Text = "Please enter a height."
Else
End If
'Weight
If txtWeight.Text = String.Empty Then
lblMessage.Text = "Please enter a height."
Else
End If
Dim Result As Double ' Declare "Result" as a Double.
Dim Rounded_Result As Double
Result = txtWeight.Text / (txtHeight.Text * txtHeight.Text) * 703 ' BMI Calculation.
Rounded_Result = Math.Round(Result, 1) ' Round result to 1 decimal place.
txtBMI.Text = Rounded_Result.ToString ' Display BMI using lblBMI.
BMI_Message(Rounded_Result) 'Send Rounded BMI result to Sub BMI_Message.
End Sub
Public Sub BMI_Message(ByVal BMI_Value As Double)
Select Case BMI_Value
Case 0.0 To 18.5
txtResults.Text = "Underweight"
Case 18.6 To 24.9
txtResults.Text = "Normal Weight"
Case 25.0 To 29.9
txtResults.Text = "Overweight"
Case Is >= 30.0
txtResults.Text = "Obese"
Case Else
txtResults.Text = "Unable to Determin BMI"
End Select
End Sub
End Class
I've been working on a site using Classis ASP for a while (on my own personal server) however I've hit a stumbling block. I'm trying to get paging to work but for some reason nothing shows up on the pages, I cannot fathom it at all.
Basically the site is an advertisement board, on one page it shows the total of each item type, click on that and it shows those items but pages them.
<%
If (Request.QueryString("type") <> "" ) Then
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "select s.Unique_ID, s.Location,s.Extension,s.Item,s.Description,s.Price,s.Date_On_Sale,s.Type, s.Name, s.Date_Posted " & _
" from tblSales s where Lower(s.Type) = Lower('" & Request.QueryString("type") & "')" , objconn, 3, 3
If (rs.BOF or rs.EOF) Then StrMsg = "<font color='red'> <b> System found no results for <u> " & Request.QueryString("type") & " </u> </b></font>"
End If
%>
<%response.Write(strQuery) %>
<div id="midrow" style="clear:both;">
<div class="center">
<p>To view the details of an item, simply click on desired item</p>
</div>
</div>
<div class="board_bottomrow">
<div class="center">
<% If StrMsg <> "" Then
Response.Write(StrMsg)
Else
Dim bShowPages
rs.PageSize = 20
nPageCount = rs.PageCount
If nPageCount <2 Then
bShowPages = false
Else bShowPages = true
End If
nPage = CLng(Request.QueryString("Page"))
If (Request.QueryString("Page") = "") Then nPage = 1
If nPage < 1 Or nPage > nPageCount Then
nPage = 1
End If
item_type = Request.QueryString("type")
rs.AbsolutePage = nPage
%>
<div> <b> <%= Request.QueryString("type") %> Items </b> </div>
<br>
<table class="table_border" cellpadding="5" cellspacing="5" border="0" style="width:950px" id="items" >
<thead>
<th style="text-align:left"> <b> <font size="2"> Item </font> </b> </th>
<th style="text-align:left"> <b> <font size="2"> Description </font> </b> </th>
<th style="text-align:left;"> <b> <font size="2"> Price </font> </b> </th>
<th style="text-align:left;"> <b> <font size="2"> Posted By </font> </b> </th>
<th style="text-align:left;"> <b> <font size="2"> Extension </font> </b> </th>
<th style="text-align:left;"> <b> <font size="2"> Posted On </font> </b> </th>
</thead>
<tbody>
<%
Response.Write(rs.AbsolutePage)
While Not (rs.Eof Or rs.AbsolutePage <> nPage) %>
<tr style="vertical-align:top">
<td> <a href='Board_Item.asp?link_id=<%=rs("Unique_ID")%>'> <%= rs("Item") %> </a> </td>
<td style="width:350px"> <%= rs("Description") %> </td>
<td style="margin-left:10px"> £ <%= rs("Price") %> </td>
<td> <%= rs("Name") %> </td>
<td> <%= rs("Extension") %> </td>
<td> <%= rs("Date_Posted") %> </td>
</tr>
<%
rs.MoveNext()
Wend
'Response.Write ("bShowPages " & bShowPages)
%>
<!-- show pages only if pageCount > 1 -->
<%If bShowPages <> false Then%>
<tr style="background-color:#f1f1f1">
<td> Pages: </td> <td colspan="5">
<a href='Items.asp?type=<%=item_type%>&Page=1'> First </a>
<a href='Items.asp?type=<%=item_type%>&Page=<%=nPage - 1%>'> Prev </a>
<a href='Items.asp?type=<%=item_type%>&Page=<%=nPage + 1%>'> Next </a>
<a href='Items.asp?type=<%=item_type%>&Page=<%=nPageCount%>'> Last </a>
<td> </td>
</tr>
</tbody>
</table>
<%End If%>
<% End If %>
</div>
<br>
Im pretty aware there is some bad coding in the sample, but it's a personal learning project for me at the moment, if anyone can see why this records wouldn't be displaying id be greatful. The pagenumbers all show up, just non of the records. Thanks.
in my asp.net application (VB is server side background) - I have a page that will not run onload or postback server side events. In the local development build, it runs correctly but when published on an amazon EC2 instance the onload doesn't seem to execute, and even though the post back is happening (tested with onload javascript alerts to make sure the post back was happening) - when the dropdown named drpdn_status is changed, the server side function to handle this does not seem to be executing. Can anyone see why this would be happening? Listed below is the page code, followed by the server side on load and the selectedIndexChanged function to handle the change of the dropdown
Page Code
<%# Page Language="vb" AutoEventWireup="false" Codebehind="toDoListModifyEntity_PT.aspx.vb" inherits="iPlan.toDoListModifyEntity_PT" %>
<%# Register TagPrefix="Component" Namespace="components" Assembly="components" %>
<%# Register TagPrefix="UserControl" TagName="ConditionalDetails" Src="../include/ConditionalDetailsPanel.ascx" %>
<%# Register TagPrefix="UserControl" TagName="Deliverable" Src="../include/AttachmentToEntity.ascx" %>
<%# Register TagPrefix="UserControl" TagName="EntityPredecessorsTable" Src="../include/EntityPredListPanel.ascx" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<HEAD>
<title><%=Application("BrowserTitle")%></title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<LINK href="../solutions/DetailScreenTest.css" type="text/css" rel="stylesheet">
<LINK href="../StyleSheet.css" type="text/css" rel="stylesheet">
<!-- includes for: calendar popUp -->
<script language="JavaScript" src="../include/calendar.vRef.NET.js"></script>
<script language="JavaScript" src="../include/ShowHelp.js"></script>
<LINK href="../include/calendar.blueIce.css" type="text/css" rel="stylesheet">
<LINK rel="stylesheet" type="text/css" href="../Styles.css">
</HEAD>
<body>
<form id="Form2" method="post" runat="server">
<table cellSpacing="0" cellPadding="0" width="100%" border="0">
<tr>
<td class="pageHeader">Update this Task</td>
</tr>
</table>
<div class="hideforprint" style="HEIGHT: 30px">
<table cellSpacing="0" cellPadding="0" width="100%" border="0">
<tr>
<td></td>
<td align="right"><IMG style="CURSOR: hand" onclick="showHelp('../', 'pendingtasks.htm')" alt="Help on Detail Screen"
src="../images/helpdashboard.gif"></td>
<!--
<td align="right" width="1%"><img onclick="window.parent.execScript('ToggleDetailDivSize()'); if (this.action == 'max') {this.action='restore'; this.src = '../images/bigRestore.gif'; this.alt='Restore Detail Screen';} else {this.action='max'; this.src = '../images/bigMax.gif'; this.alt='Maximize Detail Screen';}"
action="max"
alt="Maximize Detail Screen"
src="../images/bigMax.gif"
style="cursor: hand" ></td>
-->
<td align="right" width="1%"><IMG style="CURSOR: hand" onclick="window.parent.execScript('ToggleDetailDiv()')" alt="Close Detail Screen"
src="../images/BigX.gif"></td>
</tr>
</table>
</div>
<!-- START nav buttons-->
<div class="hideforprint">
<table cellSpacing="0" cellPadding="0" width="100%" border="0">
<tr>
<td class="pageHeader">
<table id="navControl_tlbNav" border="0">
<tr>
<!--
<td class="infotext2" valign="Top" style="width:50px;"><img onmouseover="imgOv(this, '../images/task.gif')" onmouseout="imgOu(this, '../images/task_over.gif')" onclick="imgclick('../tasks/modifytask.aspx', '&mode=create', 13)" src="../images/task_over.gif" border="0" style="cursor:hand;" /><br> Create Task</td>
<td class="infotext2" valign="Top" style="width:50px;"><img onmouseover="imgOv(this, '../images/Milestone.gif')" onmouseout="imgOu(this, '../images/Milestone.gif')" onclick="imgclick('../tasks/MilestoneLinking.aspx', '&mode=create&milestone=true', 13)" src="../images/Milestone.gif" border="0" style="cursor:hand;" /><br>Create Milestone</td>
<td class="infotext2" valign="Top" style="width:50px;"><img onmouseover="imgOv(this, '../images/modify.gif')" onmouseout="imgOu(this, '../images/modify_over.gif')" onclick="imgclick('../tasks/modifytask.aspx', '&mode=edit', 13)" src="../images/modify_over.gif" border="0" style="cursor:hand;" /><br>Modify Task</td>
<td class="infotext2" valign="Top" style="width:50px;"><img onmouseover="imgOv(this, '../images/delete.gif')" onmouseout="imgOu(this, '../images/delete_over.gif')" onclick="imgclick('../tasks/deletetask.aspx', '', 13)" src="../images/delete_over.gif" border="0" style="cursor:hand;" /><br>Delete Task</td>
-->
<td class="infotext2" style="WIDTH: 50px" vAlign="top"><IMG onmouseover="imgOv(this, '../images/attachfile.gif')" style="CURSOR: hand" onclick="imgclick('../listing/attachments.aspx', '', 13)"
onmouseout="imgOu(this, '../images/attachfile_over.gif')" src="../images/attachfile_over.gif" border="0"><br>
Attach Files</td>
<td class="infotext2" style="WIDTH: 50px" vAlign="top"><IMG onmouseover="imgOv(this, '../images/DetailsScreenNotes_over.gif')" style="CURSOR: hand"
onclick="imgclick('../notesforum/EntityNotes.aspx', '', 13)" onmouseout="imgOu(this, '../images/DetailsScreenNotes.gif')" src="../images/DetailsScreenNotes.gif"
border="0"><br>
Notes</td>
<td class="infotext2" style="WIDTH: 50px" vAlign="top"><IMG onmouseover="imgOv(this, '../images/PrintDetailsPage_over.gif')" style="CURSOR: hand"
onclick="imgclick('print', '', 13)" onmouseout="imgOu(this, '../images/PrintDetailsPage.gif')" src="../images/PrintDetailsPage.gif"
border="0"><br>
Print Details</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<!-- END nav buttons-->
<!-- START NOTICES task predecessor list -->
<asp:Panel ID="pnl_msg_predecessorsInSameAction" Runat="server" Visible="False">
<TABLE border="0" cellSpacing="0" cellPadding="0" height="1">
<TR class="detailHeader" height="1">
<TD height="1" width="10"> </TD>
<TD height="1" width="200">Notice</TD>
<TD height="1"><IMG src="../images/whiteslant.gif" height="15"></TD>
</TR>
</TABLE>
<TABLE class="detailTable" cellSpacing="0" cellPadding="4" width="100%">
<TR class="detailRow">
<TD class="detailLabel"><IMG src="../images/yellow-exclamation-sign.gif"></TD>
<TD class="detailLabel">This task is <SPAN class="DetailsOtherGreyed">grayed-out</SPAN>
pending the completion of the following predecessor Tasks. If this Task is
updated, future status updates will be restricted until the Project Manager
takes action.</TD>
</TR>
</TABLE>
</asp:Panel>
<asp:Panel ID="pnl_msg_predecessorsActionLinked" Runat="server" Visible="False">
<TABLE border="0" cellSpacing="0" cellPadding="0" height="1">
<TR class="detailHeader" height="1">
<TD height="1" width="10"> </TD>
<TD height="1" width="200">Notice</TD>
<TD height="1"><IMG src="../images/whiteslant.gif" height="15"></TD>
</TR>
</TABLE>
<TABLE class="detailTable" cellSpacing="0" cellPadding="4" width="100%">
<TR class="detailRow">
<TD class="detailLabel"><IMG src="../images/yellow-exclamation-sign.gif"></TD>
<TD class="detailLabel">This task is <SPAN class="DetailsOtherGreyed">grayed-out</SPAN>
pending the completion of the following predecessor Actions. If this Task is
updated, future status updates will be restricted until the Administrator takes
action.</TD>
</TR>
</TABLE>
</asp:Panel>
<!-- END NOTICES task predecessor list -->
<!-- START NOTICES Status Marked Early -->
<asp:Panel ID="pnl_msg_earlyProgressAlreadyMarked_notifiedPM" Runat="server" Visible="False">
<TABLE border="0" cellSpacing="0" cellPadding="0" height="1">
<TR class="detailHeader" height="1">
<TD height="1" width="10"> </TD>
<TD height="1" width="200">Notice</TD>
<TD height="1"><IMG src="../images/whiteslant.gif" height="15"></TD>
</TR>
</TABLE>
<TABLE class="detailTable" cellSpacing="0" cellPadding="4" width="100%">
<TR class="detailRow">
<TD class="detailLabel"><IMG src="../images/yellow-exclamation-sign.gif"></TD>
<TD class="detailLabel">Status for this Task has been marked and the Project
Manager notified. Future status updates await Project Manager action. Please
contact the PM for further information.</TD>
</TR>
</TABLE>
</asp:Panel>
<asp:Panel ID="pnl_msg_earlyProgressAlreadyMarked_notifiedAdmin" Runat="server" Visible="False">
<TABLE border="0" cellSpacing="0" cellPadding="0" height="1">
<TR class="detailHeader" height="1">
<TD height="1" width="10"> </TD>
<TD height="1" width="200">Notice</TD>
<TD height="1"><IMG src="../images/whiteslant.gif" height="15"></TD>
</TR>
</TABLE>
<TABLE class="detailTable" cellSpacing="0" cellPadding="4" width="100%">
<TR class="detailRow">
<TD class="detailLabel"><IMG src="../images/yellow-exclamation-sign.gif"></TD>
<TD class="detailLabel">Status for this Task has been marked and an Administrator
notified. Future status updates await Administrator action. Please contact the
Administrator for further information.</TD>
</TR>
</TABLE>
</asp:Panel>
<!-- END NOTICES Status Marked Early -->
<!-- START task predecessor list -->
<asp:panel id="pnl_predecessorList" Runat="server" visible="false">
<TABLE border="0" cellSpacing="0" cellPadding="0" height="1">
<TR class="detailHeader" height="1">
<TD height="1" width="10"> </TD>
<TD height="1" width="200">Predecessors</TD>
<TD height="1"><IMG src="../images/whiteslant.gif" height="15"></TD>
</TR>
</TABLE> <!-- <TABLE class="detailTable" id="Table3" cellSpacing="0" cellPadding="4" width="100%"> -->
<UserControl:EntityPredecessorsTable style="BORDER-BOTTOM: red thin solid; BORDER-LEFT: red thin solid; BACKGROUND-COLOR: red; BORDER-TOP: red thin solid; BORDER-RIGHT: red thin solid; cGKattrib: hello chris"
id="usrCntrl_EntityPredecessor" class="detailTable" runat="server" relativePathToImages="../images/" relativePathToRoot="../"
width="100%" displayMode="PredecessorMode"></UserControl:EntityPredecessorsTable>
</asp:panel>
<asp:Label ID="lbl_cGKDebug" Runat="server" Visible="False" />
<script language="VB" runat="server">
Private Sub usrCntrl_EntityPredecessor_EntityHasActionLink() Handles usrCntrl_EntityPredecessor.EntityHasPredecessorsActionLinked
'"../ViewTask.aspx" & Request.QueryString.ToString
lbl_cGKDebug.text += "TESTING JIZZ: ../tasks/ViewTask.aspx?" & Request.QueryString.ToString &" <br />"
'Response.redirect("../tasks/ViewTask.aspx?" & Request.QueryString.ToString )
pnl_predecessorList.Visible = True
'Show user messages (only if global flags for both other early-status-marked notices are not on):
if gbl_bool_earlyStatusAlreadyMarked_notifyAdmin = false and gbl_bool_earlyStatusAlreadyMarked_notifyPM = false then
pnl_msg_predecessorsInSameAction.Visible = False
pnl_msg_predecessorsActionLinked.Visible = True
end if
'Hide Modify Panel, Addt'nl Details
pnl_dynDetails.visible = false
pnl_modifyElements.visible = false
btn_save.Text = "Inform Administrator"
btn_save.visible = false
lbl_btn_save_message.visible = true
lbl_btn_save_message.Text = "You may not save status on this task."
'Change the way the save function behaves:
gbl_bool_predecessorsInOtherActionExist_notifyAdmin = True
End Sub
Private Sub usrCntrl_EntityPredecessor_EntityHasPredecessorsInSameAction() Handles usrCntrl_EntityPredecessor.EntityHasPredecessorsInSameAction
lbl_debugInfo.Text += "<br />usrCntrl_EntityPredecessor_EntityHasNoPredecessors Sub: there's been an EVENT THIS IS GREAT<br />"
pnl_predecessorList.Visible = True 'False
'Show user messages (only if global flags for both other early-status-marked notices are not on):
if gbl_bool_earlyStatusAlreadyMarked_notifyAdmin = false and gbl_bool_earlyStatusAlreadyMarked_notifyPM = false then
pnl_msg_predecessorsInSameAction.Visible = True
pnl_msg_predecessorsActionLinked.Visible = False
end if
btn_save.Text = "Inform PM" '"Save"
'Change the way the save function behaves:
gbl_bool_predecessorsInSameActionExist_notifyPM = True 'False
End Sub
</script>
<!-- END task predecessor list -->
<table height="1" cellSpacing="0" cellPadding="0" border="0">
<tr class="detailHeader" height="1">
<td width="10" height="1"> </td>
<td width="200" height="1">Dates</td>
<td height="1"><IMG height="15" src="../images/whiteslant.gif"></td>
</tr>
</table>
<TABLE class="detailTable" id="Table3" cellSpacing="0" cellPadding="4" width="100%">
<TR class="detailRow">
<TD class="detailLabel" vAlign="top">Color</TD>
<TD vAlign="top">:</TD>
<TD vAlign="top" colSpan="4"><asp:label id="lblColor" Runat="server"></asp:label></TD>
</TR>
<TR class="detailRowalt">
<TD class="detailLabel">Work [Hours(s)]</TD>
<TD>:</TD>
<TD><asp:label id="lblHours" Runat="server"></asp:label></TD>
<TD class="detailLabel">Duration [Day(s)]</TD>
<TD>:</TD>
<TD><asp:label id="lblDays" Runat="server"></asp:label></TD>
</TR>
<TR class="detailRow">
<TD class="detailLabel" width="20%">Sched Start</TD>
<TD width="1%">:</TD>
<TD width="29%"><asp:label id="lblSchedStart" Runat="server"></asp:label></TD>
<TD class="detailLabel" width="20%">Sched End</TD>
<TD width="1%">:</TD>
<TD width="29%"><asp:label id="lblSchedEnd" Runat="server"></asp:label></TD>
</TR>
<TR class="detailRowalt">
<TD class="detailLabel">Actual Start</TD>
<TD>:</TD>
<TD><asp:label id="lblActualStart" Runat="server"></asp:label></TD>
<TD class="detailLabel">Actual End</TD>
<TD>:</TD>
<TD><asp:label id="lblActualEnd" Runat="server"></asp:label></TD>
</TR>
<TR class="detailRow">
<TD class="detailLabel">Projected Start</TD>
<TD>:</TD>
<TD><asp:label id="lblProjectedStart" Runat="server"></asp:label></TD>
<TD class="detailLabel">Projected End</TD>
<TD>:</TD>
<TD><asp:label id="lblProjectedEnd" Runat="server"></asp:label></TD>
</TR>
</TABLE>
<!-- == -->
<asp:panel id="pnl_dynDetails" Runat="server" Visible="False">
<TABLE border="0" cellSpacing="0" cellPadding="0" height="1">
<TR class="detailHeader" height="1">
<TD height="1" width="10"> </TD>
<TD height="1" width="200">* Additional Details</TD>
<TD height="1"><IMG src="../images/whiteslant.gif" height="15"></TD>
</TR>
</TABLE>
<asp:Table id="tbl_dynDetails" Runat="server" Width="100%" CellSpacing="0" CellPadding="4"
CssClass="detailTable"></asp:Table>
</asp:panel>
<!-- START PANEL pnl_modifyElements -->
<asp:panel id="pnl_modifyElements" Runat="server">
<asp:label id="lbl_debugInfo" Runat="server" visible="false"></asp:label>
<TABLE border="0" cellSpacing="0" cellPadding="0" height="1">
<TR class="detailHeader" height="1">
<TD height="1" width="10"> </TD>
<TD height="1" width="200">* Please fill in all the fields</TD>
<TD height="1"><IMG src="../images/whiteslant.gif" height="15"></TD>
</TR>
</TABLE>
<TABLE id="Table5" class="detailTable" cellSpacing="0" cellPadding="4" width="100%">
<TR class="detailRow">
<TD style="HEIGHT: 24px" class="detailLabel" width="20%">Status</TD>
<TD style="HEIGHT: 24px" width="1%">:</TD>
<TD width="1%">
<DIV style="DISPLAY: none" id="divdrpdn_status"><FONT color="red">*</FONT></DIV>
</TD>
<TD style="HEIGHT: 24px" width="29%" colSpan="4">
<asp:dropdownlist id="drpdn_status" Runat="server" AutoPostBack="True"></asp:dropdownlist></TD>
</TR>
<TR id="tblRow_actualStartDate" class="detailRowalt" runat="server">
<TD class="detailLabel">Actual Start Date</TD>
<TD>:</TD>
<TD>
<DIV style="DISPLAY: none" id="divdatfld_actualStartDate"><FONT color="red">*</FONT></DIV>
</TD>
<TD>
<Component:DateField id="datfld_actualStartDate" Runat="server" DisallowFutureDates="true" Enabled="true"
size="10"></Component:DateField></TD>
</TR>
<TR id="tblRow_actualEndDate" class="detailRow" runat="server">
<TD class="detailLabel">Actual End Date</TD>
<TD>:</TD>
<TD>
<DIV style="DISPLAY: none" id="divdatfld_actualEndDate"><FONT color="red">*</FONT></DIV>
</TD>
<TD>
<Component:DateField id="datfld_actualEndDate" Runat="server" DisallowFutureDates="true" Enabled="true"
size="10"></Component:DateField></TD>
</TR>
<TR id="tblRow_estimatedEndDate" class="detailRowalt" runat="server">
<TD class="detailLabel">Estimated End</TD>
<TD>:</TD>
<TD>
<DIV style="DISPLAY: none" id="divdatfld_estimatedEndDate"><FONT color="red">*</FONT></DIV>
</TD>
<TD colSpan="4">
<Component:DateField id="datfld_estimatedEndDate" Runat="server" DisallowFutureDates="false" Enabled="true"
size="10"></Component:DateField></TD>
</TR>
<TR id="tblRow_remarks" class="detailRow" runat="server">
<TD style="HEIGHT: 24px" class="detailLabel" width="20%">
<asp:Label id="lbl_remarks" Runat="server"></asp:Label></TD>
<TD style="HEIGHT: 24px" width="1%">:</TD>
<TD width="1%">
<DIV style="DISPLAY: none" id="divtxtbx_remarks"><FONT color="red">*</FONT></DIV>
</TD>
<TD style="HEIGHT: 24px" width="29%" colSpan="4">
<asp:textbox id="txtbx_remarks" Runat="server" Rows="3" TextMode="MultiLine"></asp:textbox></TD>
</TR> <!--
<tr class="detailRow">
<td class="detailLabel" style="CURSOR: hand; COLOR: green; TEXT-DECORATION: underline"
onclick="callZoom(33,<%=session("user_id")%>, '<%=session("user_name")%>');" colSpan="6">Analyze your progress</td>
</tr>
--></TABLE> <!-- START Deliverable User control -->
<asp:panel id="pnl_deliverable" Runat="server" visible="true">
<TABLE border="0" cellSpacing="0" cellPadding="0" width="98%" align="center">
<TR>
<TD>
<TABLE cellSpacing="0" cellPadding="2" width="100%">
<TR>
<TD><FONT style="FONT-FAMILY: Tahoma, Verdana; COLOR: darkblue; FONT-SIZE: 12pt; FONT-WEIGHT: bold">A
Deliverable is Required </FONT>
</TD>
</TR>
</TABLE>
</TD>
</TR>
<TR>
<TD style="BORDER-BOTTOM: darkgray 1px solid; BORDER-LEFT: darkgray 1px solid; WIDTH: 100%; BORDER-TOP: darkgray 1px solid; BORDER-RIGHT: darkgray 1px solid"
bgColor="aliceblue"></TD>
</TR>
</TABLE>
<UserControl:Deliverable id="usrCntrl_AttachDeliverable" runat="server"></UserControl:Deliverable>
</asp:panel>
<asp:panel id="pnl_condDetailsEdit" Visible="true" Runat="server">
<TABLE cellSpacing="0" cellPadding="0" height="1">
<TR class="detailHeader" height="1">
<TD height="1" width="10"> </TD>
<TD height="1" width="200"><SPAN>*</SPAN> Conditional Details</TD>
<TD height="1"><IMG src="../images/whiteslant.gif" height="15"></TD>
</TR>
</TABLE>
<UserControl:ConditionalDetails id="usrCntrl_ConditionalDetailsPanel" runat="server"></UserControl:ConditionalDetails>
</asp:panel> <!-- END Conditional Details User control -->
<asp:button id="btn_save" Runat="server" Text="Save"></asp:button>
<asp:label id="lbl_btn_save_message" Runat="server" visible="False"></asp:label>
</asp:panel>
<asp:panel id="pnl_modifyPerformedMessage" Runat="server">
<asp:Label id="lbl_modifyPerformedMessage" Runat="server"></asp:Label>
</asp:panel>
<input id="hdn_resourceId" type="hidden" name="hdn_resourceId"> <input id="hdnexplode" type="hidden" name="hdnexplode">
<input type="hidden" id="RefreshParent" name="RefreshParent"> <input type="hidden" id="hdnSessionTimeout" name="hdnSessionTimeout" runat="server">
</form>
</body>
</html>
On load and rest of server side:
Imports System.Data.SqlClient
Imports components
Partial Class toDoListModifyEntity_PT
Inherits BasePage
#Region " Web Form Designer Generated Code "
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Protected WithEvents NavSpot As System.Web.UI.WebControls.PlaceHolder
Dim arlist_dynCompnts As ArrayList
Dim gbl_task_Type As Integer = -1
Dim gbl_str_deliverableStatus As String
Public gbl_bool_predecessorsInSameActionExist_notifyPM As Boolean = False
Public gbl_bool_predecessorsInOtherActionExist_notifyAdmin As Boolean = False
Public gbl_bool_earlyStatusAlreadyMarked_notifyPM As Boolean
Public gbl_bool_earlyStatusAlreadyMarked_notifyAdmin As Boolean
Protected WithEvents usrCntrl_EntityPredecessor As EntityPredListPanel
Protected WithEvents usrCntrl_ConditionalDetailsPanel As ConditionalDetailsPanel
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim DS As SqlDataReader = getEntityDetails(CType(Page.Request.QueryString("taskgrpid"), Integer), CType(Page.Request.QueryString("taskgrpcategory"), Integer))
DS.Read()
If Not IsDBNull(DS.Item("Type")) Then gbl_task_Type = CType(DS.Item("Type"), Integer)
If Not Page.IsPostBack Then
fillStatuDropDown(CType(Page.Request.QueryString("taskgrpid"), Integer), 13, CType(Session.Item("user_id"), Integer))
drpdn_status_SelectedIndexChanged(New Object, New System.EventArgs)
If Page.Request.QueryString("taskgrpcategory") = "13" Then
datfld_actualStartDate.Text = DS.Item("Actual Start").ToString()
datfld_actualEndDate.Text = DS.Item("Actual End").ToString()
datfld_estimatedEndDate.Text = DS.Item("ProjEnd").ToString()
txtbx_remarks.Text = DS.Item("remark").ToString()
lblSchedStart.Text = DS.Item("Scheduled Start").ToString()
lblSchedEnd.Text = DS.Item("Scheduled End").ToString()
lblActualStart.Text = DS.Item("Actual Start").ToString()
lblActualEnd.Text = DS.Item("Actual End").ToString()
lblProjectedStart.Text = DS.Item("ProjStart").ToString()
lblProjectedEnd.Text = DS.Item("ProjEnd").ToString()
lblHours.Text = DS.Item("Hours").ToString()
lblDays.Text = DS.Item("Duration").ToString()
If IsDBNull(DS.Item("color")) = False Then
If DS.Item("color") = "G" Then
lblColor.Text = "<img src=""../images/G.gif""> Green"
ElseIf DS.Item("color") = "Y" Then
lblColor.Text = "<img src=""../images/Y.gif""> Yellow"
ElseIf DS.Item("color") = "O" Then
lblColor.Text = "<img src=""../images/O.gif""> Orange"
ElseIf DS.Item("color") = "R" Then
lblColor.Text = "<img src=""../images/R.gif""> Red"
Else
lblColor.Text = "None"
End If
Else
lblColor.Text = "None"
End If
If lblActualStart.Text <> "" Then
lblProjectedStart.Visible = False
Else
lblProjectedStart.Visible = True
End If
End If
End If
DS.Close()
If Page.Request.QueryString("taskgrpcategory") = "13" Then
pnl_dynDetails.Visible = False
If gbl_task_Type <> -1 Then
pnl_dynDetails.Visible = True
arlist_dynCompnts = New ArrayList
CustomFieldsLibrary.editDynamicFields(tbl_dynDetails, CType(Page.Request.QueryString("taskgrpid"), Integer), 13, gbl_task_Type, arlist_dynCompnts, (New SqlConnection((New ConnInfo).GetConnString)), True)
'CustomControls.CustomFieldsLibrary.showDynamicDetails(tbl_dynDetails, CType(Page.Request.QueryString("taskgrpid"), Integer), 13, task_Type, Nothing, (New SqlConnection((New ConnInfo).GetConnString)), True)
End If
End If
gbl_str_deliverableStatus = ExecutionFunctions.checkEntityDeliverableStatus(CType(Page.Request.QueryString("taskgrpid"), String))
lbl_debugInfo.Text += System.DateTime.Now.ToLongTimeString() + " gbl_str_deliverableStatus: '" + gbl_str_deliverableStatus + "'<br />"
gbl_bool_earlyStatusAlreadyMarked_notifyPM = ExecutionFunctions.checkEarlyProgressAlreadyMarked_PM(CType(Page.Request.QueryString("taskgrpid"), String))
gbl_bool_earlyStatusAlreadyMarked_notifyAdmin = False
If gbl_bool_earlyStatusAlreadyMarked_notifyPM Then
pnl_msg_predecessorsInSameAction.Visible = False
pnl_msg_predecessorsActionLinked.Visible = False
pnl_msg_earlyProgressAlreadyMarked_notifiedPM.Visible = True
Else
pnl_msg_earlyProgressAlreadyMarked_notifiedPM.Visible = False
End If
If gbl_bool_earlyStatusAlreadyMarked_notifyAdmin Then
pnl_msg_predecessorsInSameAction.Visible = False
pnl_msg_predecessorsActionLinked.Visible = False
pnl_msg_earlyProgressAlreadyMarked_notifiedPM.Visible = False
pnl_msg_earlyProgressAlreadyMarked_notifiedAdmin.Visible = True
Else
pnl_msg_earlyProgressAlreadyMarked_notifiedAdmin.Visible = False
End If
If gbl_bool_earlyStatusAlreadyMarked_notifyAdmin Or gbl_bool_earlyStatusAlreadyMarked_notifyPM Then
pnl_modifyElements.Visible = False
Else
pnl_modifyElements.Visible = True
End If
btn_save.Attributes("onClick") = "return validate(this.form);"
lbl_debugInfo.Text += "Page_Load END<br />"
End Sub
drpdn_status_SelectedIndexChanged:
Private Sub drpdn_status_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles drpdn_status.SelectedIndexChanged
lbl_remarks.Text = drpdn_status.SelectedItem.Text + " Remarks"
Select Case drpdn_status.SelectedValue
Case 7
tblRow_actualStartDate.Visible = True
tblRow_actualEndDate.Visible = False
tblRow_estimatedEndDate.Visible = False
tblRow_remarks.Visible = False
pnl_deliverable.Visible = False
Case 8
tblRow_actualStartDate.Visible = True
tblRow_actualEndDate.Visible = False
tblRow_estimatedEndDate.Visible = True
tblRow_remarks.Visible = True
pnl_deliverable.Visible = False
Case 15
tblRow_actualStartDate.Visible = True
tblRow_actualEndDate.Visible = False
tblRow_estimatedEndDate.Visible = True
tblRow_remarks.Visible = False
pnl_deliverable.Visible = False
Case 9
tblRow_actualStartDate.Visible = True
tblRow_actualEndDate.Visible = True
tblRow_estimatedEndDate.Visible = False
tblRow_remarks.Visible = True
Dim str_deliverableStatus As String = ExecutionFunctions.checkEntityDeliverableStatus(CType(Page.Request.QueryString("taskgrpid"), String))
If str_deliverableStatus = "1" Then pnl_deliverable.Visible = True
lbl_debugInfo.Text += "Local str_deliverableStatus: '" + str_deliverableStatus + "'<br />"
Case Else
Throw New Exception("ERROR: unrecognized status *Value* (" + drpdn_status.SelectedItem.Value.ToString + ")")
End Select
End Sub
Thanks for your help.
update: if I replace the onload with only a clientscript to just pop up an alert to let us know the page load is being ran, it works on the development side but still nothing happens on the server side. Even though we call a function (fillStatuDropDown) to fill the dropdown on load - the dropdown on the deployment side is loaded with two values even though we have removed all calls to the function that fills the dropdown, on the development side it doesn't fill any values into the dropdown
Your page AutoEventWireup is at false, where is the event attached?
Also, there's some kind of logic issue in your Page_Load.
If Not Page.IsPostBack Then
fillStatuDropDown(CType(Page.Request.QueryString("taskgrpid"), Integer), 13, CType(Session.Item("user_id"), Integer))
drpdn_status_SelectedIndexChanged(New Object, New System.EventArgs)
Let's take the case where you load the page the first time, the SelectedIndexChanged event is then attached correctly but if you change the index, another postback occurs the selectedIndexChanged event will not be attached causing the event not to be fired.
Issue was due to corruption from FTP deployment. Was able to reupload the whole application and everything then worked as intended.
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)) %>