Search Results

Search found 22 results on 1 pages for 'picflight'.

Page 1/1 | 1 

  • How to upgrade to SQL 2008

    - by picflight
    What is the difference between SQL2008 and SQL2008 R2? Should I unintall SQL 2005 and install SQL 2008 Web Edition? Or Should I upgrade the SQL 2005 to SQL 2008 Web Edition? I will also need to make sure the Logins are transferred over as many of my web applications have a Login on SQL2005 server.

    Read the article

  • How to safely use PayPal IPN with Asp.Net MVC

    - by Picflight
    Here are two sources for PayPal IPN: Kona.Web IPN DotNetNuke IPN DNN has a loop in the beginning of the Page_Load method that captures txn_type and txn_id, which I don't see in the Kona code. DNN also captures payer email and other information into local variables. I am trying to make sure that I incorporate some of the security checks that I see in DNN into my MVC IPN. How do I do what DNN is doing with MVC 2 with Kona as the base? Is the Kona.Web IPN safe for production, does it need some more tweaking?

    Read the article

  • How to use multiple DisplayName attribute using Entity Framework and ASP.Net Mvc 2

    - by Picflight
    Depending on where I use my Class, I want to be able to show a different DisplayName. I have the following class: [MetadataType(typeof(PortalMetaData))] [System.Web.Mvc.Bind(Exclude = "PortalId")] public partial class Portal { public Portal() { this.Created = DateTime.Now; } } public class PortalMetaData { [Required(ErrorMessage = "Portal name is required")] [StringLength(50, ErrorMessage = "Portal name must be under 50 characters")] public object PortalName { get; set; } [Required(ErrorMessage = "Description is required")] public object Description { get; set; } } I have a corresponding Table in the database Portal I use the Portal table with a PortalController for the Site Admin to update the records in the Portal Table. I want another user with a different Role (AsstAdmin) to be able to update this table as well. To facilitate that I am thinking of creating a separate partial class that somehow links back to the Portal Model. This would allow me to display limited Fields for update by the AsstAdmin and I can display a different name for the Field as well. How can I accomplish this task? If I add the following class which inherits from Portal than I get an exception: Unable to cast object of type 'Project1.Mvc.Models.Portal' to type 'Prpject1.Mvc.Models.Site'. [MetadataType(typeof(SiteMetaData))] public class Site : Portal { public Site() { } } public class SiteMetaData { [Required(DisplayName = "Site Description")] public object Description { get; set; } }

    Read the article

  • How to clone a Model using Entity Framework and ASP.Net Mvc 2

    - by Picflight
    I have the following class: [MetadataType(typeof(PortalMetaData))] [System.Web.Mvc.Bind(Exclude = "PortalId")] public partial class Portal { public Portal() { this.Created = DateTime.Now; } } public class PortalMetaData { [Required(ErrorMessage = "Portal name is required")] [StringLength(50, ErrorMessage = "Portal name must be under 50 characters")] public object PortalName { get; set; } [Required(ErrorMessage = "Description is required")] public object Description { get; set; } } I have a corresponding Table in the database Portal I use the Portal table with a PortalController for the Site Admin to update the records in the Portal Table. I want another user with a different Role (AsstAdmin) to be able to update this table as well. To facilitate that I am thinking of creating a separate partial class that somehow links back to the Portal Model. This would allow me to display limited Fields for update by the AsstAdmin and I can display a different name for the Field as well. How can I accomplish this task? If I add the following class which inherits from Portal than I get an exception: Unable to cast object of type 'Project1.Mvc.Models.Portal' to type 'Prpject1.Mvc.Models.Site'. [MetadataType(typeof(SiteMetaData))] public class Site : Portal { public Site() { } } public class SiteMetaData { [Required(DisplayName = "Site Description")] public object Description { get; set; } }

    Read the article

  • How to Add, Edit and Display one to many relationship entities in ASP.Net MVC 2?

    - by Picflight
    I am looking for best practices conforming to the MVC design pattern. My Entities have the following relationship. tblPortal PortalId PrortalName tblPortalAlias AliasId PortalId HttpAlias Each Portal can have many PortalAlias. I want to Add a New Portal and then Add the associated PortalAlias. I am confused on how I should structure the Views and how I should present the Views to the user. I am looking for some sample code on how to accomplish this. My thoughts are first present the Portal View, let the user add the Portal. Then click the Edit link on the Portal List View and on the Portal Edit View let them Add the PortalAlias. If so, what should the Edit View look like? So far I have: Edit <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MyProject.Mvc.Models.PortalFormViewModel>" %> <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> Edit </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> <h2>Edit</h2> <% Html.RenderPartial("PortalForm", Model); %> <div> <%= Html.ActionLink("Back to List", "Index") %> </div> </asp:Content> PortalForm <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<MyProject.Mvc.Models.PortalFormViewModel>" %> <%= Html.ValidationSummary("Please correct the errors and try again.") %> <% using (Html.BeginForm()) {%> <%= Html.ValidationSummary(true) %> <fieldset> <legend>Fields</legend> <div class="editor-label"> <%= Html.LabelFor(model => model.Portal.PortalId) %> </div> <div class="editor-field"> <%= Html.TextBoxFor(model => model.Portal.PortalId) %> <%= Html.ValidationMessageFor(model => model.Portal.PortalId) %> </div> <div class="editor-label"> <%= Html.LabelFor(model => model.Portal.PortalName) %> </div> <div class="editor-field"> <%= Html.TextBoxFor(model => model.Portal.PortalName) %> <%= Html.ValidationMessageFor(model => model.Portal.PortalName) %> </div> <p> <input type="submit" value="Save" /> </p> </fieldset> <% } %> Alias<br /><%-- This display is for debug --%> <% foreach (var item in Model.PortalAlias) { %> <%= item.HTTPAlias %><br /> <% } %> PortalFormViewModel public class PortalFormViewModel { public Portal Portal { get; private set; } public IEnumerable<PortalAlias> PortalAlias { get; private set; } public PortalFormViewModel() { Portal = new Portal(); } public PortalFormViewModel(Portal portal) { Portal = portal; PortalAlias = portal.PortalAlias; } }

    Read the article

  • How to query Entities in Entity Framework 4

    - by Picflight
    In VS2008, I think it is EF1.0, this works just fine. string queryString = @"SELECT VALUE USERS FROM ProjectDBEntities.Users AS User INNER JOIN ProjectDBEntities.Favorites AS F ON F.FavUserId = User.UserId WHERE F.UserId = " + 3 + " ORDER BY F.CreateDate DESC "; System.Data.Objects.ObjectQuery<User> usersQuery = new System.Data.Objects.ObjectQuery<User>(queryString, context).Include("Detail"); //int count = usersQuery.Count(); foreach (User result in usersQuery) Console.WriteLine("User Name: {0}", result.UserName); Same code in VS2010 EF4 it crashes on the foreach loop with the following error: The result type of the query is neither an EntityType nor a CollectionType with an entity element type. An Include path can only be specified for a query with one of these result types.

    Read the article

  • How to display and update data in MVC2

    - by Picflight
    Table Product Product Id Product Name Table ProductSupplier ProductSupplierId ProductId SupplierId Table Supplier SupplierId SupplierName I have the above 3 tables in my database, ProductSupplier is the lookup table. Each Product can have many suppliers. I am using Entity Framework. Using Web Forms it was fairly easy to display a Product on a web page and bind a repeater with the suppliers information. Also, with Web Forms it was easy to Add new Product and suppliers, the linkage seemed easy. How do you do this sort of functionality in MVC? In the Create View below, I want to be able to Add the Supplier as well. Is there a better approach that I might be missing here? This is how I did it with Web Forms. Beyond the code below I am totally lost. I can show data in a list and also display the Suppliers for each Product, but how do I Add and Edit. Should I break it into different views? With Web Forms I could do it all in one page. namespace MyProject.Mvc.Models { [MetadataType(typeof(ProductMetaData))] public partial class Product { public Product() { // Initialize Product this.CreateDate = System.DateTime.Now; } } public class ProductMetaData { [Required(ErrorMessage = "Product name is required")] [StringLength(50, ErrorMessage = "Product name must be under 50 characters")] public object ProductName { get; set; } [Required(ErrorMessage = "Description is required")] public object Description { get; set; } } public class ProductFormViewModel { public Product Product { get; private set; } public IEnumerable<ProductSupplier> ProductSupplier { get; private set; } public ProductFormViewModel() { Product = new Product(); } public ProductFormViewModel(Product product) { Product = product; ProductSupplier = product.ProductSupplier; } } } ProductRepository public Product GetProduct(int id) { var p = db.Product.FirstOrDefault(por => por.ProductId == id); p.ProductSupplier.Attach(p.ProductSupplier.CreateSourceQuery().Include("Product").ToList()); return p; } Product Create View <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MyProject.Mvc.Models.ProductFormViewModel>" %> <%= Html.ValidationSummary("Please correct the errors and try again.") %> <% using (Html.BeginForm()) {%> <fieldset> <legend>Fields</legend> <div class="editor-label"> <%= Html.LabelFor(model => model.Product.ProductId) %> </div> <div class="editor-field"> <%= Html.TextBoxFor(model => model.Product.ProductId) %> <%= Html.ValidationMessageFor(model => model.Product.ProductId) %> </div> <div class="editor-label"> <%= Html.LabelFor(model => model.Product.ProductName) %> </div> <div class="editor-field"> <%= Html.TextBoxFor(model => model.Product.ProductName) %> <%= Html.ValidationMessageFor(model => model.Product.ProductName) %> </div> <div class="editor-label"> <%= Html.LabelFor(model => model.Product.Description) %> </div> <div class="editor-field"> <%= Html.TextBoxFor(model => model.Product.Description) %> <%= Html.ValidationMessageFor(model => model.Product.Description) %> </div> <p> <input type="submit" value="Create" /> </p> </fieldset> <% } %>

    Read the article

  • How to page while maintaining the querystring values in ASP.Net Mvc 2

    - by Picflight
    I am using the pager provided by Martijin Boland to implementing paging in my Asp.Net Mvc 2 application. My form uses the GET method to send all parameters to the querystring, it is a search form with several form elements. <% using (Html.BeginForm("SearchResults", "Search", FormMethod.Get)) {%> On the SearchResults View I am trying to implement paging: <div class="pager"> <%= Html.Pager(Model.PageSize, Model.PageNumber, Model.TotalItemCount, new { Request.QueryString })%> </div> The Html.Pager has some overloads which I am not too clear on how to use. The Request.QueryString makes the querystring look like this: http://localhost:1155/Search/SearchResults?QueryString=Distance%3D10%26txtZip%3D%26cb&page=2 Should it not be like this? http://localhost:1155/Search/SearchResults?Distance=20&txtZip=10021&page=2

    Read the article

  • How to parse deeply nested using LINQ to XML

    - by Picflight
    How do I parse the following XML using LINQ? I need to insert into a database table OrderNumber, ShipAddress, ShipCity, ShipState for each Order & OrderCancelled. Then in a separate table I need to insert OrderId from the Returns/Amount section. <!-- language: lang-xml --> <?xml version="1.0" encoding="utf-8"?> <OrdersReport Date="2012-08-01"> <Client> <ClientId>1</ClientId> <Orders> <Order> <OrderNumber>1</OrderNumber> <ShipAddress>123 Main St.</ShipAddress> <ShipCity>MyCity</ShipCity> <ShipState>AZ</ShipState> </Order> <Order> <OrderNumber>2</OrderNumber> <ShipAddress>111 Main St.</ShipAddress> <ShipCity>OtherCity</ShipCity> <ShipState>AL</ShipState> </Order> <OrderCancelled> <OrderNumber>3</OrderNumber> <ShipAddress>111 Main St.</ShipAddress> <ShipCity>OtherCity</ShipCity> <ShipState>AL</ShipState> </OrderCancelled> </Orders> <Returns> <Amount> <OrderId>2</OrderId> <OrderId>3</OrderId> </Amount> </Returns> </Client> <Client> <ClientId>2</ClientId> <!-- Same Tree structure as Client 1 --> </Client> </OrdersReport> Not sure why the XML is not showing red and blue colors and not indenting properly. :-(

    Read the article

  • How to edit and display Date in ASP.Net MVC 2

    - by Picflight
    I am storing a date in my database and want the user to be able to edit this date in the Edit View. In the past with ASP.Net web forms I have used 3 dropdownlists for the Month, Day and Year to get the date from the user and to bind it on display. I want to do the same in ASP.Net MVC and not sure how to do it? I am not using any jQuery or Javascript, the design calls for simple postback.

    Read the article

  • How to manipulate data in View using Asp.Net Mvc RC 2?

    - by Picflight
    I have a table [Users] with the following columns: INT SmallDateTime Bit Bit [UserId], [BirthDate], [Gender], [Active] Gender and Active are Bit that hold either 0 or 1. I am displaying this data in a table on my View. For the Gender I want to display 'Male' or 'Female', how and where do I manipulate the 1's and 0's? Is it done in the repository where I fetch the data or in the View? For the Active column I want to show a checkBox that will AutoPostBack on selection change and update the Active filed in the Database. How is this done without Ajax or jQuery?

    Read the article

  • How to use a Base ViewModel in Asp.net MVC 2

    - by Picflight
    As I familiarize myself with Asp.Net MVC, I am using MVC 2, I have noticed the use of a BaseViewData class in the Kigg project which I am unsure how to implement. I want each of my ViewModels to have certain values available. Using an iterface comes to mind but I am wondering what the best practice is and how does Kigg do it? Kigg public abstract class BaseViewData { public string SiteTitle { get; set; } // ...other properties } public class UserListViewData : BaseViewData { public string Title { get; set; } // .. other stuff } In my WebForms application I use a BasePage that inherits from System.Web.UI.Page. So, in my MVC project, I have this: public abstract class BaseViewModel { public int SiteId { get; set; } } public class UserViewModel : BaseViewModel { // Some arbitrary ViewModel } Referencing the Kigg methodology, how do I make sure that each of my ViewModel that inherits from the BaseViewModel have the SiteId property? What is the best practice, samples or patterns I should be using?

    Read the article

  • How to display a generic error page in Asp.Net MVC 2

    - by Picflight
    I have the following in my base controller: protected override void OnException(ExceptionContext filterContext) { if (filterContext == null) { throw new ArgumentNullException("filterContext"); } // If custom errors are disabled, we need to let the normal ASP.NET exception handler // execute so that the user can see useful debugging information. if (filterContext.ExceptionHandled || !filterContext.HttpContext.IsCustomErrorEnabled) { return; } Exception exception = filterContext.Exception; // If this is not an HTTP 500 (for example, if somebody throws an HTTP 404 from an action method), // ignore it. if (new HttpException(null, exception).GetHttpCode() != 500) { return; } // TODO: What is the namespace for ExceptionType? //if (!ExceptionType.IsInstanceOfType(exception)) //{ // return; //} // Send Email MailException(exception); // TODO: What does this line do? base.OnException(filterContext); filterContext.Result = new ViewResult { ViewName = "Error" }; filterContext.ExceptionHandled = true; filterContext.HttpContext.Response.Clear(); filterContext.HttpContext.Response.StatusCode = 500; } In my Shared folder, I have an Error.aspx View. Web.config <customErrors mode="On" /> I am still seeing the yellow screen when an exception occurs. What am I doing incorrectly?

    Read the article

  • How to add additional data column in EF using ASP.Net MVC 2

    - by Picflight
    My Table: [LocationId] [Address] [ZipCode] When I show a list of Location's, I also want to show the distance from a given zip code. In Asp.Net Web Forms I had a stored procedure that would return the distance and I would call this SP on ItemDataBound on my GridView. Or, I also would have my SP that is returning the Location list add another column ([Distance]) which I could display in my GridView. How would you do this using Entity Framework and Asp.Net Mvc 2?

    Read the article

  • How to reference using Entity Framework and Asp.Net Mvc 2

    - by Picflight
    Tables CREATE TABLE [dbo].[Users]( [UserId] [int] IDENTITY(1,1) NOT NULL, [UserName] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [Email] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [BirthDate] [smalldatetime] NULL, [CountryId] [int] NULL, CONSTRAINT [PK_Users] PRIMARY KEY CLUSTERED ([UserId] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] CREATE TABLE [dbo].[TeamMember]( [UserId] [int] NOT NULL, [TeamMemberUserId] [int] NOT NULL, [CreateDate] [smalldatetime] NOT NULL CONSTRAINT [DF_TeamMember_CreateDate] DEFAULT (getdate()), CONSTRAINT [PK_TeamMember] PRIMARY KEY CLUSTERED ([UserId] ASC, [TeamMemberUserId] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] dbo.TeamMember has both UserId and TeamMemberUserId as the index key. My goal is to show a list of Users on my View. In the list I want to flag, or highlight the Users that are Team Members of the LoggedIn user. My ViewModel public class UserViewModel { public int UserId { get; private set; } public string UserName { get; private set; } public bool HighLight { get; private set; } public UserViewModel(Users users, bool highlight) { this.UserId = users.UserId; this.UserName = users.UserName; this.HighLight = highlight; } } View <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MvcPaging.IPagedList<MyProject.Mvc.Models.UserViewModel>>" %> <% foreach (var item in Model) { %> <%= item.UserId %> <%= item.UserName %> <%if (item.HighLight) { %> Team Member <% } else { %> Not Team Member <% } %> How do I toggle the TeamMember or Not If I add dbo.TeamMember to the EDM, there are no relationships on this table, how will I wire it to Users object? So I am comparing the LoggedIn UserId with this list(SELECT TeamMemberUserId FROM TeamMember WHERE UserId = @LoggedInUserId)

    Read the article

  • How to manupilate data in VIew using Asp.Net Mvc RC 2?

    - by Picflight
    I have a table [Users] with the following columns: INT SmallDateTime Bit Bit [UserId], [BirthDate], [Gender], [Active] Gender and Active are Bit that hold either 0 or 1. I am displaying this data in a table on my View. For the Gender I want to display 'Male' or 'Female', how and where do I manipulate the 1's and 0's? Is it done in the repository where I fetch the data or in the View? For the Active column I want to show a checkBox that will AutoPostBack on selection change and update the Active filed in the Database. How is this done without Ajax or jQuery?

    Read the article

  • How to RESTful delete record Asp.Net Mvc 2

    - by Picflight
    I have delete links in my Asp.Net Mvc2 application. /{controller}/Delete/{id} It seems using link to delete has a security risk. Don’t use Delete Links because they create Security Holes I found this Implementing RESTful Routes & Controllers in ASP.NET MVC 2.0 but I am not sure how to implement a simple delete functionality using the new HttpDeleteAttribute class. Are there any examples on deleting, the RESTful approach?

    Read the article

1