Css - Modifying App's Global Visual Identity Without A Master Page?
Nov 23, 2010
I've to fix an old ASP.NET application's appearance so that it can conform to the new web visual identity of my organization. The old application does not have any master page and uses a very basic .include file. Modifying the .include header does not change the overall look of the app's pages much, and I still have to manually import new css definitions, replace the table tags with divs on the 60 odd .aspx pages.How should I proceed? I have long term maintainability in mind, so a master page is the obvious solution.
I'm trying to access User.Identity from my master page so I can figure out which user is logged in, however I can't get it to work. If I import System.Security.Principal in my master page it makes no difference:
When I use a Master Page with a Content Page, in the Content Page script I find that User object is defined, with Identity and IsInRole properties. However, when I enter script on the Master Page itself User comes up as "not declared".
I am guessing that User is embedded in some namespace that is automatically imported to Content pages, but haven't been able to track it down.
How do I need get the variable in the master page?
1. after Login.aspx get the information of the user 2. redirect to home.aspx 3. in home.aspx, view the info like Label1.text ="Welcome " + varUser; 4. Label1 is located in the master page 5. this varUser will display in all my pages 6. I don't want to use the full Session["var"] (because of expiration)
*in short I just want to get the var in the master page everytime I load a new page (WITH MULTIPLE UNIQUE USERS)
In the website we have several folders, some folders are accessible by anonymous users, others are accessible by members only, some by administrators or a both administrators and members can view this folder. Each folder contains some forms; these forms are based on the role as well. We'd like to add "user.identity" as to authenticate the user based on the user_id from table websit_ users.
However we are not sure , wither we need to specify each and every form, folder or this will be done automatically once authentication is applied. And where do we put the user.identity and what is the exact format of it. Do we include it in our Global.asax after the authentication part?! This is the code in global.asax:
Context is Null at this point. I am a noob in ASP.NET with regards to Global.asax.cs. This code was written by another developer. EDIT: This is the code with HttpContext...
In the original site, master page has code-behind to check a query string parameter value. Depending on this value, code-behind dynamically modify some CSS property to hide / display master page elements.
As MVC2 has no code-behind because we are supposed to perform everything in the controllers, how should I proceed in this case ?
I see this : [URL]
It partially answers my needs but the query string processing is common to all pages. How can I move this processing in a common code section ?
But when i go to Design View of the page (for creating the events automatically or for drag/drop any new control from toolbox, I don't want to type everything) the design view only shows the master page! the page controls are complete ignored!
Editing a web site project with master page in VS2010Ultimate with SP1 and Win7Ultimate 64 bit. Former everything was working fine - all toolbox windows were available when editing master page or aspx page. Now with the master page all toolbox relevant tab were enabled and show - when switching to a aspx page only the HTML tab is shown and enabled. When checking all "Show all" all expected tabs are disabled.
Even the <asp:> namespace is a unrecognized namespace in the aspx file.
When compiling or debugging/running everything is ok.
How can I solve this problem? I'm using Win7 Ultimate 64 Bit, VS2010 Ultimate and IExplorer 9 and the latest updates from Microsoft.
This is the content in the master page as you can see there are 4 menu items i tried to form as sidebar and i tried to inherit in home.aspx(one of the content pages) as follows:
But unfortunately the sidebar is not at all getting displayed. I know i'm doing fundamentally wrong some where. My intention is to have web pages to have sidebar like this. It is a screenshot of my intended page.
When editing a UserControl (.ascx) in my project, it forces a rebuild of the website when requesting the page. This really gets annoying when programming any large project, the build time goes up to 15sec+.
In the last few days I found myself looking at a blank screen more often than programming. This gets frustrating, all the waiting.
I created a web site in visual studio 2008, the languaje is C#. After that, I created a master page for my web forms. The problem is: When I generate a new web form and choose the master page, the new web form can't display the content of the master page in designer mode or in the browser (by example, my web form is located in a directory called Users and master page is located in a directory called MasterViews. Only I can display them, if both files are in same location.
I reviewed the path of master page in the page directive, I changed the path with the same result.
Downloaded and installed vwd.net I downloaded the stuff from asp.net and now when i create a new project it is based on the site master from asp.net. that's nice, but i want to get back to the delivered defaults. how do i turn it off so that when i create a project, it's empty?
I have two master pages: TopLevelMaster and NestedMaster
When my page points to NestedMaster as it's master page, intellisense quits working in the .aspx page.
If I change my page to use TopLevelMaster as it's master page, intellisense works.
No matter what I use as the master I always get a green squiggly underline under the Content control that brings up a tooltip that says "Could not find ContentPlaceHolder1" in the current master page or pages"
TopLevelMaster exists in a different project than NestedMaster and the page.
When I say "intellisense quits working" here is what happens:
If I type something between the Content tags I get no intellisense for asp controls:
Only html controls appear upon typing an open angle bracket here
</asp:Content>
If I instert a div element I can type an opening angle bracket and I see a list of all asp controls. If I choose one and start typing there is no intellisense after that:
<asp:Content ID="Content1" runat="server" etc.., etc..> <div> ASP controls appear but no intellisense other than asp:ControlName </div> </asp:Content>
Opening one or both master pages in the IDE has no effect.
I am using vb.net/asp.net 2005. I have a master page that displays a child content page. The child content page contains a user control that I created. In the user control I would like to access a variable that is set in the Master page.
I have a webform named Default.aspx and in it an iFrame...
The iFrame will load one of a few different pages/forms/aspx... (for this example lets just say its test.aspx)
On test.aspx I have 2 buttons Button1 and Button2 If I have code in my test.aspx.vb for Button1 click of:
button2.text = "hello world"
it looks as if it reloads test.aspx inside the iFrame and sure enough Button2 states "hello world"
So now lets say on the Default.aspx I also have a button and its named Button5.
How would I go about updating the Button5.Text from with in the vb code of Button1 click/vb code located on Test.aspx
I have looked over some other post [URL] and the tell of using "PreviousPage" but that not seam to be what I need, I want to be able to state the page/form I want to effect a control on it...
I know how to do this in jut standard VB.net (not web) its like:
FromName.ControleName.Text = "Hello World" but then again in VB.net windows apps you dont have Iframse to deal with...
We have a nested master page which we have made it as a seperate class library.(Becoz many projects use the same master page) Initially we had all our css files,skin files, images inside the Master page project itself. But now we wanted the themes to be global and moved it out to wwwroot as mentioned in the below link.
The Masterpage has user controls out of which one user control has the telerik menu. The css is not getting set for that particular user control. We use relative path for setting the style sheet link. But it is not getting set. Its still referring to the old path. But all the skin files, images are pointing to the new global location. Except for the telerik menu rest all is aligned according to the style sheet.
When i do view source, the link to style sheet is pointing to the old location. I dunno why this happening. Is this a telerik issue or i am going wrong somewhere.
I have an MVC 2.0 environment in a S#arp layout, everything works great, and I have Intellisense working in my aspx file (for things like HTML helpers and Model properties) As soon as I add the line:
[Code]....
To my web.config, I lose Intellisense on my aspx files! Does anyone have any idea of why this is happening? Or have any experience with this?
I have a master page containing a tree and 3 dropdown lists. I am populating a context menu on right click of each node, and when clicked on any item of the context menu, it navigates to required pages.
My problem is after navigating to the required page, the selected values from the drop down lists and the selected node from the tree are getting cleared.
I can set the selected values for the dropdown lists by making some properties in master page. But how do i maintain the selected node?
In my content page, i have got the valuepath of the right clicked node.
Or is there any other way than setting the properties in master page?
I have a label on the master page that is updated by the contents pages. Rather then create a content placeholder that will contain only this label, I was hoping to be able to modify it directly. I have the label called lblYAO on the masterpage, and in the code behind I have
Public Sub DisplayDataFromPage(ByVal message As String) lblYAO.Text = message End Sub
I know I can modify the page directive on the content pages, but there is another person who will be adding pages, and this may be a bit much for him. In the content page's code behind, I would like to do something like Page.Master = "something" but I understand I have to explicitly cast it to the appropriate type first? This is as far as the examples I've seen have gotten me. I haven't seen any casting examples.
I am developing a asp.net application and i am using SQL Server 2008. I took a IDENTITY column as Record_ID for detail table where i will have trillions of records per year. So just want to ask whats the largest number record id (identity) column can hold and in ASP.NET which data type i should use to handle record id as i am using this id as a reference to update the table data. I don't want to end up being trapped some day.