ASP.NET 4.5 and ASP.NET Core 1 Hosting BLOG

Tutorial and Articles about ASP.NET 4.0 and the latest ASP.NET 4.5 Hosting

Reporting Service (SSRS) Hosting :: Managing SSRS Security

clock July 29, 2013 10:50 by author Mike

SQL Server 2008 Reporting Services (SRRS) is a powerful solution that enables the authoring, management, and delivery of both paper-oriented reports and interactive Web-based reports. With SQL Reporting Services, organizations can create reports to be published to the Report Server using Microsoft or third-party design tools that use Report Definition Language (RDL), an XML-based industry standard. Report definitions and resources are published and managed as Web services and users can view reports in Web-based formats or via email.

As soon as you install SSRS 2008 R2, in your server and hit http:///reports, by default the the system administrators get access to the report manager. But if you wish to let other people see the reports that you deploy, you need to explicitly provide access to these reports. Providing access to reports is very simple and can be done at an item level( report level) or a folder level.

Let’s look at a very simple example. I have installed a SSRS 2008 R2 report server, on my local machine and have created a folder called Sandbox, in which i have added a report called Hello World.

By Default all admins in the system can access this report. Lets say, we add more reports to this folder and we need to grant access to these reports.
This can be done, by clicking on Folder Settings and then clicking on security. 

 

 

Click on New role assignment. This is the place where you define your role assignments.

If you need to grant all users of your domain access, then you may need to add 'Domain\DomainUSERS' and assign appropriate roles.

There are mainly 5 types of roles, that you can assign to an user or a group.
These roles are:
a. Browser
b. Content Manager
c. My Reports
d. Publisher
e. Report Builder.

Descriptions for each of these roles are provided in the UI itself. If you wish to add just a particular user of your domain for your report, type the username and select the appropriate role for the same.

Click OK, and your security is set.



ASP.NET MVC 4 Hosting :: ASP.NET MVC Selectlist, Selectedvalue, and Dropdownlistfor

clock July 22, 2013 07:02 by author Mike

Unintuitive framework features usually end up as highly rated questions because everyone is running into the same problem with a commonly used feature. This article will be an overview of how to use drop-down lists, setting a selected item, and issues you’ll run into on a strongly typed view. The following code have been written for MVC 4.


SAMPLE MODEL

For the sake of this article, assume we have two classes, Movie and Director. In our application we want to add new movies, and select directors from a drop-down list. The classes are structured as follows.

1
2
3
4
5
6
7
8
9
10
11
12
public class Movie
{
    public int Id { get; set; }
    public string Title { get; set; }
    public virtual Director Director { get; set; }
    public virtual int DirectorId { get; set; }
}
public class Director
{
    public int Id { get; set; }
    public string Name { get; set; }
}


HTML.DROPDOWNLIST Vs HTML.DROPDOWNLISTFOR
To add the drop-down markup to your .cshtml page you could of course simply write out a select element by hand, but then you lose out on validation. MVC provides HTML helpers for generating common HTML elements. For an HTML select element you have two choices: Html.DropDownList and Html.DropDownListFor. The difference is the way they reference the name attribute of the resulting HTML element. DropDownList takes as it’s first argument a string that will be turned into the form field. So the call

1
@Html.DropDownList("director", directorList) //assume directorList is an IEnumerable of SelectListItem to create options from


Will result in an html element that looks like this.

1
<select id="director" name="director">...</select>


The problem with this approach is if you change the name of the property on your model from ‘director’ to ‘auteur’ you won’t get compile time checking and your form will no longer work with model binding. Html.DropDownListFor was introduced in MVC 2 and allows binding to strongly typed views. The first argument should be a lambda function that returns the model property you want the control to bind to. So in our case if the view-model includes a property DirectorId we can create a drop-down list with the code

1
@Html.DropDownListFor(viewModel => viewModel.DirectorId, directorList)


Which generates the following html

 

1
2
3
<select id="DirectorId" name="DirectorId">
...
</select>


Now if we change the name of the Director property our build will break because the lambda expression will be invalid.Note that we’re using DirectorId instead of a Director object because we likely want to store the id in a foreign key.

POPULATING DROP-DOWN LIST OPTIONS
To populate a drop-down we need to pass the HTML helper an IEnumerable. This is easily created by making a SelectList object in your controller, and passing it in via a view-model.

1
2
3
4
5
6
7
8
9
10
11
12
public ActionResult Index()
{
    var directors = new Collection
        {
            new Director {Id = 1, Name = "David O. Russell"},
            new Director {Id = 2, Name = "Steven Spielberg"},
            new Director {Id = 3, Name = "Ben Affleck"}
        };
    var selectList = new SelectList(directors, "Id", "Name");
    var vm = new ViewModel {DirectorSelectList = selectList};
    return View(vm);
}


I’ve created a collection of directors and passed it into the SelectList constructor. This collection could have been queried from a database, this sample was simply for demonstration. I’ve also supplied which fields should be the drop-down value (Id) and display text (Name). If I omitted those additional parameters the ToString method would be called on the each object to generate the item.
My drop-down list now looks like this.

 

If you don’t like passing in a SelectList as part of your model you could pass in the IEnumerable and construct the SelectList in the view, but I prefer putting as little code in the view as possible.

SETTING A DEFAULT VALUE OF THE DROP-DOWN
And here is where things start falling apart. The aforementioned StackOverflow question highlighted how hard it is to set a default value on a drop-down. The problem stems from poor documentation for DropDownListFor. There is an overload that takes a fourth parameter called selectedValue which is an object to set the value. Theoretically I should be able to have the following the default to the option with an id of 3

1
var selectList = new SelectList(directors, "Id", "Name", new {id = 3});


However the first value, David O. Russell, is still selected in the view. And as good a job as he did in Silver Linings Playbook, I want to default to Ben Affleck. The problem is by using a strongly typed view, MVC is trying to bind my DirectorId field to the DirectorId property of my model. And because I didn’t populate the DirectorId field of my view-model, MVC is defaulting the drop-down to the first value.

My solution is to set the DirectorId property of the viewmodel to the value I want defaulted as follows.

1
var vm = new ViewModel {DirectorSelectList = selectList, DirectorId = 3};


Then when my view is templated the correct option is selected.



ASPHostPortal.com Proudly Announces ASP.NET MVC 5 Hosting

clock July 12, 2013 08:44 by author Mike

ASPHostPortal.com is a premiere web hosting company that specializes in Windows and ASP.NET-based hosting, proudly announces the new Microsoft product, ASP.NET MVC 5 hosting to all new and existing customers.

ASP.NET MVC 5 is the latest update to Microsoft's popular MVC (Model-View-Controller) technology - an established web application framework. MVC enables developers to build dynamic, data-driven web sites. ASP.NET MVC 5 adds sophisticated features like single page applications, mobile optimization, adaptive rendering, and more. Here are some new features of ASP.NET MVC 5:

- ASP.NET Identity
- Bootstrap in the MVC template
- Authentication Filters
- Filter overrides

“We pride ourselves on offering the most up to date Microsoft services. We're pleased to launch this product today on our hosting environment” said Dean Thomas, Manager at ASPHostPortal.com. “We have always had a great appreciation for the products that Microsoft offers. With the launched of ASP.NET MVC 5 hosting services, we hope that developers and our existing clients can try this new features.”

ASPHostPortal.com is one of the Microsoft recommended hosting partner that provide most stable and reliable web hosting platform. With the new launch of ASP.NET MVC 5 into its feature, it will continue to keep ASPHostPortal as one of the front runners in the web hosting market. For more information about new ASP.NET MVC 5, please visit http://www.asphostportal.com.

About ASPHostPortal.com:
ASPHostPortal.com is a hosting company that best support in Windows and ASP.NET-based hosting. Services include shared hosting, reseller hosting, and sharepoint hosting, with specialty in ASP.NET, SQL Server, and architecting highly scalable solutions. As a leading small to mid-sized business web hosting provider, ASPHostPortal strive to offer the most technologically advanced hosting solutions available to all customers across the world. Security, reliability, and performance are at the core of hosting operations to ensure each site and/or application hosted is highly secured and performs at optimum level.



Cheap ASP.NET 4.5 Hosting

We’re a company that works differently to most. Value is what we output and help our customers achieve, not how much money we put in the bank. It’s not because we are altruistic. It’s based on an even simpler principle. "Do good things, and good things will come to you".

Success for us is something that is continually experienced, not something that is reached. For us it is all about the experience – more than the journey. Life is a continual experience. We see the Internet as being an incredible amplifier to the experience of life for all of us. It can help humanity come together to explode in knowledge exploration and discussion. It is continual enlightenment of new ideas, experiences, and passions


Author Link


 

Corporate Address (Location)

ASPHostPortal
170 W 56th Street, Suite 121
New York, NY 10019
United States

Tag cloud

Sign in