Is there a to build a datagrid in asp that doesn't use the file extension aspx and doesn't use
. I'm trying to build a form that pulls information from a db and has a approve or decline link and a edit button that allow instant change of the information. Here is what I have so far but I can't get it to work because of the web.config. I'm using sessions to varify that the users is logged in.
web.config
any help would be great!
Code:
<%@ Import Namespace="System.Data.OleDb" %>
Code:
<%@ Import Namespace="System.Data.OleDb" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Worker Management System --- Powered by Guthnur.NET</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" media="print" href="css/print.css">
<style type="text/css" media="screen">
@import url("css/layout.css");
@import url("css/content.css");
@import url("css/docbook.css");
</style>
<meta name="MSSmartTagsPreventParsing" content="TRUE">
<script runat="server" language="VB">
Dim objConn As New OleDbConnection("Provider=SQLOLEDB;Server=aspsrv;UID=sa;PASSWORD=mo nkey;DATABASE=rit;")
Dim objCmd As OleDbCommand
Dim objRdr As OleDbDataReader
Dim strCmd As String
Sub Page_Load()
If Not IsPostBack Then
BindData()
End If
End Sub
Sub BindData()
objCmd = New OleDbCommand("SELECT * FROM dayoff", objConn)
objConn.Open()
objRdr = objCmd.ExecuteReader()
dgAddressBook.DataSource = objRdr
dgAddressBook.DataBind()
objRdr.Close()
objConn.Close()
End Sub
</script>
<link rel="shortcut icon" href="images/favicon.ico">
<link rel="icon" href="images/favicon.ico">
</head>
<body>
<!-- header BEGIN -->
<div id="wms-header">
<div id="wms-header-logo">
<a href="/"><img src="images/header-wms_logo.png" width="20" height="40" alt="wms Project"></a>
</div>
<div id="wms-header-items">
<span class="wms-header-icon">
<a href="/calendar/"><img src="images/header-calendar.png" alt=" ">My Calendar</a>
<a href="/profile.asp"><img src="images/header-projects.png" alt=" ">My Profile</a>
<a href="/about/faq/"><img src="images/header-faq.png" alt=" ">FAQ</a></span>
</div>
</div>
<div id="wms-nav">
<!-- header END -->
</div>
<!-- leftside BEGIN -->
<div id="wms-side-left">
<div class="wms-welcome">Hello, <% Response.Write(Session("fname"))%></div><br>
<!--#include file="menu.asp"-->
<!-- leftside END -->
<!-- content BEGIN -->
<div id="wms-middle-three">
<div class="wms-corner-tr"> </div>
<div class="wms-corner-tl"> </div>
<div id="wms-content">
<h1>Day Off system</h1>
<p>
<table>
<td>
<h1>Requests</h1>
<p><asp:DataGrid id="dgAddressBook" runat="server" AutoGenerateColumns="false" CellPadding="4" GridLines="None">
<ItemStyle Font-Name="Arial" Font-Size="10pt" ForeColor="#000000" />
<HeaderStyle Font-Name="Arial" Font-Size="10pt" Font-Bold="true" BackColor="#003366" ForeColor="#FFFFFF" />
<AlternatingItemStyle Font-Name="Arial" Font-Size="10pt" BackColor="#CCCCCC" />
<Columns>
<asp:BoundColumn DataField="fname" HeaderText="First Name" />
<asp:BoundColumn DataField="lname" HeaderText="Last Name" />
<asp:BoundColumn DataField="date" HeaderText="date" />
<asp:BoundColumn DataField="reason" HeaderText="reason" />
<asp:BoundColumn DataField="daterequest" HeaderText="daterequest" />
<asp:BoundColumn DataField="email" HeaderText="email" />
<asp:BoundColumn DataField="phone1" HeaderText="Phone" />
<asp:BoundColumn DataField="approve" HeaderText="Approve" />
</Columns>
</asp:DataGrid></p></td>
</table>
</p>
</div>
<div class="wms-corner-br"> </div>
<div class="wms-corner-bl"> </div>
</div>
<!-- content END -->
<!-- footer BEGIN -->
<div id="wms-footer">
Copyright ?2005-2008 Richard Genthner. All rights reserved.
<br>The Work Management System is not a supported project of Rochester Institute of Technology.
<br><a href="/legal/">Legal</a> | <a href="/about/trademarks/">Trademark Guidelines</a>
<br>
This page last modified at: <%=time()%><%Response.Write(" ")%><%=monthname(month(now))%><%Response.Write(" ")%><%=day(now)%>,<%=year(now)%>
<br>
</div>
<!-- footer END -->
</body>
</html>
web.config
Code:
<configuration>
<appSettings>
<add key="DSN" value="Provider=SQLOLEDB;Server=aspsrv;UID=sa;PASSWORD=mo nkey;DATABASE=rit;" />
</appSettings>
<system.web>
<authentication mode="Forms" />
<authorization>
<deny>Session("level")<3</deny>
</authorization>
</system.web>
</configuration>
any help would be great!



