Web Forms :: Writing Common / Master 'Signed In As' Style Bar?
Oct 22, 2010
I'd like to add a typical 'Signed in as' bar, cf this site.Since it's 'common', first thought is: master page.However any controls designed on a master page are only rendered 'in' the final page...... so you need the 'this' (Page reference) to access the control... so you can't write code 'on' a master page, whose 'this' is not a Page.HttpContext has Session, Request, etc - all useful but none with a 'Page' reference that I've noticedUpdatePanel looks neat, but I'd prefer a non-Ajax solution to learn the 'basic' way before perhaps later making it 'smarter' with Ajax.Question therefore is: how to write a script that is site-wide, for a master page, that references controls on the (rendered) master page, with or without a 'Page' reference.
i am using a master page in my application. i added a content page by right clicking the content place holder in the master page. I get an issue "could not load type" but when i manully changed the masterpagefile attribute it worked fine. But in the content page all the style in my master page is lost,
I had created a master page, which uses a style element in the header section. It seems that when I create a style element in the content page the style from the master is disgarded.So my question is, how can i have a css style specific to the master page carried over into content pages and how can I have content page specific css style at the same time?
I have two conditional stylesheets referenced in the head of my master page. Because the are contained in conditional comments to show for IE6 and IE7, the relative URL to the css file isn't getting rendered correctly. Is there any way to rebase the URL within conditional comments as can be done for import css references? Current code below:
I would like to programmatically access a div in a style sheet for my master page and change its height value depending on the content page loaded.
Can this be done using Javascript in the Master page or in the code behind for the respective page? What I would like is something such as this if possible
When this content page loads, change the height value of this div in the css file
I don't want to use separate Master pages as this seems to defeat the whole purpose of the Master page
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.Source Error:
Learning how to do a master page in asp.net. Trying to figure out how my style sheet interacts with respects to the master page and content page. I can get HTML tags like body and the style sheet to react. But when I call the ID attribute of a label no styling takes place. What am I missing here as far as interaction? BTW I'm using VS2008
I have a solution I'm working on in VS2010 Professional, using ASP.NET 4.0 with the AJAX Toolkit.This has been working fine, but when I started it up today, I got the runtime exception shown above. This exception occurs on any page with a control from the toolkit.Sometimes when I load a page, I get an exception "Could not load file or assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, ublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified." If I then reload the page (without making any changes), I then get the exception shown in the subject line.I tried dragging an AJAX Toolkit control from the toolbox onto a page, and then deleting it, and that worked - once. The next time I tried the page (or any other), I got the exception again. Dragging a control out didn't help this time.
Using the form view control, when I click on the edit button to modify a record. the form is in update mode. When I clcik the update button any modified data is posted, but, for some reason the name in one filed named, user_update_name, does not. The name in the field will not change unless the field was empty. For example, if test1 was the last user to modify the record and the user_update_name field was empty, the field was now say Test1. If Test2 modified the same record, Test1 name will still display in the field. The command that fires when the update button is clicked.
Imports System.Data Imports System.Data.Common Imports System.Configuration Imports System.Collections Imports System.Web Imports System.Web.Security Imports System.Web.UI Imports System.Web.UI.WebControls Imports System.Web.UI.WebControls.WebParts Imports System.Web.UI.HtmlControls Imports System.Data.SqlClient Imports Microsoft.VisualBasic Protected Sub FormView1_ItemUpdating(ByVal sender As System.Object, ByVal e As System.Web.UI.WebControls.FormViewUpdateEventArgs) Handles FormView1.ItemUpdating frmPartsDS.UpdateParameters("user_update_name").DefaultValue = User.Identity.Name End Sub
In the control Chart, I add few points, selected from the database:
var Diagram_1 = Razrez_D1.Series ["D1"]; sqlDA.SelectCommand.CommandType = CommandType.StoredProcedure; sqlDA.SelectCommand.CommandText = "Razrez_D1"; sqlDA.SelectCommand.Parameters ["@ date1"]. Value = Session ["date1"]. ToString (); sqlDA.SelectCommand.Parameters ["@ date2"]. Value = Session ["date2"]. ToString (); sqlDA.Fill (dataSet1, "Razrez_D1"); sqlDA.SelectCommand.CommandType = CommandType.Text; for (int i = 0; i <dataSet1.Razrez_D1.Rows.Count; i + +) ( string name_s = dataSet1.Razrez_D1 [i]. Name.ToString (); name_s = name_s.Substring (name_s.IndexOf ('№')). Trim (); Diagram_1.Points.AddXY (name_s, dataSet1.Razrez_D1 [i]. Count); Diagram_1.Points [i]. BorderColor = System.Drawing.Color.Black;; Diagram_1.Points [i]. BorderWidth = 1; if (Convert.ToInt32 (dataSet1.Razrez_D1 [i]. count)> 5) ( Diagram_1.Points [i]. Color = System.Drawing.Color.Red; ) else if (Convert.ToInt32 (dataSet1.Razrez_D1 [i]. count)> = 4 & & Convert.ToInt32 (dataSet1.Razrez_D1 [i]. count) <= 5) ( Diagram_1.Points [i]. Color = System.Drawing.Color.Yellow; ) else if (Convert.ToInt32 (dataSet1.Razrez_D1 [i]. count) <4) ( Diagram_1.Points [i]. Color = System.Drawing.Color.Green; ) )
The problem is that the points on the X axis are signed that way: first is not signed, second is signed, third is not signed etc How can I sigh all points?
I developped a light WinForm Control that run like an ActiveX in a Web Page. No problem yet.However, when i want to access System.IO I got a Security Exception. It seems that I have to sign my assembly, so that's what I did. When my assembly is signed, my Web Browser can't show the Winform. I set IE to download any ActiveX in the Security tab ... Nothing happens. Uncheck "Sign Assembly" ... works fine ...
<asp:Content ID="TitleContent1" ContentPlaceHolderID="PageTitlePlaceHolder" runat="Server"> My Page </asp:Content>
This works by placing the content page specific title on the page ("My Page" in this example). Now I want to add a global prefix to the title in my master page for the site name. So I want:
This is annoying, because I have to apply this style to every single thumbnail image individually, when there could be any number of them on the screen at any given time. All of the thumbnails are inside a single <div> that groups them together, and I'd like to apply a single style to the <div> that will push the attributes I need down to all of the the <img> elements nested inside, regardless how many thumbnails there are.
I am trying to open my homepage with HTTPS in my test server. Is there a way i can create Self signed certifcates and see if https works. some links or any ideas with how to do Its an ASP.Net project and IIS V6.0
I am using a Self signed certificate for HTTPS. I have it ready. what should be changed in IIS and also what should be changed in the code for https to come into affect. I need https for some pages(not all).
This is in VS 2005. And IIS is 6.0. I am trying to use Self signed certificate for HTTPS. In the code i am redirecting from http to https for few pages. It is nt working fine. and in the IIS manager, for each page that i want HTTPs, i have changed its setting by checking "Require Secure Channel(SSL)" and "Require 128 bit encryption".
public void setSecureProtocol() { string redirectUrl = null; bool bSecure = true; bool SecureConnection = true; if (bSecure && SecureConnection) redirectUrl = Request.Url.ToString().Replace("http:", "https:"); else if (!bSecure && SecureConnection) redirectUrl = Request.Url.ToString().Replace("https:", "http:"); if (redirectUrl != null) Response.Redirect(redirectUrl); }
Pages throw me an error like this The page must be viewed over a secure channel The page you are trying to access is secured with Secure Sockets
Layer (SSL).
Please try the following:
* Type https:// at the beginning of the address you are attempting to reach and press ENTER.
HTTP Error 403.4 - Forbidden: SSL is required to view this resource. Internet Information Services (IIS)Internet Information Services (IIS) When i try to put https in the start of the URl, it wont call. I have no idea whats wrong in here. Here, Its not redirecting from http to https. For the pages that i am not redirecting in the code behind, and changing in the IIS, i can see the HTTPS when i check the two checkboxes. Internet Information Services (IIS)
I have created a self signed certificate for IIS6 for my app. App works fine when I access it from the web server. But when I access the app from client machine it gives an error "The connection has timed out" on IE, and on Firefox it does not load the page.
I am using the aspnet membership features and check to make sure the user is logged in before display the page:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me .Load 'Check for UserName If Context.User.Identity.Name Is Nothing Or IsDBNull(Context.User.Identity.Name) Or Context.User.Identity.Name = String.Empty Then Response.Redirect( "~/Login.aspx" ) End If Session( "UserName" ) = Context.User.Identity.Name UserName.Text = Session( "UserName" ) UserIDValue.Text = Membership.GetUser().ProviderUserKey.ToString() End Sub
Everything was working fine when I had two separate applications (two web.config files) using the same data base and the same "applicationName" in the web.config files...............
I created a self-signed certificate for testing in IIS7 (win 7 64 bit environment ). I attached the cert to the bindings, etc and everything was fine. But when I crank up the site I get the generic error: There is a problem with this website's security certificate. Continue to this website (not recommended). What should I be looking at to fix this