Search

You searched for the word(s): userid:670228

Matching Posts

  • Re: Accessing ContentPlaceHolderID from master page codebehind

    Thanks guys, I ended up doing it this way- Content page: < %@ Title="Page Title" Page Language= "VB" MasterPageFile= "MasterPage.master" CodeFile= "Default.aspx.vb" Inherits= "_Default" %> Master page: Protected Sub Page_Init( ByVal sender As Object , ByVal e As System.EventArgs) Handles Me .Init Me .Page.Title = Me .Page.Title & " - site name blah blah" End Sub
  • Accessing ContentPlaceHolderID from master page codebehind

    I have a website set up with multiple pages (for example Default.aspx): < %@ Page Language= "VB" MasterPageFile= "~/screen.master" AutoEventWireup= "false" CodeFile= "Default.aspx.vb" Inherits= "_Default" %> < asp:Content ID= "mainPage" ContentPlaceHolderID= "Body" Runat= "Server" > <p>Content here</p> </ asp:content > And one master page: < %@ Master Language= "VB" CodeFile= "screen.master.vb" Inherits= "screen" %> < !DOCTYPE html PUBLIC "-//W3C//DTD XHTML
    Posted to Master Pages, Themes and Navigation Controls (Forum) by roseability on 2/26/2007
    Filed under: .NET 2.0, ContentPlaceholder, master, master pages
  • Re: CodeBehind with Master Pages

    Thanks Martin. I switched PreInit to Init, and itworked. Am still finding the page life cycle a bit confusing, but practise will get me there. Cheers.
    Posted to Web Forms (Forum) by roseability on 10/8/2006
  • Re: CodeBehind with Master Pages

    I do. <asp:DropDownList ID= "DateYear" runat= "server" ></asp:DropDownList>
    Posted to Web Forms (Forum) by roseability on 10/8/2006
  • Re: CodeBehind with Master Pages

    Okay, some more research has made me slightly smarter (woo). Although this was working fine prior to adopting master pages, I don't htink that is the actual problem. I have a dropdown list in my aspx file. My codebehind file has the following in it- Sub Page_Load( ByVal sender As Object , ByVal e As System.EventArgs) Handles Me .PreInit 'Generate years for drop down menu Dim Dates As New Collections.Generic.List(Of System.DateTime) 'Dates.Add(System.DateTime.Now) If Not Me .IsPostBack
    Posted to Web Forms (Forum) by roseability on 10/5/2006
  • Re: CodeBehind with Master Pages

    Yeah I've got all the basic stuff sorted. The master pages work dandily, but as soon as I add any Codebehind functionality to a page I get an- Object reference not set to an instance of an object. I can't find an example of master pages used in conjunction with CodeBehind...
    Posted to Web Forms (Forum) by roseability on 10/4/2006
  • CodeBehind with Master Pages

    I have a web form that processes infomrtaion and then sends the information in an email, pretty simple. I changed the layout of the webform to use a masterpage as described here: http://msdn2.microsoft.com/en-us/library/system.web.ui.masterpage.aspx My application no longer runs successfuly, as changing to the masterpage approach seems to have stopped the codebehind file working with it's associated with my web form (the web form makes up the content page, while the opening and closing html tags
    Posted to Web Forms (Forum) by roseability on 10/4/2006
    Filed under: vbscript, codebehind, MasterPages
  • Re: Retreiving Label1.Text

    Thanks Martin, after adding the method to handle Me.Init it works fine. Slightly befuddled by the logic of it all, but I'm only just starting to get a grasp on the page life cycle.
    Posted to Web Forms (Forum) by roseability on 10/3/2006
  • Re: Retreiving Label1.Text

    Thanks Martin. I understand that during PreInit, the viewstate has not been restored. However I am not looking to retrieve the label1.text value during PreInit, but rather, on Submit_Click. Here is the code; Sub Page_PreInit( ByVal sender As Object , ByVal e As System.EventArgs) Handles Me .PreInit 'Generate TaskNo if this is not a postback If Not Me .IsPostBack Then Dim TaskNoYear, TaskNoMonth, TaskNoDay, TaskNoMilli TaskNoYear = System.DateTime.Now.Year TaskNoMonth = System.DateTime.Now.Month
    Posted to Web Forms (Forum) by roseability on 10/2/2006
  • Re: Retreiving Label1.Text

    I do the initial assigning of Label1.Text only once (so it is inside an if not IsPostBack loop). I am attempting to retrieve that value when the submit button is pressed (right alongside where I retrieve all the other form values successfully).
    Posted to Web Forms (Forum) by roseability on 10/2/2006
Page 1 of 2 (18 items) 1 2 Next >