CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 1/16/2008 2:46:50 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 5 Views: 20 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
6 Items, 1 Pages 1 |< << Go >> >|
MichaelOSS
Asp.Net User
MasterPage does not work with <form id="Form1" runat="Server">1/16/2008 2:46:50 AM

0/0

When I add my masterpage to my content page I am getting - A page can have only one server-side Form tag.

Content page: (VB.Net)

1    <%@ Page language="VB" Inherits="dotForumPostReply.addReply" EnableEventValidation="False" 
2    CodePage="1252" MasterPageFile="masterpage.master" %>
3    <%@ MasterType VirtualPath="masterpage.master" %>
4    <%@ Register NameSpace="OSS" TagPrefix="OSS" %>
5    <%@ import namespace="System" %>
6    <%@ import namespace="System.Data" %>
7    <%@ import namespace="System.Data.OleDB" %>
8    <%@ import namespace="System.Web" %>
9    
10   
11   <asp:Content ID="Content" ContentPlaceHolderID="Content" runat="Server">	
12   
13   <head id="Head">
14   
15   	<meta http-equiv="Content-language" content="en-US" />
16   	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
17   	<meta name="author" />
18   	
19   	<link rel="stylesheet" type="text/css" href="App_Themes/OSS/OSS.css" />
20   
21   <script type="text/javascript">
22   <!-- 
23   
24   if (window != window.top) { top.location.href = location.href; }
25   
26   // -->
27   </script>
28   
29   </head>
30   
31   <div id="container">
32   
33   <body>
34   
35   	<div id="navigation">
36   		<ul>
37   	 		<li><a href="forum.aspx">Forum Index</a></li>
38   			<li><a href="search.aspx">Forum Search</a></li>
39   		</ul>
40   	</div>
41   
42   <form id="Form1" runat="Server">
43   
44   <div id="forum">
 
Thanks!
MichaelOSS
 
mpaterson
Asp.Net User
Re: MasterPage does not work with <form id="Form1" runat="Server">1/16/2008 3:01:09 AM

0/0

The error page is basically telling you that you have two forms that run on the server.
Check your master page for a form.
I always suggest having one form in your master page.
If you can, take the form out of your content page.


If everything happens for a reason what is the reason for this error?
MichaelOSS
Asp.Net User
Re: MasterPage does not work with <form id="Form1" runat="Server">1/16/2008 3:06:24 AM

0/0

Thanks for the reply!

When I remove the form from my content page this code nolonger "triggers"

 

<table border="0" cellpadding="2" cellspacing="1">
 <tr>
   <td>
 <input type="button" onclick="return pnhEditTextarea('psPost','bold')" value="Bold" style="font-weight: bold;">
 <input type="button" onclick="return pnhEditTextarea('psPost','italic')" value="Italic" style="font-style: italic;">
 <input type="button" onclick="return pnhEditTextarea('psPost','underline')" value="Underline" style="text-decoration: underline;">
 <input type="button" onclick="return pnhEditTextarea('psPost','codetag')" value="Code">
 <input type="button" onclick="return pnhEditTextarea('psPost','quote')" value="&quot;Quote&quot;">
 <input type="button" onclick="return pnhEditTextarea('psPost','image')" value="Image">
 <input type="button" onclick="return pnhEditTextarea('psPost','url')" value="Link" style="text-decoration: underline; color: #4373b4;">
  </td>
</tr>
 
mpaterson
Asp.Net User
Re: MasterPage does not work with <form id="Form1" runat="Server">1/16/2008 3:40:05 AM

0/0

Can you post the code for your master page and content page?


If everything happens for a reason what is the reason for this error?
MichaelOSS
Asp.Net User
Re: MasterPage does not work with <form id="Form1" runat="Server">1/16/2008 3:48:36 AM

0/0

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">&nbsp;</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                      &nbsp;&nbsp;
108  				<asp:HyperLink ID="HelpLink" runat="server" ForeColor="White" NavigateUrl="Help.aspx" Target="_blank">Help</asp:HyperLink>
109                      &nbsp;&nbsp;
110  				<asp:LoginStatus ID="OSSLoginStatus" Runat="server" ForeColor="White" LogoutAction="Redirect" LogoutPageUrl="logout.aspx" CssClass="aspnetmaker" OnLoggingOut="OSSLoginStatus_LoggingOut"/>
111                      &nbsp;
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                                      &nbsp;   </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>&nbsp;</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> &#062;
211  		<asp:HyperLink id="topicLink" NavigateUrl="topicView.aspx" CssClass="menuitem" runat="server" /> &#062;
212  		<asp:HyperLink id="threadLink" NavigateUrl="threadView.aspx" CssClass="menuitem" runat="server" /> &#062;
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="&quot;Quote&quot;">
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  
 

 

MichaelOSS
Asp.Net User
Re: MasterPage does not work with <form id="Form1" runat="Server">2/27/2008 4:35:51 PM

0/0

I removed the master page. 

6 Items, 1 Pages 1 |< << Go >> >|


Free Download:


Web:
MasterPage does not work with . Last post 02-27- 2008 11:35 AM by MichaelOSS. 5 replies. Sort Posts: ...
Working with ASP.NET Master Pages Programmatically The controls are not directly accessible as master-page members because they .... No title ...
InitiallyDockedPaneId does not work in Master page - telerik Forum NET InitiallyDockedPaneId does not work in Master page .... .......... script ................... ...
Technical Tips & Tricks: Designing MasterPages
AJAX in master page - Application Development Forum IN THE SAME APP this page does not work: ...
Modal Popup Extender does not show up. :( - Microsoft Philippines ... I do not know why it would work when I am not using a masterpage versus when I am. ... ...
Tag in a MasterPage environment - .NET ASP Guest - n/a Posts. #2: Re: Tag in a MasterPage environment. Does your page have a set of: Tag in a MasterPage environment So does this mean that I have to have the FORM tag inside the ASPX page and .... ...
Working With Master Page - Vikram Lakhotia
ASP.NET 2.0 Master Page Problem I was running to issues with the images on the page not working under sub folders. ... ...




Search This Site:










search results in 4.0.3.

change the dnn code? or switch web host service??

error using [printmodule] in container 3.0.11

validate login with email address.

getting a null reference exception in aspnet_merge

createuserwizard and close browser issue

need some help with custom providers

meta tag problem

server error in '/commercecssdk' application

club website thinks it's connecting to 2005 but really is connecting 2000 error

houston meetup meeting thursday

treeview

help with .text - application error!

dnn 3.04 bug user verification

how to programmatically change module footer?

how to create temporary files?

is it possible to hidden a icon xml and icon print...?

membership lastactivitydatetime is incorrect in december ctp beta2

how to add data in a skin file in vwd?

admin

runtime error

treeview presentation

how to load a skin file from a subfolder?

clear cache question 3.0.13

mac & fileupload

password recovery not sending email

ibs vs. dnn vs. rp vs. psk

installing visual studio 2005 and sql server 2005 issues

asp.net build order???

roleprovider problem

 
All Times Are GMT