Becks
Becks

Reputation: 77

How to change namespace name in an asp.net webform

How to change the namespace name in an asp.net webform For example in my project i have created 3 folders Master,Transaction,Reports in Master folder there are 10 forms by default th namespace comes ProjectName.Master,but when i manually change the name by adding my formname it doesn't work eg:-ProjectName.Master.MasterFormName.And moreover when i double click on a button then it doesn't go in the code behind.

Upvotes: 1

Views: 2472

Answers (1)

nunespascal
nunespascal

Reputation: 17724

Changing a namespace in c# code alone isn't sufficient.
You also need to tell your .master file what class it inherits from.
Set the new namespace in you .master file and you will be good to go.

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="ProjectName.Master.cs"   
    Inherits="ProjectName.Master.MasterFormName.MasterFormName" %>

Just my personal opinion: putting your class name in the namespace doesn't make a lot of sense.

Upvotes: 6

Related Questions