.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Facing Issues to change the Masterpage using HttpModule.

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :.NET Framework


    I am working on SharePoint2010 for to change the Masterpage dynamically using HttpModule interface,

I have refereed this article http://vspug.com/dwise/2007/01/08/one-master-to-rule-them-all-two-actually

As per that i have followed all the steps, but still i am facing issue in changing the masterpage & not getting any kind of error message or warring.

Can anyone have any idea to find the issues & get resolved?



 Aamer Yafai.

(Software Engineer-PSL)&

View Complete Post

More Related Resource Links

Facing MSDTC related issues while archiving data from one database server machine to another databas

I have a question with respect to distributed transactions when carried out between two database server machines on the same network.   Consider there are two database server machines \SOURCE_DATABASE_SERVER\ and \DESTINATION_DATABASE_SERVER\. Now we have to archive the data from one database server to other database server.   Let us suppose the database server \SOURCE_DATABASE_SERVER\ is the live production database server and \DESTINATION_DATABASE_SERVER\ is Long term storage database server. Now data from \SOURCE_DATABASE_SERVER\ needs to be archived into the database server \DESTINATION_DATABASE_SERVER\.   So I have written a dynamic stored procedure which includes distributed transaction (begin Tran, commit Tran, rollback            Tran) coding in it.   Now initially when I executed the procedure, it gave some of the following errors   1) OLE DB provider "SQLNCLI" for linked server "\DESTINATION_DATABASE_SERVER\" returned message "The partner transaction manager has disabled its support for remote/network transactions.". Msg 7391, Level 16, State 2, Line 1 The operation could not be performed because OLE DB provider "SQLNCLI" for linked server "\DESTINATION_DATABASE_SERVER\" was unable to begin a distributed transaction.    

Internet facing SharePoint site - user shouldn't have to log in to change the langague

Hello, I am using SharePoint 2010 for Internet sites.  Anonymous access has been enabled.  Language packs have been installed so that users can switch to different languages as required.  However, the only way for a different language to be selected other than the default is for the user to log into the site and then the option would be displayed.....This is an internet facing site with anonymous access therefore users shouldn't have to log in to change the language.  Can someone guide/advise on switching the lanuguage of the site without loggin in. Thanks, Shelley

Masterpage with header and footer and buttons on header to change between silverlight and asp pages.

Hi, I would like to create a master page with a header and footer. The header contains buttons which call either an ASP page or Silverlight page. I want to be able to select a page and the relevant page is loaded. The problem I am facing is that the footer does not dock to the bottom unless I include a fixed height. Can someone help as to the best way of doing this. I am not sure if I need to use a masterpage for this or just a simple page? The following is my code on the master page:<head runat="server"> <title>Staff Profiles</title> <asp:ContentPlaceHolder ID="head" runat="server"></asp:ContentPlaceHolder> <link href="CSS/mainpage.css" rel="stylesheet" type="text/css" /> </head> <body> <form id="form1" runat="server" > <div id="container"> <div class="mainHeader" align="center"> <table width="920" height="120" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="10" rowspan="2"><img src="images/Header_01.jpg" alt="" width="10" height="120" /></td>

Using HttpModule to change master page dynamically on SharePoint 2010 site


I am trying to change master page dynamically on SharePoint 2010 site. I reviewed some documents (SharePoint: Dynamically Change Master Page: http://ranaictiu-technicalblog.blogspot.com/2009/10/sharepoint-dynamically-change-master.html) and I implemented IHttpModule, added it to GAC, modified web.config(safecontrol, httpmodule, module)
It works good! But I found some problems
1.Never catch the PreInit event for publishing pages
2."/_Layouts/RedirectPage.aspx" page occurred error
3.ContextMenu did not work

using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Web.UI;
using Microsoft.SharePoint;
using System.Configuration;
using Microsoft.SharePoint.ApplicationRuntime;

namespace MasterUtilModule
    public class MasterModule : IHttpModule
        public void Dispose() { }
        public void Init(HttpApplication context){

Masterpage issues


Hey people,


I've got an interesting one here - I honestly don't think I've had this issue before.


My folder system looks something like this (as noobish as it may be):

  • -Root
  • ../Pages
  • ../Pages/Admin
  • ../Pages/OtherFolder
  • ../Pages/AnotherFolder
  • etc.


    Now - I've got a Masterpage file in the Pages folder which is the general look of the entire site. Then, in each Pages Folder there's going to be another Masterpage inheriting the Page Folder Masterpage File.

    This seemed like a very simple and standard approach. But I'm having an issue. When editing the application in VWD2008E - I can see the Page Masterpage file just fine in Design View. But when trying to look at the the Masterpage Files, say the Admin Folder or the OtherFolder, in Design View - nothing shows except the Page Masterpage. It's really frustrating. Oddly, when running the application, no errors pop up and the sub-folder masterpages/pages show up just fine. They simply won't display in the editor.

    Has anyone run across this before? And if so, what was the solution?


    Thanks in advance.


    Matt B.

    Workflow - Change List Permissions - Time Issues


    I have a workflow which starts automatically on a submitted Expense Report InfoPath form. The default permissions on the Expense Report library is 'Contribute' for all users. The workflow then removes those permissions from the submitted Expense Report, and gives the Creator, Users Manager, and an Accounts Payable User 'Full Control' over the item.

    My problem is that it takes approximately 5-10 seconds from the point the form is submitted, the workflow is started, and the permissions to change. I realize it's not a huge window of time, but it is enough time for anyone looking in that folder, to notice someone else's Expense Report and click on it.

    I tried creating an 'Incoming Expense Reports' library, with a workflow on it that would change the permissions, and then copy the item to the Expense Report library, but the permissions were not copied over to the new item.

    Does anyone have any suggestion on how I can reduce the time it takes to change permissions to 1-2 seconds, or any alternative way of solving this?

    How to Localize Windows Forms and Change the Language at Runtime

    Localization is the process of customizing your application to a particular language, culture or locale. Visual Studio provides support for localizing Windows Forms with much ease. In this article, we will see how to localize windows forms and give the user the ability to change to his preferred language at runtime.
    When you run a localized application, the appearance is determined by two culture values. The UICulture property is used to specify which resource files will be loaded for the form. The Culture property, on the other hand, determines how strings such as dates, numerals, and currency amounts are formatted.
    Let us see the steps required to create a localized form. You can then expand this example and adopt the same approach for the rest of the forms in your project

    Selected to change the background color of the page



    As this site, http://www.borfin.com.tr/genel/Default.aspx, How can I change the background color selected pages.

    Bug: Does not change column type from nvarchar to ntext


    Scenario: If you create a table with a column of type nvarchar, populate it with some content and try to modify it using the WebMatrix editor, from nvarchar to ntext, it does not display any error message or warning that this is not possible. It silently saves and reverts the change, back to nvarchar. Wasted some hours on this issue as I thought my column was ntext, but in fact was still nvarchar.

    Expected behavior: It should change to ntext, or if SQL CE doesn't support that, it should notify the user that no change was applied.

    How to change the default page base class?


    I've tried setting the <pages pageBaseType="DynamicWebPage" /> value in web.config, but when I response.write out the page type, I'm still getting Microsoft.WebPages.WebPage.

    I'm simply trying to sub-class WebPage and add some additional functionality such as a dynamic PageData dictionary similar to Phil Haack's dynamic ViewData dictionary.



    SqlDataSource how to change the stored procedures at run time



    Is it possible to change the select, insert and update stored procedure of an SqlDataSource at run time. I don't mean to change the definition of the stored procedure, but I mean to change the assignment, i.e. To change the select stored procedure from "selectSP1" to "selectSP2" at run time. Is it possible?



    Facebook like Profile URL with HttpModule


    I am trying to make URLs for users profile pages like Facebooks e.g. http://site.com/username. I had a code snippett from a book for how to do this but when it runs it says its processing a request that will never finish. Im new with HttpModules/handlers but Ive looked over like 100 pages trying to figure this out. My code is below. Any help figuring this out would be greatly appreciated..

    public class URLRouter : IHttpModule
    /// <summary>
    /// You will need to configure this module in the web.config file of your
    /// web and register it with IIS before being able to use it. For more information
    /// see the following link: http://go.microsoft.com/?linkid=8101007
    /// </summary>
    #region IHttpModule Members
    private IUserRepository _userRepository;

    public URLRouter()
    _userRepository = ObjectFactory.GetInstance<IUserRepository>();

    public void Dispose()
    //clean-up code here.

    public void Init(HttpApplication context)
    context.PostResolveRequestCache += (new EventHandler(this.Application_OnAfterProcess));

    Open PopUp Window From Error httpModule


    I would like to open a popup window from the assembly to present the information to the user. Does anyone know if this is possible, I am presently doing the following:

            WriteLine("body {font-family:""Verdana"";font-weight:normal;font-size: .7em;color:black; background-color:white;}")
            WriteLine("b {font-family:""Verdana"";font-weight:bold;color:black;margin-top: -5px}")
            WriteLine("H1 { font-family:""Verdana"";font-weight:normal;font-size:18pt;color:red }")
            WriteLine("H2 { font-family:""Verdana"";font-weight:normal;font-size:14pt;color:maroon }")
            WriteLine("pre {font-family:""Lucida Console"";font-size: .9em}")

    Change Button Text in Multi Language Website


    Hi i developing multi language website

    using Master pages

    everything fine

    Page_Load i set the Text property of Button Control from Resource file

    like this

    Button1.Text = GetLocalResourceObject("Button1")

    then in the button click event i cnage the text of the Button control

    Button1.Text = GetLocalResourceObject("Button1_new")

    but the text doesn't change and no error messgae

    what is the problem how to solve this


    IE 8 Issues with Chinese/Japanese Characters


    On my web application, I display information in different languages. Everything works fine in IE compatibility mode and FireFox but it shows boxes for chinese/japanese languages. I am pretty much having the same issue as described here



    Thanks for your help.

    error facing for GlobalResources



    I want to use Globalresources for my application for that, I followed steps but i face error

    I added folder App_GlobalResources

     then I added file name as  CommonResource.en-US.Resx and CommonResource.ar-SA.resx

     then I added key(name) and value as myemailtext = "Email" and same for arabic

    then I used this in label control as below:


    asp:Label ID="lblFirstHeader" runat="server" Text="<%$ Resources:CommonResource, myemailtext %>

    How to change text in columns in SSRS?


    I need to create a complex report and export it to Excel. 

    In the first column header, text is displayed as "Hide Daily Columns", but I need the text to change as "Unhide Daily columns" when I click on it and when the text changes the columns under "daily" header (I have 3 columns under this header) present in the report shud be hidden and only weekly columns shud be visible. Any ideas please. I am new to SSRS and tried out many ways but didn't get it.

    ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
    Sql Server  SharePoint  Silverlight  Others  All   

    Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend