Yes, public makes more sense since each file is put into it's own assembly.
This is a little test I did:
<%@ Master Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Public ReadOnly Property Form() As HtmlForm
Get
Return form1
End Get
End Property
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
</asp:contentplaceholder>
</div>
</form>
</body>
</html>
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" Title="Untitled
Page" %>
<%@ MasterType VirtualPath="~/MasterPage.master" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
</asp:Content>
<script runat="server">
Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)
Master.Form.Attributes.Add("action", "test.html")
MyBase.OnLoad(e)
End Sub
</script>
and it worked great...
Karl
--
http://www.openmymind.net/ http://www.fuelindustries.com/
"Not Me" <no****@zxy.blah.org> wrote in message
news:e2**********@ucsnew1.ncl.ac.uk...
Hi Karl,
That looks great.. and definitely points me in the right direction..
unfortunately I am stuck :)
I get errors telling me the form() property is private, even though it's
set as friend. the only way to circumvent this is to make it public.
Once I've done the above, not a lot seems to be happening. specifically
the 'action' of the form isn't being triggered and I'm not being sent
elsewhere. Do I need to set the redirect programmatically? It would seem
that would negate the need for an action attribute anyway...
cheers for your input
Chris
Karl Seguin [MVP] wrote: (1) Expose the form as a property of your master page:
<script runat="server">
Friend ReadOnly Property Form() As HtmlForm
Get
Return form1
End Get
End Property
</script>
(2)
Sepcify the type of your master page in your page:
<%@ MasterType VirtualPath="~/MasterPage.master" %>
(3)
Access the form in your page
Master.Form.Attributes.Add("action", "whatever.html")
...
Karl