master-pages

Contentplaceholder for replacing attributes?

萝らか妹 提交于 2019-12-13 19:28:47
问题 The code below works but confuses Visual Studio. Are there alternative/better ways to accomplish this? <body <asp:contentplaceholder id="BodyAttribute" runat="server"/>> 回答1: Other way <asp:contentplaceholder id="BodyAttribute" runat="server"><body></asp:contentplaceholder> and on contentPlaceholder you type <body attr="whatever"> If not place holder found, then the <body> is used. 回答2: I don't think doing this is a good idea in general. First of all, with ContentPlaceHolder s you can easily

how to make masterPage contents visible based on role?

吃可爱长大的小学妹 提交于 2019-12-13 16:06:12
问题 I am developing an application with masterPage. I want to put loginStatus, LoginName controls into masterPage. now, I want these loginStatus and LoginName controls be visible only if the user is admin. (admin will exclusively navigate to login page and no Login/logout link, logged in username should be shown for non-admins) how can I achieve this? 回答1: There is a LoginView, which supports roles: <asp:LoginView ID="LoginView1" runat="server"> <RoleGroups> <asp:RoleGroup Roles="Admin"> </asp

Asp.net dynamic User and activity based authorisation mixed with hide show site master html

可紊 提交于 2019-12-13 09:23:39
问题 I am failing to find good examples of user and activity based authorization for my ASP.NET web forms site. Currently, i am using user roles in web config to allow/deny access to pages within folders. But this method is proving to be a nightmare to maintain, especially when users come up with special case scenarios, which completely deviate from existing role permissions. So i am looking for a way to be able to store and retrieve user access rights, from the database and then enforce them on

Master menu is not visible on mobile devices but is visible on InternetExplorer

帅比萌擦擦* 提交于 2019-12-13 09:06:35
问题 I'm working on a SAPUI5 App showing some data in a MasterDetailView using the sap.m.splitapp. My Problem is quit equal to the question Master menu is not visible on mobile devices but is visible on tablet. In my case, I have the situation, that I'm going to create a MasterPage with a MasterController depending on requested data. Depending on these data I create dynamically the DetailPages in a function of the MasterController. for(var i=0;i<adata.inhaltList.length;i++){var DetailPage = new

Design Pattern for error handling in ASP.NET 3.5 site

℡╲_俬逩灬. 提交于 2019-12-13 07:07:50
问题 I am relatively new to ASP.NET programming, and web programming in general. We have a site we recently ported from .NET 1.1 to 3.5. Currently we have two methods of error handling: either catching the error during data load on a page and displaying the formatted error in a label on the page, or redirecting to a generic error page. Both of these are somewhat annoying, as right now I'm trying to redesign how our errors are displayed. We are soon moving to Master pages, and I'm wondering if

Get Textbox Value from Masterpage using c#

ⅰ亾dé卋堺 提交于 2019-12-13 05:26:06
问题 I have a search textbox situated on a masterpage like so: <asp:TextBox ID="frmSearch" runat="server" CssClass="searchbox"></asp:TextBox> <asp:LinkButton ID="searchGo" PostBackUrl="search.aspx" runat="server">GO</asp:LinkButton> The code behind for the search page has the following to pick up the textbox value (snippet): if (PreviousPage != null && PreviousPage.IsCrossPagePostBack) { Page previousPage = PreviousPage; TextBox tbSearch = (TextBox)PreviousPage.Master.FindControl("frmSearch");

How do I access properties from page in ContentPlaceholder in my MasterPage

旧巷老猫 提交于 2019-12-13 03:46:43
问题 I have following environment: masterpage with a contentPlacholder multiple pages which use this masterpage and implement a base-class ( fooPage ) fooPage has a certain property ( fooProperty ) Now i want to do something like public partial class FooMaster : System.Web.UI.MasterPage { // this is originally from the designer-file protected global::System.Web.UI.WebControls.ContentPlaceHolder ContentPlaceHolder; protected override void OnPreRender(System.EventArgs e) { var fooPageInstance = this

how to use request.form[] in inherited web form

早过忘川 提交于 2019-12-13 03:44:29
问题 I have a Master page and one web form inherited from that master page, the tag is in master page which contains a content place holder inside Master Page: <form runat="server"> <asp:ContentPlaceHolder ID="MainContent" runat="server" /> </form> the web form implement that content place holder. WebForm.aspx: <asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"> <asp:TextBox ID="tbAmount" runat="server" /> </asp:content> in the code behind web form, I wanna use Request

How to specify path relative to current Master Page File

有些话、适合烂在心里 提交于 2019-12-13 03:39:41
问题 I am new to asp.net but Master Pages seem to do what I need - allow me to configure different templates/presentations/styles in runtime, so my app may take on a different look and feel by selecting a different Master Page. Each Master Page sits in its own folder with a set of images tailored for that "template" - I then want, in content pages, to reference various images sitting in the folder of the currently selected Master Page, for example the navigation buttons in a DataPager: <asp

Loading another Page in Content Page is not Working in ASP.NET with EXT.NET

て烟熏妆下的殇ゞ 提交于 2019-12-13 02:42:04
问题 I am working with Asp.Net 3.5 and Ext.Net 1.0. I had created One Master Page(Site.master) and one content page(User.aspx) in my Application and I am loading one page(UserManager.aspx) into content page If I put normal HTML tags into UserManager.aspx that works fine but if i put EXt.NET controls in it I wont work.. MasterPage <ext:Panel ID="Panel6" runat="server" Region="Center" CollapseMode="Mini" Margins="0 0 4 4"> <Content> <asp:ContentPlaceHolder ID="cntMainCenter" runat="server"> </asp