I am programming an ASP.NET application that has different modules (each one with different styles and master pages), but there are some pages that I need to share between the modules.
我正在编写一个具有不同模块的ASP.NET应用程序(每个模块具有不同的样式和母版页),但是我需要在模块之间共享一些页面。
How do I share a page between two different modules in an ASP.NET application?
如何在ASP.NET应用程序中的两个不同模块之间共享页面?
1 个解决方案
#1
This might be a candidate for pulling out the "Search" component of the page into a user control and adding a "Search-Mode" property to it.
这可能是将页面的“搜索”组件拉出到用户控件并向其添加“搜索模式”属性的候选者。
You can have different search_X.aspx pages with different output/styling/gridview columns etc...
您可以使用不同的search_X.aspx页面,其中包含不同的输出/样式/ gridview列等...
and you could define your control on each different search page with a different Search-Mode
并且您可以使用不同的搜索模式在每个不同的搜索页面上定义您的控件
e.g.
<myctl:Search ID="searchCustomers" runat="server" SearchMode="CustomerPurchases" />
or
<myctl:Search ID="searchCustomers" runat="server" SearchMode="CustomerDetails" />
Then have your page bind to some event on that control that gets back the SearchClause/DataSource etc for binding to your display list
然后将您的页面绑定到该控件上的某个事件,该事件将返回SearchClause / DataSource等以绑定到您的显示列表
#1
This might be a candidate for pulling out the "Search" component of the page into a user control and adding a "Search-Mode" property to it.
这可能是将页面的“搜索”组件拉出到用户控件并向其添加“搜索模式”属性的候选者。
You can have different search_X.aspx pages with different output/styling/gridview columns etc...
您可以使用不同的search_X.aspx页面,其中包含不同的输出/样式/ gridview列等...
and you could define your control on each different search page with a different Search-Mode
并且您可以使用不同的搜索模式在每个不同的搜索页面上定义您的控件
e.g.
<myctl:Search ID="searchCustomers" runat="server" SearchMode="CustomerPurchases" />
or
<myctl:Search ID="searchCustomers" runat="server" SearchMode="CustomerDetails" />
Then have your page bind to some event on that control that gets back the SearchClause/DataSource etc for binding to your display list
然后将您的页面绑定到该控件上的某个事件,该事件将返回SearchClause / DataSource等以绑定到您的显示列表