tags:

views:

600

answers:

1

hi guys,

I have added one class under namespace BusinessLogics. I have inherited System.Web.UI.Page to class and showing error as 'end expected' in System.Web.UI.Page

Namespace BusinessLogics
    Public Class BllUploadImages Inherits System.Web.UI.Page
    End Class
End Namespace

How can i remove my error.Can anybody help?

+2  A: 

The Server property is an instance property of the Page class, so you need a Page instance in order to access it. There are a couple of different ways for you to solve this.

It looks like objDesign is of a type that inherits System.Web.UI.Page. Perhaps you can use that instance to invoke the MapPath method:

serverPath = objDesign.Server.MapPath(".") + "\"

One other approach is to fetch the current HttpContext object and use the Server property of that object:

serverPath = HttpContext.Current.Server.MapPath(".") + "\"
Fredrik Mörk