http://www.codeguru.com/csharp/csharp/cs_network/internetweb/article.php/c12599/

I believe this is what you are looking for. Give this piece of code a
try.

On Oct 6, 8:18 am, Maddy <[email protected]> wrote:
> Dear friends,
>
> I have a requirement like based on user role the master page should change i
> have 6 master pages in a folder named "UI" including all aspx files. i
> researched(means Google) and found the following snipet
>
>  protected void Page_PreInit(object sender, EventArgs e)
>     {
>         try
>         {
>             this.MasterPageFile = "Admin.master";
>
>         }
>         catch(Exception ex)
>         {
>             MyException.WriteError(ex.Message.ToString());
>         }
>     }
>
> then in some aspx file i wrote this(above) code and i got an error like
>
> *Content controls have to be top-level controls in a content page or a
> nested master page that references a master page.*
>
> its CLUELESS for me... please help me.....
> --
> Sarvesh

Reply via email to