Subscribe: Localization
http://forums.asp.net/rss.aspx?ForumID=151&PostID=2016704
Added By: Feedage Forager Feedage Grade B rated
Language: English
Tags:
angular  app  audit measure  audit  codedom providers  css  data  loader  measure  microsoft codedom  model  mvc  net  public  webpack 
Rate this Feed
Rate this feedRate this feedRate this feedRate this feedRate this feed
Rate this feed 1 starRate this feed 2 starRate this feed 3 starRate this feed 4 starRate this feed 5 star

Comments (0)

Feed Details and Statistics Feed Statistics
Preview: Localization

All Forums



All Forums



Last Build Date: Tue, 20 Feb 2018 20:37:04 -0800

 



Why does using multiple CSS files in styleUrls give me errors when using in the single home.component.html?

2018-02-21T04:22:36.167-08:00

favorite I am trying to use multiple CSS files in home.componenet.ts but I am getting errors every time. Please assist me to fix this issue. i tried to use two approaches but with both approaches , i am getting errors. In first approach, I am using multiple CSS files in styleUrls and in second approach, i am using multiple CSS files in app.component.css by importing multiple CSS files. In first approach, CSS plugin folder is under ClientApp-> app -> assets and in second approach, CSS plugin folder is under wwwroot -> dist -> assets First approach : following is my code import { Component } from '@angular/core'; import * as $ from 'jquery'; @Component({ selector: 'home', templateUrl: './home.component.html', styleUrls: ['~/app/assets/css/style.css','~/app/assets/css/colors/green.css'] }) export class HomeComponent { public name = 'gfggfg'; } -- package.json { "name": "iSol", "private": true, "version": "0.0.0", "scripts": { "test": "karma start ClientApp/test/karma.conf" }, "devDependencies": { "@angular/animations": "4.2.5", "@angular/common": "4.2.5", "@angular/compiler": "4.2.5", "@angular/compiler-cli": "4.2.5", "@angular/core": "4.2.5", "@angular/forms": "4.2.5", "@angular/http": "4.2.5", "@angular/platform-browser": "4.2.5", "@angular/platform-browser-dynamic": "4.2.5", "@angular/platform-server": "4.2.5", "@angular/router": "4.2.5", "@ngtools/webpack": "1.5.0", "@types/chai": "4.0.1", "@types/jasmine": "2.5.53", "@types/webpack-env": "1.13.0", "angular2-router-loader": "0.3.5", "angular2-template-loader": "0.6.2", "aspnet-prerendering": "^3.0.1", "aspnet-webpack": "^2.0.1", "awesome-typescript-loader": "3.2.1", "bootstrap": "3.3.7", "chai": "4.0.2", "css": "2.2.1", "css-loader": "0.28.4", "es6-shim": "0.35.3", "event-source-polyfill": "0.0.9", "expose-loader": "0.7.3", "extract-text-webpack-plugin": "2.1.2", "file-loader": "0.11.2", "html-loader": "0.4.5", "isomorphic-fetch": "2.2.1", "jasmine-core": "2.6.4", "jquery": "3.2.1", "json-loader": "0.5.4", "karma": "1.7.0", "karma-chai": "0.1.0", "karma-chrome-launcher": "2.2.0", "karma-cli": "1.0.1", "karma-jasmine": "1.1.0", "karma-webpack": "2.0.3", "preboot": "4.5.2", "raw-loader": "0.5.1", "reflect-metadata": "0.1.10", "rxjs": "5.4.2", "style-loader": "0.18.2", "to-string-loader": "1.1.5", "typescript": "2.4.1", "url-loader": "0.5.9", "webpack": "2.5.1", "webpack-hot-middleware": "2.18.2", "webpack-merge": "4.1.0", "zone": "0.8.12" } } --- webpack.config const path = require('path'); const webpack = require('webpack'); const merge = require('webpack-merge'); const AotPlugin = require('@ngtools/webpack').AotPlugin; const CheckerPlugin = req[...]



webApi in old asp.net website - webforms

2018-02-20T12:25:45.097-08:00

Hello, i have an old web site (not web application project vs) in asp.net 4.0 webforms c#.

i wan't add apicontroller and i create it in app_code (vs ask me before creating, Controller folder is not available), so i add global asax file and in application_start

System.Web.Routing.RouteTable.Routes.MapHttpRoute(
name: "ActionApi",
routeTemplate: "api/{controller}/{action}/{id}",
defaults: new { id = System.Web.Http.RouteParameter.Optional }
);

My controller il TestController public class TestController : ApiController
{
// GET api/
[HttpGet()]
public IEnumerable GetHelloWorld()
{
return new string[] { "value1", "value2" };
}

but in my browser get http://localhost/api/test/get always have 404, and No type was found that matches the controller named

So, my controller always not found, What did I do wrong? 

thx




ASP.NET core support to ASPX view engine

2018-02-21T01:46:15.11-08:00

Hello,

I see that ASP.net core supports razor engine, is it possible to use it with the ASPX engine? I have an mvc app with aspx, I'm looking to migrate to ASP.NET core, please advice.

Thanks,

AM




Many To many relationship creating error - cycles or multiple cascade paths

2018-02-20T23:18:33.31-08:00

I am developing a code-first MVC application in Visual Studio 2013 with EF 6.2 and MVC 5.2.

I have what I think is a standard many to many relationship in the model between Audit and Audit_Measure i.e an Audit can have many Audit_Measures and an Audit_Measure can have many Audits. However, both can be created without the other i.e an Audit does not need an Audit_Measure and a Audit_Measure does not need an Audit.
Audit_Measure is also in a one to many relationship with Audit_Measure_Assessment.

Here is the Model:

   [Table("TRACS.Audit")]
    public class Audit
    {  
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        [Display(Name = "Id", AutoGenerateField = true)]
        [DisplayInReportsAttribute]
        public int Audit_Id { get; set; }
....
        [Display(Name = "NoDisplay", AutoGenerateField = false, Order = 2)]
        public virtual ICollection Audit_Measures { get; set; }   
       
    }
 [Table("TRACS.Audit_Measure")]
    public class Audit_Measure
    {
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        [Display(Name = "Id", AutoGenerateField = true)]
        public int Audit_Measure_Id { get; set; }
        
[Display(Name = "NoDisplay", AutoGenerateField = false, Order = 1)]
        public virtual ICollection Audits { get; set; }

        [Display(Name = "NoDisplay", AutoGenerateField = false, Order = 2)]
        public virtual ICollection Audit_Measure_Assessments { get; set; }

    }

To the context I have added fluent API as follows:

 modelBuilder.Entity()
                .HasMany(c => c.Audit_Measures).WithMany(i => i.Audits)
                .Map(t => t.MapLeftKey("Audit_Id")
                    .MapRightKey("Audit_Measure_Id")
                    .ToTable("Audit_Audit_Measure", "TRACS")); 

On the very first run of the application, I am receiving the error:
"Introducing FOREIGN KEY constraint 'FK_TRACS.Audit_Audit_Measure_TRACS.Audit_Measure_Audit_Measure_Id' on table 'Audit_Audit_Measure' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints.
Could not create constraint."

After consulting Professor Google, I can't quite figure out what it is exactly complaining about and where the multiple cascade paths issue comes into it.
In addtion, I am not sure where to specify ON DELETE NO ACTION or ON UPDATE NO ACTION, as the database is not created yet.

Thanks for considering.




Asyn ConfigureWait Question

2018-02-20T23:50:39.12-08:00

Do I need to set ConfigureWait(true) on every async call if I am waiting for a Loading... panel to work and response back? Or can I just call the first one with a ConfigureAwait(true) and then every other one to the database ConfigureAwait(false)?

Thanks. 




Publishing MVC project to ISP Server

2018-02-20T22:00:02.547-08:00

I have an MVC project which I had successfully published to my ISP server. Can anyone advice how to launch it? It launches OK from Visual Studio when I click run.




Help with model preperties

2018-02-20T22:00:19.687-08:00

Hi

I am starting to add more properties to my entities models but I have run into a problem of sorts.

I am going to use stock on an eccomerce site as the example

lets stay my stock more has a naaigation property to the stock information entity

When my database is small it wouldn't be an problem returning the stock entity, with the navigation information and then running a property which calls this.stockInformation to do some calculations for things like IsInStock, CurrenctStockCount

However when there are more records I am thinking this wouldn't be the more efficient way of doing it

Is there a way to future proof this type of  issue?




validation message on page load why

2018-02-20T04:32:46.103-08:00

Hi

Every time my page load I see validation message such as "Username is Required". Which I don't want to see until user click submit.

One thing I have done is to resolve this problem is 

if (!ModelState.IsValid)
{

ModelState.Clear();  // NOT SURE IS THIS THE RIGHT APPROCH

}

Note : I am uisng 

"All" class="text-danger">




need help to ensure a process works

2018-02-20T23:06:46.407-08:00

Hi

I have a issue where I am having trouble.

Let say a customer places an order and you have to allocate the stock in the warehouse to that order.

now i can allocate the stock to the order, my issue is what happens if two orders come through at the same time, then the same stock in the warehouse would be allocate to seperate orders and mess everything up, how do i ensure this doesn't happen?




ASPNET in Mobile

2018-02-16T15:53:39.403-08:00

Hi Experts,

I have developed my app. Configured security and deployed to azure. Awesome!

Problem is that it renders real bad on mobile phone and tablet.

Can someone please point me to some resources to help me amend things to run on mobile devices??

Thanks in advance

Billson3000




Rewriting WebForms/SQL Membership to MVC/ASP.NET Identity - Authenticate pre-existing users

2018-02-16T17:39:01.213-08:00

I am starting over, rewriting an existing webforms website. The new build started using the MVC WebApp template (with identity) created by Visual Studio 2017. I am trying to implement a similar technique outlined by Travis Nelson where you authenticate the existing SQL Membership users in the Identity framework.
See here http://travis.io/blog/2015/03/24/migrate-from-aspnet-membership-to-aspnet-identity/

The article shows how to add the migration to a webforms project not the mvc web app template created by Visual Studio 2017.
I am stuck trying to add/implement his use of the SqlPasswordHasher class he created and get it (or something similar) to work in MVC WebApp template created by Visual Studio 2017.

I have been puzzled looking at the following places in the MVC template trying to figure out how I can implement the SqlPasswordHasher class.

AccountController.cs

// This doesn't count login failures towards account lockout
// To enable password failures to trigger account lockout, change to shouldLockout: true
var result = await SignInManager.PasswordSignInAsync(model.Email, model.Password, model.RememberMe, shouldLockout: true);
switch (result)
{
    case SignInStatus.Success:
        return RedirectToLocal(returnUrl);
    case SignInStatus.LockedOut:
        return View("Lockout");
                case SignInStatus.RequiresVerification:
        return RedirectToAction("SendCode", new { ReturnUrl = returnUrl, RememberMe = model.RememberMe });
    case SignInStatus.Failure:
    default:
        ModelState.AddModelError("", "Invalid login attempt.");
        return View(model);
}

IdentityModels.cs

public class ApplicationDbContext : IdentityDbContext
{
    public ApplicationDbContext()
        : base("DefaultConnection", throwIfV1Schema: false)
    {
    }

    public static ApplicationDbContext Create()
    {
        return new ApplicationDbContext();
    }
}

How can I do this? Or where do I begin?

Thank you very much for reading this and attempting to assist!




Entity Framework .edmx file or Entity Data Model XML file

2018-02-20T18:48:48.697-08:00

I was wondering does anyone know why when you right click on the edmx file it does not show update model from database? Thanks !




ASPX Deployment Issue - PublicKey Token could not be located

2018-02-15T19:31:54.35-08:00

I have searched blogs, forums, and internet for a solution. Recommendations abound, including using NuGet to change my environment, change my project to "Application", copy the codedom to the GAC, bin directory missing. After all these years of this error plaguing IIS, there should be a solution that doesn't run me around the world trying hundreds of things. Does anyone know what it is?

Please help, I have been stuck two days on this.

I am building my first web app using the community 2017 verision if VS. I am deploying to Windows 10 IIS Express. The app runs in the VS, fails in IIS localhost.

I believe my environments should be compatible, please see below.

Parser Error Message: The CodeDom provider type "Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" could not be located.

Line 49:
Line 50:
Line 51:
Line 52:
Line 53:

Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll in folder C:\inetpub\wwwroot\TicketManager\bin

File version: 1.0.40810.0

product version: 1.0.7-40810




screen scraping with httpwebrequest

2018-02-20T02:05:06.003-08:00

Hi,

I am attempting to perform data scraping via HttpWebRequest but having some difficulty. The page that contains the data is redirected after request is made. That is, getting the page that has the data is redirected to another page and instead of the data being returned, the form used to retrieve via post method is returned, e.g,

   
..."

Is there a way to screen scrape a page that redirects on data retrieval?

Help is appreciated.




Embed custom fonts in Reportviewer 14 PDF export

2018-02-11T15:53:22.723-08:00

Hey,

I have 3 custom font in my reports (.rdlc) and my report have great looking when I use debugging in iis express, but when I publish my web app in host server and try to export my report to PDF all of my fonts convert to "Arial".

Hint : I don't have access to install fonts on server, so I have to do something in my code. I already asked server manager but they told me they can't install any font because their policy.




How to sent mail using smtp config in asp net core 2.0

2018-02-20T17:22:40.2-08:00

Hello everyone!

I'm getting trouble trying to set an  account confirmation using smtp can anyone suggest a tutorial  that I can set it properly with gmail.

Thank you




Getting the Selected Value from a @Html.DropdownList

2018-02-20T18:44:44.767-08:00

I've got a MVC app that has a view which is already populated with all the data that I need to filter and I've added a dropdown box as follows

@Html.DropDownList("IDs", "Select NACS Version")

In the controller this code

public ActionResult Index()
        {
            var nACSCodes = db.NACSCodes.Include(n => n.NACSVersion).Include(n => n.RowStateCode);
            IEnumerable i = db.NACSVersions
                          .Select(c => new SelectListItem
                          {
                              Value = c.IdNACSVersion.ToString(),
                              Text = c.Version.ToString()

                          });

This combination shows a dropdown box with the “Select NACS Version” as the default.  I want to filter the underlying Grid based on the selection in the dropdown.  If 3.7 is selected then filter the NACSCode such that only the Version 3.7 are presented in the MVC grid below

(image)

It's using Entity Framework for model.  How do I get the value of the selected item and filter the view data based on that selection?

 

 

 




Posting to MVC Controller on Another Site

2018-02-19T15:24:20.22-08:00

Hello everyone and thanks for your help in advance.  I am learning MVC and want to design a form that resides on a public site, lets call it https://www.mysite.com.  When the user submits the form, I would like to have it post to a site on another server (that I control) called https://www.mysite.net.  Currently, mysite.net uses Asp.Net 4.5 Identity to authenticate.  mysite.com also uses Asp.net 4.5.  I have been reading posts on this topic and it appears that CORS might be a possibility, but I am confused in that CORS seems to be mostly used for Ajax calls and am not sure if it is appropriate for use with form posts or how to implement this.  Any help would be appreciated.




how to combine data between multiple rows

2018-02-20T19:29:00.577-08:00

Hi All,

I have a table that contains duplicate data due to different values in certain column either 1 or 0. How can I combine the rows so that there is no duplicate data and if the column has a value of 1 on one row and 0 on another it will keep the 1

Example table:

UserID Name isAdmin isMember
1 Name1 1 0
1 Name1 0 1
2 Name2 1 0
3 Name3 0 1

Expected output:

UserID Account isAdmin isMember
1 Name1 1 1
2 Name2 1 0
3 Name3 0 1




SQL Server Triggers

2018-02-19T20:45:17.97-08:00

Hello,

I have triggers set up on a particular table (for Updates and Deletes).  I need to do a series of Updates, Deletes on this table.

I understand the trigger has some functions it needs to complete, along with updating another table that we have setup.

If I am running multiple transactions against the table, should I use a waitfor delay of maybe 15 seconds between each update, delete sql transaction or can I be relatively sure each transaction will run successfully without a delay between steps?

Thanks