Search Results

Search found 239 results on 10 pages for 'masterpage'.

Page 2/10 | < Previous Page | 1 2 3 4 5 6 7 8 9 10  | Next Page >

  • how can I prevent my SESSION to be overwritten on pageLoad of my MasterPage

    - by Darkyo
    I'm new to asp world, and I have to keep my new job :) Switching form php to asp.net 3.5 (never used before). What would be the best practice for storing a SESSION variable in my project ? How can I prevent my SESSION to be overwritten if my initialisation code is in the onPageLoad method of my MasterPage ? My variables keeps beeing overwritten, please someone help me and tell me if there is any other solution than dealing with this pageLoad problem. Thank you all

    Read the article

  • Set Masterpage from Global.asax in ASP.NET

    - by StefanE
    Hi, I want to set the Masterpage property in Global.asax. This is what I have done but I get a NullReferenceException on the first line. Any ideas how to do this? protected void Application_PreSendRequestContent(Object sender, EventArgs e) { System.Web.UI.Page page = System.Web.HttpContext.Current.Handler as System.Web.UI.Page; if (Session["lang"] == "eng") { page.MasterPageFile = "SideMasterPageEng.master"; } }

    Read the article

  • Call (show) a modal popup located in MasterPage from it's childs

    - by Vitor Reis
    I'm trying to make a default modal box that must be accessible from any part of the application, and need to be called whenever I want from inside any page. (must be called from code-behind). So I came up with the idea of a Panel + modalPopupExtender placed in the MasterPage, and calling it from child pages via code-behind. How can I do that? Or perhaps you guys have a better idea to solve this.

    Read the article

  • problem with dll file linked with masterpage

    - by sumit
    i have recently find the solution that how i can retrieve the fileupload id when page is linked with masterpage in codebehind as ContentPlaceHolder content = Page.Master.FindControl("ContentPlaceHolder1") as ContentPlaceHolder; Fileupload f=content.FindControl("FileUpload1") as FileUpload; in my contentplaceholeder1 i have a dropdownlist with id dropdownlist1 now i m trying to use it in one of the cs file of dll file as if (previousFields.ContainsKey("dropdownlist1")) { prefix = previousFields["dropdownlist1"]; } where dropdownload list is the previos field of fileupload so it checks the previos field and assign the prefix to the corresponding value.nw i want to know how can i access the dropdownlist id within contentplaceholder1 id

    Read the article

  • ASP.NET MVC Access model data in masterpage

    - by Paul
    I have created a UserSiteBaseController that gets commonly used data and sets the data to a UserSiteBaseViewData viewmodel in a method called SetViewData public T CreateViewData<T>() where T : UserSiteBaseViewData, new() { .... } I then create specific Controllers that inherit from the UserSiteBaseController as well as viewModels that inherit from UserSiteHomeViewData and can be created in the controller like so: public ActionResult Index(string slug) { Slug = slug; var viewData = CreateUserSiteHomeViewData<UserSiteHomeViewData>(); //If invalid slug - throw 404 not found if (viewData == null) return PageNotFound(); viewData.Announcements = _announcementsData.All(slug).ToList(); return View(viewData); } private T CreateUserSiteHomeViewData<T>() where T : UserSiteHomeViewData, new() { T viewData = CreateViewData<T>(); return viewData; } The UserBaseViewData holds data that needs to be use on every page so it would be great to be able to access this data from the Masterpage in a strongly typed manner. Is this possible or am I going about this in the incorrect manner?

    Read the article

  • Output asp.net masterpage webform to html email

    - by Steve McCall
    Hi I'm having a bit of a nightmare here! I'mv trying output a webform to html using page.rendercontrol and htmltextwriter but it is resulting in a blank email. Code: StringBuilder sb = new StringBuilder(); StringWriter sw = new StringWriter(sb); HtmlTextWriter htmlTW = new HtmlTextWriter(sw); page.RenderControl(htmlTW); String content = sb.ToString(); MailMessage mail = new MailMessage(); mail.From = new MailAddress("[email protected]"); mail.To.Add("[email protected]"); mail.IsBodyHtml = true; mail.Subject = "Test"; mail.Body = content; SmtpClient smtp = new SmtpClient("1111"); smtp.Send(mail); Response.Write("Message Sent"); I also tried it by rendering a single textbox and got and error saying It needed to be within form tags (which are on the masterpage). I tried this fix: http://forums.asp.net/p/1016960/1368933.aspx#1368933 and added: public override void VerifyRenderingInServerForm(Control control) { return; } But now the errror I get is: VerifyRenderingInServerForm(Control)': no suitable method found to override Does anyone have a fix for this? I'm tearing my hair out!! Thanks, Steve

    Read the article

  • Tabcontainer in Master Page not working as expected

    - by henrico
    Isn't TABCONTAINER supposed to be used in a MASTERPAGE? I started building my application in a single .aspx page with a tabcontainer to separate the different features in the application. My idea was to later break it up into individual pages with less code in each of them. I thought the use of a masterpage would be the perfect solutions... of course, this didn't work as expected. The problem is that all tabs, except the one related to the page loaded, for example tab1.aspx, are empty. If tab2.aspx is loaded, only tab2 is filled and so on. Is this a known bug or by design?

    Read the article

  • How to deploy 2 Sharepoint page leyouts

    - by mickey
    I have a problem to deploy two page layouts, I can deploy one page layout with no problem but if I add another one the first one gets the same layout as the newly added second page layout... Here is the XML I add to Elements.xml <File Path="masterpage\CustomLayout.aspx" Url="CustomLayout.aspx" Type="GhostableInLibrary" IgnoreIfAlreadyExists="TRUE" > <Property Name="Title" Value="CustomLayout" /> <Property Name="ContentType" Value="$Resources:cmscore,contenttype_pagelayout_name;" /> <Property Name="PublishingPreviewImage" Value="~SiteCollection/_catalogs/masterpage/$Resources:core,Culture;/Preview Images/CustomPageLayout.png, ~SiteCollection/_catalogs/masterpage/$Resources:core,Culture;/Preview Images/CustomPageLayout.png" /> <Property Name="PublishingAssociatedContentType" Value=";#$Resources:cmscore,contenttype_articlepage_name;;#0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900242457EFB8B24247815D688C526CD44D;#"/> </File> <File Path="masterpage\HomePageLayout.aspx" Url="HomePageLayout.aspx" Type="GhostableInLibrary" IgnoreIfAlreadyExists="TRUE" > <Property Name="Title" Value="HomePageLayout" /> <Property Name="ContentType" Value="$Resources:cmscore,contenttype_pagelayout_name;" /> <Property Name="PublishingPreviewImage" Value="~SiteCollection/_catalogs/masterpage/$Resources:core,Culture;/Preview Images/CustomPageLayout.png, ~SiteCollection/_catalogs/masterpage/$Resources:core,Culture;/Preview Images/CustomPageLayout.png" /> <Property Name="PublishingAssociatedContentType" Value=";#$Resources:cmscore,contenttype_articlepage_name;;#0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900242457EFB8B24247815D688C526CD44D;#"/> </File> <File Path="masterpage\masterpage.master" Url="masterpage.master" Type="GhostableInLibrary" IgnoreIfAlreadyExists="TRUE" > <Property Name="Title" Value="My Custom masterpage" /> <Property Name="ContentType" Value="$Resources:cmscore,contenttype_pagelayout_name;" /> <Property Name="PublishingPreviewImage" Value="~SiteCollection/_catalogs/masterpage/$Resources:core,Culture;/Preview Images/back.jpg, ~SiteCollection/_catalogs/masterpage/$Resources:core,Culture;/Preview Images/back.jpg" /> <Property Name="PublishingAssociatedContentType" Value=";#$Resources:cmscore,contenttype_articlepage_name;;#0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900242457EFB8B24247815D688C526CD44D;#"/> </File> <File Path="masterpage\masterpage2.master" Url="masterpage2.master" Type="GhostableInLibrary" IgnoreIfAlreadyExists="TRUE" > <Property Name="Title" Value="My Custom masterpage 2" /> <Property Name="ContentType" Value="$Resources:cmscore,contenttype_pagelayout_name;" /> <Property Name="PublishingPreviewImage" Value="~SiteCollection/_catalogs/masterpage/$Resources:core,Culture;/Preview Images/back.jpg, ~SiteCollection/_catalogs/masterpage/$Resources:core,Culture;/Preview Images/back.jpg" /> <Property Name="PublishingAssociatedContentType" Value=";#$Resources:cmscore,contenttype_articlepage_name;;#0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900242457EFB8B24247815D688C526CD44D;#"/> </File>

    Read the article

  • Visual Studio's CSS Intellisense - Absolute paths & MasterPage files

    - by Overflew
    Hi there. I've noticed that to get CSS-Intellisense working in VS, the paths have to be relative - Is this the case? However, it seems <link href="/resources/test.css" [...] /> is far more practical than <link href="resources/test.css" [...] /> I'm including the CSS in the master page, and don't see much good in including it as a content block, just to get the relative paths correct for each directory depth. I've had a quick try with inline code resolving the path, but no dice there either (for Intellisense). I feel I'm missing something fairly simple - What's the correct approach here to have CSS Intellisense work across the pages in the app during dev, and render fine in any deployed state? Cheers. (Note - I'm aware that a <% if (false) { % type hack is required for user controls)

    Read the article

  • Recaptcha being triggered from masterpage control

    - by superexsl
    Hey, I have a master page which contains a Login control so that the user can login/logout from any page. However, a couple of content pages require a Recaptcha control. This causes problems because when I try and log in on a page that has the Recaptcha control, the system expects me to enter the words. I'm aware of the lack of validation groups in the Recaptcha control, and the fact that you can't have multiple forms on an ASP.NET page. Is there a way to work around this? A 'hacky' way I can think of, is in the "Login" event, check the page for a Recaptcha control. If one exists, then disable it, otherwise continue. However, that just seems quite inefficient especially when there are quite a few pages and most won't have a Recaptcha control.

    Read the article

  • MasterPage Page_Load hits before Grid_ItemCommand

    - by Raheel Khan
    I am using the session object to store success/error messages based on user actions. On each postback, the message is set on ItemCommend and retrieved on the Page_Load of the master page. Once retrieved, the message is deleted from the session. The problem is that the master page's Page_Load gets called before the ItemCommand gets called so the message does not show up until the next refresh or postback. How is this situation normally handled? Is there some other event we can code against?

    Read the article

  • very simple WebForm with masterpage

    - by Ryan
    I use method=get to send my data from one webform to the other. But I don't want to have in the URL querry things like: Search.aspx?_EVENTTARGET=&_EVENTARGUMENT=&_VIEWSTATE=%2FwEPDwUKLTYwODIwNTg5MQ9kFgJmD2QWAgIDDxYCHgZtZXRob2QFA2dldGRkGOirvzjoAxt%2BfOb915%2FpsYZXmAxLZZdpnK6UW7A9%2Fk83D&_PREVIOUSPAGE=cog5Yzt_1GerH9r2ERTIPbLWMCwMFYteZjmDYCbBO3vobCG4C_mWM7GZMNuBesyAjw77cvuNKl_aSUYzeajiW6W0CjI0tLB6ikjcM4t5Kbg1&__EVENTVALIDATION=%2FwEWAgKYsPjPDQKY24%2FQBBH4CPejKl3spy0A%2BtpMxb%2BCGVGJf73dYtmaEnIFF4IR&name=Amy&state=24&ctl00%24MainContent%24submit=Searchbut i only want the name and the state to be in the Get querry like: ?name=Amy&state=24 <configuration> <authentication mode="Forms"> <forms loginUrl="~/Account/Login.aspx" timeout="2880" /> </authentication> <membership> <providers> <clear/> <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" /> </providers> </membership> <profile> <providers> <clear/> <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/> </providers> </profile> <roleManager enabled="false"> <providers> <clear/> <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" /> <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" /> </providers> </roleManager> </system.web> <system.webServer> <modules runAllManagedModulesForAllRequests="true"/> </system.webServer> </configuration>

    Read the article

  • How to make a particular information to be accessible at masterpage, page and usercontrol

    - by Ismail S
    I'm fetching some settings out of the database based on a value passed from a query string. Out of these settings, a few will be used in master page, few on my Page and few in my user control (say login control which is a web user control). I've an entity class MySetting for it and there is a method in my data access layer which returns me an instance of MySetting when I pass the value I got in query string. I don't want to fetch settings from the database multiple times for one request. I'm using asp.net web forms with C# and sql server.

    Read the article

  • Hilighting div tag in Masterpage on redirection to content page

    - by user1713632
    I have a link in Master page within a div tag. I want to highlight the div when I am clicking the link, in order to redirect to some content page. I have written the following code: <li> <div id="div_test" runat="server"> <asp:LinkButton ID="lnk_test_menu" Font-Underline="false" ForeColor="Black" runat="server" Text="Test Link" CausesValidation="false" onclick="lnk_test_menu_Click1" > </asp:LinkButton></div> </li> Code in the cs page: protected void lnk_test_menu_Click1(object sender, EventArgs e) { div_test.Attributes.Add("class", "testSelected"); Response.Redirect(Test.aspx"); } The div in the master page is not being selected on redirection. Could anybody help me on this?

    Read the article

  • FIndcontrol doesn't seem to work inside a baseclass....

    - by Pandiya Chendur
    I use LinkButton linkBtn = (LinkButton)FindControl(ControlID); inside a method in my baseclass... This works within a normal aspx page when given, LinkButton linkBtn = (LinkButton)FindControl("lnkBtn1"); But when it is a contentpage included within a masterpage it doesn't work... LinkButton linkBtn = (LinkButton)FindControl("ctl00_ContentPlaceHolder1_lnkbtn"); i get the error Object reference not set to an instance of an object.

    Read the article

  • Using C# FindControl to find a user-control in the master page

    - by Jisaak
    So all I want to do is simply find a user control I load based on a drop down selection. I have the user control added but now I'm trying to find the control so I can access a couple properties off of it and I can't find the control for the life of me. I'm actually doing all of this in the master page and there is no code in the default.aspx page itself. Any help would be appreciated. MasterPage.aspx <body> <form id="form1" runat="server"> <div> <asp:ScriptManager runat="server"> </asp:ScriptManager> </div> <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false" OnLoad="UpdatePanel2_Load"> <ContentTemplate> <div class="toolbar"> <div class="section"> <asp:DropDownList ID="ddlDesiredPage" runat="server" AutoPostBack="True" EnableViewState="True" OnSelectedIndexChanged="goToSelectedPage"> </asp:DropDownList> &nbsp; <asp:DropDownList ID="ddlDesiredPageSP" runat="server" AutoPostBack="True" EnableViewState="True" OnSelectedIndexChanged="goToSelectedPage"> </asp:DropDownList> <br /> <span class="toolbarText">Select a Page to Edit</span> </div> <div class="options"> <div class="toolbarButton"> <asp:LinkButton ID="lnkSave" CssClass="modal" runat="server" OnClick="lnkSave_Click"><span class="icon" id="saveIcon" title="Save"></span>Save</asp:LinkButton> </div> </div> </div> </ContentTemplate> <Triggers> </Triggers> </asp:UpdatePanel> <div id="contentContainer"> <asp:UpdatePanel ID="UpdatePanel1" runat="server" OnLoad="UpdatePanel1_Load" UpdateMode="Conditional" ChildrenAsTriggers="False"> <ContentTemplate> <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"> </asp:ContentPlaceHolder> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="lnkHome" EventName="Click" /> <asp:AsyncPostBackTrigger ControlID="rdoTemplate" EventName="SelectedIndexChanged" /> </Triggers> </asp:UpdatePanel> </div> MasterPage.cs protected void goToSelectedPage(object sender, System.EventArgs e) { temp1 ct = this.Page.Master.LoadControl("temp1.ascx") as temp1; ct.ID = "TestMe"; this.UpdatePanel1.ContentTemplateContainer.Controls.Add(ct); } //This is where I CANNOT SEEM TO FIND THE CONTROL //////////////////////////////////////// protected void lnkSave_Click(object sender, System.EventArgs e) { UpdatePanel teest = this.FindControl("UpdatePanel1") as UpdatePanel; Control test2 = teest.ContentTemplateContainer.FindControl("ctl09") as Control; temp1 test3 = test2.FindControl("TestMe") as temp1; string maybe = test3.Col1TopTitle; } Here I don't understand what it's telling me. for "par" I get "ctl09" and I have no idea how I am supposed to find this control. temp1.ascx.cs protected void Page_Load(object sender, EventArgs e) { string ppp = this.ID; string par = this.Parent.ID; }

    Read the article

  • ASP.NET MVC 2 form submit route issue

    - by Tomaszewski
    Hi, i'm having this issue, in ASP.NET MVC 2 where I'm adding a drop down list on the master page and filling it with data from an abstract master controller. When an option is selected an submit button clicked, it reroutes you to a new page. so lets say the page lives on http://domain.com/landingPage i'm on: http://domain.com/landingPage i select option and submit takes me to http://domain.com/landingPage/Projects/FramedPage i select again and now the post tries to go to: http://domain.com/landingPage/Projects/landingPage/Projects/FramedPage because of the action="" i have set on the form tag. Any ideas on how to go about this? MasterPage: <form method="get" action="landingPage/Projects/FramedPage"> <%= Html.DropDownList("navigationList")%> <input id="navSubmitBtn" class="btnBlue" type="submit" value="Take Me There" /> </form> Projects Controller public ActionResult FramedPage(string navigationList) { ViewData["navLink"] = navigationList; return View(); } The problem i am having is that if I am ON that page

    Read the article

  • hiding buttons in master page

    - by pankaj
    Hi, I am working on an app where i am having some linkbuttons in master page. I want to display them depending upon the authorization given to them once they logs in. I have initially made all of them visible false and then i am checking the authorisation in the aspx.cs class of master page. I make the link button visible depending upon the right granted to the user. But it is making all the link buttons visible. Instead it should only make two of them visible and rest should be hidden. Following is my code from MasterPage.aspx.cs: ArrayList arrlstUserRoles = new ArrayList(); arrlstUserRoles = (ArrayList)Session["Roles"]; for (int j = 0; j < arrlstUserRoles.Count; j++) { if (int.Parse(arrlstUserRoles[j].ToString()) == 1) { lbtnRetailer.Visible = true; } else if (int.Parse(arrlstUserRoles[j].ToString()) == 2) { lbtnCategory.Visible = true; } else if (int.Parse(arrlstUserRoles[j].ToString()) == 3) { lbtnCouponTemplate.Visible = true; } else if (int.Parse(arrlstUserRoles[j].ToString()) == 4) { //lbtnStoreManagement.Visible = true; } else if (int.Parse(arrlstUserRoles[j].ToString()) == 5) { lbtnStoreManagement.Visible = true; } else if (int.Parse(arrlstUserRoles[j].ToString()) == 6) { lbtnContentManagement.Visible = true; } else if (int.Parse(arrlstUserRoles[j].ToString()) == 7) { //lbtnStoreManagement.Visible = true; } }

    Read the article

  • Control 'ctl00_TextBox1' of type 'TextBox' must be placed inside a form tag with runat=server.

    - by Hiru
    When a form with a run at server is added there will be two forms with runat server and another error occurs. Can some one give me an idea. Thankx in advance. The details of the error are as follows. Control 'ctl00_TextBox1' of type 'TextBox' must be placed inside a form tag with runat=server. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Web.HttpException: Control 'ctl00_TextBox1' of type 'TextBox' must be placed inside a form tag with runat=server. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [HttpException (0x80004005): Control 'ctl00_TextBox1' of type 'TextBox' must be placed inside a form tag with runat=server.] System.Web.UI.Page.VerifyRenderingInServerForm(Control control) +2052287 System.Web.UI.WebControls.TextBox.AddAttributesToRender(HtmlTextWriter writer) +49 System.Web.UI.WebControls.WebControl.RenderBeginTag(HtmlTextWriter writer) +17 System.Web.UI.WebControls.TextBox.Render(HtmlTextWriter writer) +17 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25 System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +199 System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +20 System.Web.UI.Control.Render(HtmlTextWriter writer) +7 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25 System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +199 System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +20 System.Web.UI.Page.Render(HtmlTextWriter writer) +26 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25 System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2558 Version Information: Microsoft .NET Framework Version:2.0.50727.1873; ASP.NET Version:2.0.50727.1433

    Read the article

  • IIS7 Rewrite changing default button

    - by Skoder
    Hey, I've run into a strange problem regarding default buttons in master pages and IIS7 rewrite module. All my content pages have default buttons set in the code-behind (on prerender), or they are in panels on the aspx page. This works fine on my local machine and on the production server. However, when I enable IIS7 URL Rewrite, the default button is always to the one in the master page. protected void LoginButton_PreRender(object sender, EventArgs e) { Button btnDefault = sender as Button; this.Page.Form.DefaultButton = btnDefault.UniqueID; } That's how I set my default button in the code-behind. I'm not sure what the rewrite module could be doing. Thanks for any help

    Read the article

  • Master page property access from Content page.

    - by Manish
    FROM BOOK: To reference public properties in a master page, we add the @MasterType declaration to the content page and reference the property using Master.<PropertyName>. QUESTION: But what happens internally? Does all of the master's and content page's properties, function gets complied into one class? Or something else?

    Read the article

  • ASP.NET declare a CSS stylesheet one time only

    - by Grant
    Hi, if i have a single CSS stylesheet for a website and only want to declare it once, that is, not use the following code on every aspx page.. <link href="stylesheets/general.css" rel="stylesheet" type="text/css" /> Am i forced to use a .master page? or is there another way to do this..

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10  | Next Page >