Sorry that it is so long, THANKS!!!!!!!!!!
1 Masterpage:
2 <%@ Master Language="VB" %>
3 <%@ Import Namespace="OSS" %>
4 <%@ Import Namespace="EW.Web" %>
5 <%@ Register NameSpace="OSS" TagPrefix="OSS" %>
6 <script runat="server">
7 Dim isExport As Boolean = false
8
9 ' *************************
10 ' * Handler for Export
11 ' *************************
12
13 Public Sub SetExport(ByVal value As Boolean)
14 isExport = value
15 End Sub
16
17 ' *************************
18 ' * Handler for Page Load
19 ' *************************
20
21 Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
22 If isExport Then
23 LayoutTable.Rows.RemoveAt(2) ' remove footer
24 LayoutTable.Rows(1).Cells.RemoveAt(0) ' remove netvigator
25 LayoutTable.Rows.RemoveAt(0) ' remove header
26 End If
27 Advsecu.LoadUserLevel()
28 Dim tblNavigator As System.Web.UI.WebControls.Table= TryCast(OSSLoginView.FindControl("tblNavigator"), System.Web.UI.WebControls.Table)
29 If (tblNavigator IsNot Nothing) Then
30
31 If (tblNavigator.FindControl("tblrowDatabases") IsNot Nothing) Then
32 tblNavigator.FindControl("tblrowDatabases").Visible = CustomProfile.GetTable(Share.ProjectName, "Databases").IsShowMenuItem
33 End If
34 If (tblNavigator.FindControl("tblrowEmployees") IsNot Nothing) Then
35 tblNavigator.FindControl("tblrowEmployees").Visible = CustomProfile.GetTable(Share.ProjectName, "Employees").IsShowMenuItem
36 End If
37
38 ' GSFT *************************
39 ' If admin then show admin & Users link
40 ' *************************
41
42 If Advsecu.IsSysAdmin() Or (Advsecu.GetCurrentUserLevel() = "1") Then
43 tblNavigator.FindControl("tblrowAdmin").Visible = True
44 'tblNavigator.FindControl("tblrowEmployees").Visible = True
45 End If
46
47
48
49 If (tblNavigator.FindControl("tblrowDocuments") IsNot Nothing) Then
50 tblNavigator.FindControl("tblrowDocuments").Visible = CustomProfile.GetTable(Share.ProjectName, "Documents").IsShowMenuItem
51 End If
52 If (tblNavigator.FindControl("tblrowResources") IsNot Nothing) Then
53 tblNavigator.FindControl("tblrowResources").Visible = CustomProfile.GetTable(Share.ProjectName, "Resources").IsShowMenuItem
54 End If
55 If (tblNavigator.FindControl("tblrowUserLevelPermissions") IsNot Nothing) Then
56 tblNavigator.FindControl("tblrowUserLevelPermissions").Visible = CustomProfile.GetTable(Share.ProjectName, "UserLevelPermissions").IsShowMenuItem AndAlso Advsecu.IsSysAdmin()
57 End If
58 If (tblNavigator.FindControl("tblrowUserLevels") IsNot Nothing) Then
59 tblNavigator.FindControl("tblrowUserLevels").Visible = CustomProfile.GetTable(Share.ProjectName, "UserLevels").IsShowMenuItem AndAlso Advsecu.IsSysAdmin()
60 End If
61
62 End If
63 If (tblNavigator IsNot Nothing AndAlso tblNavigator.FindControl("tblrowEmployees") IsNot Nothing) Then
64 tblNavigator.FindControl("tblrowEmployees").Visible = (Advsecu.IsLoggedIn() AndAlso Not Advsecu.IsSysAdmin())
65 End If
66 If (tblNavigator IsNot Nothing AndAlso tblNavigator.FindControl("tblrowChangePwd") IsNot Nothing) Then
67 tblNavigator.FindControl("tblrowChangePwd").Visible = (Advsecu.IsLoggedIn() AndAlso Not Advsecu.IsSysAdmin())
68 End If
69 If (Request.ServerVariables("URL").Length >= "login.aspx".Length) Then
70 Dim isLoginLinkVisible As Boolean = ((Request.ServerVariables("URL").Substring((Request.ServerVariables("URL").Length - "login.aspx".Length)) <> "login.aspx"))
71 OSSLoginStatus.Visible = isLoginLinkVisible
72 End If
73 End Sub
74
75 ' *********************************
76 ' * Handler for LoginStatus LoggingOut
77 ' *********************************
78
79 Protected Sub OSSLoginStatus_LoggingOut(ByVal sender As Object, ByVal e As LoginCancelEventArgs)
80 Response.Redirect("logout.aspx")
81 End Sub
82 </script>
83 <html>
84 <head id="Head" runat="server">
85 <title></title>
86 <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />
87 <meta name="generator" content="ASP.NET Maker v3.3.0.0" />
88 <style type="text/css">
89 .style3
90 {
91 height: 640px;
92 }
93 .style4
94 {
95 width: 126px;
96 }
97 </style>
98 </head>
99 <body>
100 <form id="form1" runat="server">
101 <table width="100%" border="0" cellspacing="0" cellpadding="10" id="LayoutTable" runat="server">
102 <tr align="center">
103 <td style="background-color: #000080;" class="style4"> </td>
104 <td class="aspnetmaker" align="right" style="background-color: #000080">
105 <asp:PlaceHolder ID="pnlHeader" Runat="Server"><b></b>
106 <asp:HyperLink ID="HomeLink" runat="server" ForeColor="White" NavigateUrl="MyProfileView.aspx" Target="_self">Home</asp:HyperLink>
107
108 <asp:HyperLink ID="HelpLink" runat="server" ForeColor="White" NavigateUrl="Help.aspx" Target="_blank">Help</asp:HyperLink>
109
110 <asp:LoginStatus ID="OSSLoginStatus" Runat="server" ForeColor="White" LogoutAction="Redirect" LogoutPageUrl="logout.aspx" CssClass="aspnetmaker" OnLoggingOut="OSSLoginStatus_LoggingOut"/>
111
112 </asp:PlaceHolder></td>
113 </tr>
114 <tr>
115 <td valign="top"
116 style="background-color: #D7D7D7; border-right-style: solid; overflow:auto;height:inherit; overflow:auto;width:150; border-right-color: #000000; position: inherit; z-index: inherit;"
117 class="style4">
118 <asp:PlaceHolder ID="pnlNavigator" Runat="Server">
119 <asp:LoginView Runat="server" ID="OSSLoginView">
120 <LoggedInTemplate>
121 <asp:Table runat="server" Width="100%" BorderWidth="0" CellPadding="0" CellSpacing="0" ID="tblNavigator">
122 <asp:TableRow runat="server" ID="tblrowDatabases"><asp:TableCell runat="server"><asp:HyperLink ID="hrlDatabases" CssClass="aspnetmaker" runat="server" NavigateUrl="Databaseslist.aspx?cmd=resetall" ForeColor="Black">Databases</asp:HyperLink></asp:TableCell></asp:TableRow>
123
124 <asp:TableRow runat="server" ID="tblrowDocuments"><asp:TableCell runat="server"><asp:HyperLink ID="hrlDocuments" CssClass="aspnetmaker" runat="server" NavigateUrl="Documentslist.aspx?cmd=resetall" ForeColor="Black">Documents</asp:HyperLink></asp:TableCell></asp:TableRow>
125 <asp:TableRow runat="server" ID="tblrowResources"><asp:TableCell runat="server"><asp:HyperLink ID="hrlResources" CssClass="aspnetmaker" runat="server" NavigateUrl="Resourceslist.aspx?cmd=resetall" ForeColor="Black">Resources Links</asp:HyperLink></asp:TableCell></asp:TableRow>
126 <asp:TableRow runat="server" ID="tblrowForum"><asp:TableCell runat="server"><asp:HyperLink ID="hrlForum" CssClass="aspnetmaker" runat="server" NavigateUrl="forum.aspx?cmd=resetall" ForeColor="Black">Knowledge Forum</asp:HyperLink></asp:TableCell></asp:TableRow>
127
128 <asp:TableRow runat="server" ID="space"><asp:TableCell ID="TableCell3" runat="server">
129 </asp:TableCell></asp:TableRow>
130 <asp:TableRow runat="server" ID="Users" Visible="false"><asp:TableCell ID="TableCell5" runat="server"><asp:HyperLink ID="HyperLink1" CssClass="aspnetmaker" runat="server" NavigateUrl="Employeeslist.aspx?cmd=resetall" ForeColor="Black">Users</asp:HyperLink></asp:TableCell></asp:TableRow>
131 <asp:TableRow runat="server" ID="tblrowAdmin" Visible="false"><asp:TableCell ID="TableCell2" runat="server"><asp:HyperLink ID="adminHyperLink" CssClass="aspnetmaker" runat="server" NavigateUrl="Administrator.aspx?cmd=resetall" ForeColor="Black">Administration</asp:HyperLink></asp:TableCell></asp:TableRow>
132
133
134
135 </asp:Table>
136 </LoggedInTemplate>
137 <AnonymousTemplate>
138 <asp:Table runat="server" Width="100%" BorderWidth="0" CellPadding="0" CellSpacing="0" ID="tblNavigator">
139 </asp:Table>
140 </AnonymousTemplate>
141 </asp:LoginView>
142
143 </asp:PlaceHolder>
144 </td>
145 <td valign="top" class="style3">
146 <asp:ContentPlaceHolder ID="Content" Runat="server" />
147 <p> </p>
148 </td>
149 </tr>
150 <tr>
151 <td colspan="2" style="font-size: xx-small; color: white; text-align: left; background-color: #000080;">
152 <asp:PlaceHolder ID="pnlFooter" Runat="Server">Copyright</asp:PlaceHolder>
153 </td>
154 </tr>
155 </table>
156 </form>
157 </body>
158 </html>
159
160 Content Page:
161 <%@ Page language="VB" Inherits="dotForumPostReply.addReply" EnableEventValidation="False" CodePage="1252" MasterPageFile="masterpage.master" %>
162 <%@ MasterType VirtualPath="masterpage.master" %>
163 <%@ Register NameSpace="OSS" TagPrefix="OSS" %>
164 <%@ import namespace="System" %>
165 <%@ import namespace="System.Data" %>
166 <%@ import namespace="System.Data.OleDB" %>
167 <%@ import namespace="System.Web" %>
168
169
170 <asp:Content ID="Content" ContentPlaceHolderID="Content" runat="Server">
171
172 <head id="Head">
173
174 <meta http-equiv="Content-language" content="en-US" />
175 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
176 <meta name="author" />
177
178 <link rel="stylesheet" type="text/css" href="App_Themes/OSS/OSS.css" />
179
180 <script type="text/javascript">
181 <!--
182
183 if (window != window.top) { top.location.href = location.href; }
184
185 // -->
186 </script>
187
188 </head>
189
190 <div id="container">
191
192 <body>
193
194 <div id="navigation">
195 <ul>
196 <li><a href="forum.aspx">Forum Index</a></li>
197 <li><a href="search.aspx">Forum Search</a></li>
198 </ul>
199 </div>
200
201
202 <div id="forum">
203
204 <h1><%=ConfigurationManager.AppSettings("websiteName")%></h1>
205
206
207 <span id="messageCenter" EnableViewState="false" runat="server"/>
208
209 <div id="forumNavigation">
210 <a class="menuitem" href="forum.aspx">Forum Topics</a> >
211 <asp:HyperLink id="topicLink" NavigateUrl="topicView.aspx" CssClass="menuitem" runat="server" /> >
212 <asp:HyperLink id="threadLink" NavigateUrl="threadView.aspx" CssClass="menuitem" runat="server" /> >
213 <b>New Reply</b>
214 </div>
215
216
217 <div class="formRow">
218 <div class="formLabel">Name:</div>
219 <div class="formField">
220 <asp:TextBox id="psName" runat="server" size="45" class="withbackground" maxlength="40" />
221 <asp:RequiredFieldValidator id="reqName" ControlToValidate="psName"
222 ErrorMessage="The Author Field is required." display="dynamic" runat="server" />
223 </div>
224 </div>
225
226 <div class="formRow">
227 <div class="formLabel">Email:</div>
228 <div class="formField">
229 <asp:TextBox id="psEmail" runat="server" size="45" class="withbackground" maxlength="100" />
230 <asp:RegularExpressionValidator id="regexEmail" ControlToValidate="psEmail"
231 ErrorMessage="The Email Field is required." display="dynamic"
232 ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
233 runat="server">Email must be in the form [email protected]</asp:RegularExpressionValidator>
234 <asp:RequiredFieldValidator id="reqEmail" ControlToValidate="psEmail"
235 ErrorMessage="The Email Field is required." display="dynamic" runat="server" />
236 </div>
237 </div>
238
239 <div class="formRow">
240 <div class="formLabel">Subject:</div>
241 <div class="formField">
242 <asp:TextBox id="psSubject" runat="server" size="60" class="withbackground" maxlength="60" />
243 <asp:RequiredFieldValidator id="reqSubject" ControlToValidate="psSubject"
244 ErrorMessage="The Subject Field is required." display="dynamic" runat="server" />
245 </div>
246 </div>
247 <asp:Panel id="subscribePanel" runat="server">
248
249 <p>
250 <br />
251 Subscribe to Thread and receive reply notification via email?
252 <asp:CheckBox id="threadSubscribe" value="y" CssClass="checkbox" runat="server" />
253 </p>
254 </asp:Panel>
255
256
257
258 <!-- SMART TAG EDITOR -->
259 <fieldset>
260 <legend>Reply Editor, with Smart Tags</legend>
261
262 <table border="0" cellpadding="2" cellspacing="1">
263 <tr>
264 <td>
265 <input type="button" onclick="return pnhEditTextarea('psPost','bold')" value="Bold" style="font-weight: bold;">
266 <input type="button" onclick="return pnhEditTextarea('psPost','italic')" value="Italic" style="font-style: italic;">
267 <input type="button" onclick="return pnhEditTextarea('psPost','underline')" value="Underline" style="text-decoration: underline;">
268 <input type="button" onclick="return pnhEditTextarea('psPost','codetag')" value="Code">
269 <input type="button" onclick="return pnhEditTextarea('psPost','quote')" value=""Quote"">
270 <input type="button" onclick="return pnhEditTextarea('psPost','image')" value="Image">
271 <input type="button" onclick="return pnhEditTextarea('psPost','url')" value="Link" style="text-decoration: underline; color: #4373b4;">
272 </td>
273 </tr>
274 <% If ConfigurationManager.AppSettings("allowHTML") Then %>
275 <tr>
276 <td>HTML tags are also allowed.</td>
277 </tr>
278 <% End If %>
279 <tr>
280 <td><asp:TextBox TextMode="MultiLine" id="psPost" runat="server" columns="80" rows="10" class="withbackground" /></td>
281 </tr>
282 </table>
283
284 <asp:RequiredFieldValidator id="reqPost" ControlToValidate="psPost" ErrorMessage="The Reply Field is required." display="dynamic" runat=server></asp:RequiredFieldValidator>
285
286 </fieldset>
287 <!-- END SMART TAG EDITOR -->
288
289
290 <p>
291 <asp:button id="submitter" name="submitter" text="Post Reply" OnCommand="submitter_update" runat="server" />
292 <asp:Button id="previewButton" runat="server" text="Preview" CausesValidation="False" OnCommand="display_preview" />
293 <asp:button id="canceller" name="canceller" text="Cancel" CausesValidation="False" OnCommand="canceller_update" runat="server" />
294 </p>
295
296
297 <!-- PREVIEW PANEL -->
298 <asp:Panel id="previewPanel" runat="server">
299
300 <fieldset>
301 <legend>Reply Preview</legend>
302
303 <span id="previewText" EnableViewState="false" runat="server"/>
304
305 </fieldset>
306
307 </asp:Panel>
308 <!-- END PREVIEW PANEL -->
309
310 </div>
311
312 </form>
313 </body>
314 </div>
315 </asp:Content>
316