469,917 Members | 1,474 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,917 developers. It's quick & easy.

Multiple Content Panes / Forms Tags

Hello,

I have a content page that is from a Master page which has 2 content panes.
How do I add my forms to the content page? Each pane needs a form but you
can not have multiple form tags nor can the form tages be outside of the
content tags?

Does this make since? Below is my source to the pages. Basically I need
both content tags to have form tags.

%@ Page Language="C#" MasterPageFile="~/Main.master" AutoEventWireup="true"
CodeFile="Inventory.aspx.cs" Inherits="Inventory" Title="Enterprises, LLC"
%>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">

<asp:Label ID="lblHeader" runat="server" Text="Welcome to our online
store, selet a Category on the left to view our products."
CssClass="NonHeaderLabel" Width="100%"></asp:Label>&nbsp;
<asp:GridView ID="gvProducts" runat="server"
AllowPaging="True"
OnPageIndexChanging = "gvProducts_PageIndexChanging"
OnRowDataBound = "gvProducts_RowDataBound"
AutoGenerateColumns="False" CellPadding="3" DataKeyNames="ProductID"
GridLines="Horizontal" PageSize="25" Width="100%"
>
<Columns>
<asp:TemplateField>
<EditItemTemplate>
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<img src='Handler.ashx?Size=S&ProductID=<%#
Eval("ProductID") %>&CompanyID=<%# Eval("CompanyID") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Title">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%#
Bind("Title") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%#
Bind("Title") %>'></asp:Label><BR>
<asp:Label ID="Label2" runat="server" Text='<%#
Bind("ProductCondition") %>'></asp:Label>
</ItemTemplate>
<ItemStyle VerticalAlign="Top" />
</asp:TemplateField>
<asp:BoundField DataField="ItemNumber" HeaderText="Item Number"
>
<ItemStyle VerticalAlign="Top" />
</asp:BoundField>
<asp:TemplateField HeaderText="Price">
<EditItemTemplate>
<asp:TextBox ID="TextBox3" runat="server" Text='<%#
Bind("Price") %>'></asp:TextBox>
</EditItemTemplate>
<ItemStyle VerticalAlign="Top" />
<ItemTemplate>
<asp:Label ID="lblprice" runat="server" Text='<%#
Bind("Price") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:ButtonField ButtonType="Button" Text="Details">
<ControlStyle CssClass="ButtonStyle" />
<ItemStyle Width="50px" VerticalAlign="Top" />
</asp:ButtonField>
</Columns>
<HeaderStyle CssClass="GridViewHeader" />
<AlternatingRowStyle CssClass="GridViewAltRow" />
</asp:GridView>

</asp:Content>
<asp:Content ID="Content2" runat="server"
ContentPlaceHolderID="Contentplaceholder2">

<asp:Label ID="Label1" runat="server" CssClass="HeaderLabel"
Text="Categories" Width="100%"></asp:Label>
<asp:DataList ID="dlCategories" runat="server" DataKeyField="ID">
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server"
OnCommand="CategoryButtonClick" CommandArgument='<%# Eval("ID").ToString()
%>' CommandName='<%# Eval("CategoryDescription").ToString() %>' ><%#
Eval("CategoryDescription").ToString() %></asp:LinkButton>

</ItemTemplate>
</asp:DataList>
</asp:Content>
Apr 10 '07 #1
3 1917
Why is the form from within the master page not enough? Why do you need a
second/third form?

The way it works is the Page will have a single child control, the master
page, and then that control will have multiple child controls....your
content page controls. When you view the control tree as such, the form is
still part of the control tree if its specified in the master page.

.....so, I'm confused why you cannot just use the form from the master page?

--
~~~~~~~~~~~
Ben Rush
http://www.ben-rush.net/blog
"MikeB" <m@nospam.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
Hello,

I have a content page that is from a Master page which has 2 content
panes. How do I add my forms to the content page? Each pane needs a form
but you can not have multiple form tags nor can the form tages be outside
of the content tags?

Does this make since? Below is my source to the pages. Basically I need
both content tags to have form tags.

%@ Page Language="C#" MasterPageFile="~/Main.master"
AutoEventWireup="true" CodeFile="Inventory.aspx.cs" Inherits="Inventory"
Title="Enterprises, LLC" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">

<asp:Label ID="lblHeader" runat="server" Text="Welcome to our online
store, selet a Category on the left to view our products."
CssClass="NonHeaderLabel" Width="100%"></asp:Label>&nbsp;
<asp:GridView ID="gvProducts" runat="server"
AllowPaging="True"
OnPageIndexChanging = "gvProducts_PageIndexChanging"
OnRowDataBound = "gvProducts_RowDataBound"
AutoGenerateColumns="False" CellPadding="3" DataKeyNames="ProductID"
GridLines="Horizontal" PageSize="25" Width="100%"
>
<Columns>
<asp:TemplateField>
<EditItemTemplate>
<asp:TextBox ID="TextBox2"
runat="server"></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<img src='Handler.ashx?Size=S&ProductID=<%#
Eval("ProductID") %>&CompanyID=<%# Eval("CompanyID") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Title">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%#
Bind("Title") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%#
Bind("Title") %>'></asp:Label><BR>
<asp:Label ID="Label2" runat="server" Text='<%#
Bind("ProductCondition") %>'></asp:Label>
</ItemTemplate>
<ItemStyle VerticalAlign="Top" />
</asp:TemplateField>
<asp:BoundField DataField="ItemNumber" HeaderText="Item Number"
<ItemStyle VerticalAlign="Top" />
</asp:BoundField>
<asp:TemplateField HeaderText="Price">
<EditItemTemplate>
<asp:TextBox ID="TextBox3" runat="server" Text='<%#
Bind("Price") %>'></asp:TextBox>
</EditItemTemplate>
<ItemStyle VerticalAlign="Top" />
<ItemTemplate>
<asp:Label ID="lblprice" runat="server" Text='<%#
Bind("Price") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:ButtonField ButtonType="Button" Text="Details">
<ControlStyle CssClass="ButtonStyle" />
<ItemStyle Width="50px" VerticalAlign="Top" />
</asp:ButtonField>
</Columns>
<HeaderStyle CssClass="GridViewHeader" />
<AlternatingRowStyle CssClass="GridViewAltRow" />
</asp:GridView>

</asp:Content>
<asp:Content ID="Content2" runat="server"
ContentPlaceHolderID="Contentplaceholder2">

<asp:Label ID="Label1" runat="server" CssClass="HeaderLabel"
Text="Categories" Width="100%"></asp:Label>
<asp:DataList ID="dlCategories" runat="server" DataKeyField="ID">
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server"
OnCommand="CategoryButtonClick" CommandArgument='<%# Eval("ID").ToString()
%>' CommandName='<%# Eval("CategoryDescription").ToString() %>' ><%#
Eval("CategoryDescription").ToString() %></asp:LinkButton>

</ItemTemplate>
</asp:DataList>
</asp:Content>

Apr 11 '07 #2
Good question! I am new to the master pages so it appears I am using them
wrong.....
"Ben Rush" <kw*****@yahoo.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
Why is the form from within the master page not enough? Why do you need a
second/third form?

The way it works is the Page will have a single child control, the master
page, and then that control will have multiple child controls....your
content page controls. When you view the control tree as such, the form is
still part of the control tree if its specified in the master page.

....so, I'm confused why you cannot just use the form from the master
page?

--
~~~~~~~~~~~
Ben Rush
http://www.ben-rush.net/blog
"MikeB" <m@nospam.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
>Hello,

I have a content page that is from a Master page which has 2 content
panes. How do I add my forms to the content page? Each pane needs a form
but you can not have multiple form tags nor can the form tages be outside
of the content tags?

Does this make since? Below is my source to the pages. Basically I need
both content tags to have form tags.

%@ Page Language="C#" MasterPageFile="~/Main.master"
AutoEventWireup="true" CodeFile="Inventory.aspx.cs" Inherits="Inventory"
Title="Enterprises, LLC" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">

<asp:Label ID="lblHeader" runat="server" Text="Welcome to our online
store, selet a Category on the left to view our products."
CssClass="NonHeaderLabel" Width="100%"></asp:Label>&nbsp;
<asp:GridView ID="gvProducts" runat="server"
AllowPaging="True"
OnPageIndexChanging = "gvProducts_PageIndexChanging"
OnRowDataBound = "gvProducts_RowDataBound"
AutoGenerateColumns="False" CellPadding="3" DataKeyNames="ProductID"
GridLines="Horizontal" PageSize="25" Width="100%"
> >
<Columns>
<asp:TemplateField>
<EditItemTemplate>
<asp:TextBox ID="TextBox2"
runat="server"></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<img src='Handler.ashx?Size=S&ProductID=<%#
Eval("ProductID") %>&CompanyID=<%# Eval("CompanyID") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Title">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%#
Bind("Title") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%#
Bind("Title") %>'></asp:Label><BR>
<asp:Label ID="Label2" runat="server" Text='<%#
Bind("ProductCondition") %>'></asp:Label>
</ItemTemplate>
<ItemStyle VerticalAlign="Top" />
</asp:TemplateField>
<asp:BoundField DataField="ItemNumber" HeaderText="Item
Number"
>
<ItemStyle VerticalAlign="Top" />
</asp:BoundField>
<asp:TemplateField HeaderText="Price">
<EditItemTemplate>
<asp:TextBox ID="TextBox3" runat="server" Text='<%#
Bind("Price") %>'></asp:TextBox>
</EditItemTemplate>
<ItemStyle VerticalAlign="Top" />
<ItemTemplate>
<asp:Label ID="lblprice" runat="server" Text='<%#
Bind("Price") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:ButtonField ButtonType="Button" Text="Details">
<ControlStyle CssClass="ButtonStyle" />
<ItemStyle Width="50px" VerticalAlign="Top" />
</asp:ButtonField>
</Columns>
<HeaderStyle CssClass="GridViewHeader" />
<AlternatingRowStyle CssClass="GridViewAltRow" />
</asp:GridView>

</asp:Content>
<asp:Content ID="Content2" runat="server"
ContentPlaceHolderID="Contentplaceholder2">

<asp:Label ID="Label1" runat="server" CssClass="HeaderLabel"
Text="Categories" Width="100%"></asp:Label>
<asp:DataList ID="dlCategories" runat="server" DataKeyField="ID">
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server"
OnCommand="CategoryButtonClick" CommandArgument='<%#
Eval("ID").ToString() %>' CommandName='<%#
Eval("CategoryDescription").ToString() %>' ><%#
Eval("CategoryDescription").ToString() %></asp:LinkButton>

</ItemTemplate>
</asp:DataList>
</asp:Content>


Apr 11 '07 #3
:-)

If there's anything you need help with let me know.

--
~~~~~~~~~~~
Ben Rush
http://www.ben-rush.net/blog
"MikeB" <md*@nowhere.comwrote in message
news:uK**************@TK2MSFTNGP02.phx.gbl...
Good question! I am new to the master pages so it appears I am using them
wrong.....
"Ben Rush" <kw*****@yahoo.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
>Why is the form from within the master page not enough? Why do you need a
second/third form?

The way it works is the Page will have a single child control, the master
page, and then that control will have multiple child controls....your
content page controls. When you view the control tree as such, the form
is still part of the control tree if its specified in the master page.

....so, I'm confused why you cannot just use the form from the master
page?

--
~~~~~~~~~~~
Ben Rush
http://www.ben-rush.net/blog
"MikeB" <m@nospam.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
>>Hello,

I have a content page that is from a Master page which has 2 content
panes. How do I add my forms to the content page? Each pane needs a
form but you can not have multiple form tags nor can the form tages be
outside of the content tags?

Does this make since? Below is my source to the pages. Basically I
need both content tags to have form tags.

%@ Page Language="C#" MasterPageFile="~/Main.master"
AutoEventWireup="true" CodeFile="Inventory.aspx.cs" Inherits="Inventory"
Title="Enterprises, LLC" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">

<asp:Label ID="lblHeader" runat="server" Text="Welcome to our online
store, selet a Category on the left to view our products."
CssClass="NonHeaderLabel" Width="100%"></asp:Label>&nbsp;
<asp:GridView ID="gvProducts" runat="server"
AllowPaging="True"
OnPageIndexChanging = "gvProducts_PageIndexChanging"
OnRowDataBound = "gvProducts_RowDataBound"
AutoGenerateColumns="False" CellPadding="3" DataKeyNames="ProductID"
GridLines="Horizontal" PageSize="25" Width="100%"

>
<Columns>
<asp:TemplateField>
<EditItemTemplate>
<asp:TextBox ID="TextBox2"
runat="server"></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<img src='Handler.ashx?Size=S&ProductID=<%#
Eval("ProductID") %>&CompanyID=<%# Eval("CompanyID") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Title">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%#
Bind("Title") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%#
Bind("Title") %>'></asp:Label><BR>
<asp:Label ID="Label2" runat="server" Text='<%#
Bind("ProductCondition") %>'></asp:Label>
</ItemTemplate>
<ItemStyle VerticalAlign="Top" />
</asp:TemplateField>
<asp:BoundField DataField="ItemNumber" HeaderText="Item
Number"

<ItemStyle VerticalAlign="Top" />
</asp:BoundField>
<asp:TemplateField HeaderText="Price">
<EditItemTemplate>
<asp:TextBox ID="TextBox3" runat="server" Text='<%#
Bind("Price") %>'></asp:TextBox>
</EditItemTemplate>
<ItemStyle VerticalAlign="Top" />
<ItemTemplate>
<asp:Label ID="lblprice" runat="server" Text='<%#
Bind("Price") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:ButtonField ButtonType="Button" Text="Details">
<ControlStyle CssClass="ButtonStyle" />
<ItemStyle Width="50px" VerticalAlign="Top" />
</asp:ButtonField>
</Columns>
<HeaderStyle CssClass="GridViewHeader" />
<AlternatingRowStyle CssClass="GridViewAltRow" />
</asp:GridView>

</asp:Content>
<asp:Content ID="Content2" runat="server"
ContentPlaceHolderID="Contentplaceholder2">

<asp:Label ID="Label1" runat="server" CssClass="HeaderLabel"
Text="Categories" Width="100%"></asp:Label>
<asp:DataList ID="dlCategories" runat="server" DataKeyField="ID">
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server"
OnCommand="CategoryButtonClick" CommandArgument='<%#
Eval("ID").ToString() %>' CommandName='<%#
Eval("CategoryDescription").ToString() %>' ><%#
Eval("CategoryDescription").ToString() %></asp:LinkButton>

</ItemTemplate>
</asp:DataList>
</asp:Content>



Apr 11 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Nicolas Bottarini | last post: by
3 posts views Thread by Arun | last post: by
2 posts views Thread by Ronny | last post: by
3 posts views Thread by Allen Chen [MSFT] | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.