|
That is like a huge project, sadly, discussions are not that much broad to cover every aspect of this project. I will like to talk about a few key areas here,
Quote: I need to create a database-driven website Your best bet would be on an ORM, consider using something like Entity Framework and develop your website on top of that. It can help you with most of the SQL stuff that you will have to do yourself.
Entity Framework | Microsoft Docs
Quote: where a number of users will capture data, and where many users will be able to view the results of a large number of different database queries Please also study the publisher-consumer pattern, this seems to be moving toward that—something like a blog website where a few users are publishing content, and almost every user is reading it.
Producer–consumer problem - Wikipedia
Quote: CMS capability would be a plus. CMS or page builder? Both these have their own libraries and tools that you can use in ASP.NET.
Quote: I want a responsive interface from the word go That is what Bootstrap is there for.
Bootstrap · The most popular HTML, CSS, and JS library in the world.
Quote: Is there a website template available, with user management, and with the basic site infrastructure available, or should I use one of the ASP.NET CMSs, like Umbraco?
Yes, Umbraco is your only bet for the time being. And lastly, do not just depend on your extensive SQL knowledge and try to jump in the wild west of the Internet. There are several things that you need to know before you can publish the website, especially a website that is going to have a huge amount of user base and queries to database.
There are several concepts like, scaling, caching, security, responsiveness (as you have mentioned), and much more. Best bet is to consider an open source solution and leave everything to it. If you cannot then please study these concepts before moving forward.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
I'm reading a book and the author is discussing DI using Ninject. Now time/work constraint aren't allowing me to keep reading yet. Here is my question. I read that, for using 'deleting' user accounts in an individual login method.
Can I use DI to start the context object and pass it when need.
|
|
|
|
|
Yes.
"Never attribute to malice that which can be explained by stupidity."
- Hanlon's Razor
|
|
|
|
|
I have a radgrid hierarchy structure. When the user navigates to the third level and clicks on the parent tickmark on the grid, the RadGrid1_ItemCommand is fired and I can retrieve the parent "ProgramID".
But I need to pickup the parentID when the user clicks on the command-template button located just on top of the detail rows. I would like to get the value within a client-side function or server-side if that is easier??? (but cannot get that to work well).
Thank you for you help with this request!
Client-Side code:
function openWindowNEW(sender, args) {
var programID= parentItem.OwnerTableView.Items[sender.Item.ItemIndex].GetDataKeyValue("ProgramID"); //...not working
radopen("Storyboard.aspx?carID=programID, "RadWindow2");
}
Server-Side Code:
console.write((string) sender.Item.OwnerTableView.Items[e.Item.ItemIndex].GetDataKeyValue("ProgramID").ToString());
The code works below but it needs it to work from within a client-side function....
protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
{
if (e.Item.OwnerTableView.DataSourceID == "SqlDataSource3")
{
GridDataItem parentItem = (GridDataItem)(e.Item.OwnerTableView.ParentItem);
if (parentItem != null)
{
//..tier 2 parent
Console.Write(parentItem.OwnerTableView.DataKeyValues[parentItem.ItemIndex]["StrategicInitID"]);
//..tier 3 parent
HiddenProgramIDSelected.Value = (string)e.Item.OwnerTableView.Items[e.Item.ItemIndex].GetDataKeyValue("ProgramID").ToString();
}
}
}
|
|
|
|
|
|
I am trying to create to create two dynamic TextBoxes on Button click1. The first time i click i get 2.
The second time 4 ans so on when I only want two (2)
protected void Page_PreInit(object sender, EventArgs e)
{
List<string> keys = Request.Form.AllKeys.Where(key => key.Contains("txtDynamic")).ToList();
int i = 1;
foreach (string key in keys)
{
this.CreateTextBox("txtDynamic" + i);
i++;
}
}
protected void Button1_Click(object sender, EventArgs e)
{
int index = pn1TextBoxes.Controls.OfType<TextBox>().ToList().Count + 1;
this.CreateTextBox("txtDynamic" + index);
}
private void CreateTextBox(string id)
{
for (int i = 1; i <= 2; i++)
{
TextBox txt = new TextBox();
txt.ID = id + i.ToString();
txt.TextMode = TextBoxMode.MultiLine;
txt.Height = 60;
txt.Width = 300;
pn1TextBoxes.Controls.Add(txt);
}
Literal lt = new Literal();
lt.Text = "<br/>";
pn1TextBoxes.Controls.Add(lt);
}
|
|
|
|
|
You'll probably want to read about ASP.NET Page Life Cycle Overview[^]
Basically the Page_PreInit() method is being called each time you click, before the click handler - so the code in the foreach loop is creating all your extra textboxes.
|
|
|
|
|
Put a breakpoint in the CreateTextBox and debug your code. Every time the function is called look at the stack trace and that will show you what is calling it. Alternatively put a breakpoint in all of your functions and debug your code, that will show you the order things are firing and so on and you should be able to work it out yourself from that.
|
|
|
|
|
Background
Within a restricted web development environment my team has the following installed:
- Visual Studio 2015 Professional (Release Version, not Update 3)
- Typescript 1.6 (via default install options of Visual Studio 2015 Professional)
- Note; a later version of Typescript (3.0x) can be made available via path variable but this is the version that is integrated via Typescript installation.
- Node JS 10.4 (via unzipping to directory and user PATH variable)
- NPM 6.1 (via unzipping to directory and user PATH variable)
- NPM Task Runner (Visual Studio 2015 extension)
- Webpack Task Runner (Visual Studio 2015 extension)
With this suite of tooling I’d like to attempt at working with an existing AngularJS/ASP.NET MVC 5+ portfolio consisting of several web applications.
Problem
My team can build the ASP.NET/C#/MVC 5+ middleware and backend components just fine; the problem is that there is essentially little to no Typescript debugging/IntelliSense/etc. experience available to them.
With Typescript 1.6 built into the Visual Studio 2015 Professional IDE, said constructs do not recognize the new Typescript methods/etc. that later versions of Typescript added. Therefore, as later libraries of Angular evolved over the course of 2+ years the built-in tooling within Visual Studio has become woefully out of date.
Because of this, local front-end development is painful to the point of being extremely time consuming and error-prone. If this were just one or two files the instruction would be to look past but with hundreds of files the experience is extremely degraded and the fear is said experience would lead to poor productivity and eventual bugs/defects leaking into upper environments (staging/production) due to the poor tooling.
Challenges
The following challenges persist in this environment which makes an easy resolution path difficult:
- No administrative rights on local development machines
*Any new tooling must come from stand-alone executables or configurations - Training of Existing Staff
- Any solution must be scalable such that new development teams can utilize
Current (Unsustainable) Solution
The way my team is resolving this now is via usage of remote desktop (via Windows RDP) into a specifically tailored remote server. However, said system is being decommissioned due to organizational policies. Therefore, future development must be performed via local installations.
My Current Path of Resolution
At this current point in time, I am looking into putting forward Visual Studio Code (via standalone executable and associated User-PATH variable edit) as an alternative to edit the Typescript-based files and using Visual Studio 2015 Professional for everything else. However, I know that the debugging/editing experience for this would not be ideal.
Questions
- Is there a way for Visual Studio 2015 Professional to utilize a different version of Typescript for the editing experience without installing a newer version of the Typescript SDK?
- If not; is there a way to disable editing of Typescript files within Visual Studio 2015?
- I have tried to alter the “csproj” project files by setting the following to no avail.
-
<TypeScriptEnabled>false</TypeScriptEnabled>
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked> -
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props" Condition="True" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets" Condition="True" /> - Are there any alternatives to the above worth considering?
Any advice welcome. Thank you for your time.
|
|
|
|
|
I use VS2017 for a Angular V6 .Net Core 2.1.2 project.
Went through many GitHub templates before I found one I liked, in which I had to heavily modify to my liking.
Try and find a template that matches your requirements, download it and use it in VS2015 and see what it does.
If I remember, VS2015 was pretty friendly with NPM, Gulp, Bower and may support TypeScript Linting and Intellisense.
I don't have enough SSD space to load VS2015 and test a copy of my project so I just have VS2017 and VS2013 for the InstallSheild.
Take a look at this
ASP.Net Core2.0, Angular6 - SPA
Guess VS2017 looks at the tsConfig.json file in the root folder of your project to load Linting and Intelisense.
And a tslint.json file
tsconfig.json
{
"compilerOptions": {
"target": "es5",
"module": "es2015",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": true,
"noImplicitAny": true,
"skipLibCheck": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"lib": [
"es2015",
"dom"
],
"typeRoots": [
"./node_modules/@types/"
]
},
"exclude": [
"node_modules",
"./angularApp/main-aot.ts"
],
"include": [
"**/*.ts",
"../node_modules/angular-bootstrap-md/angular-bootstrap-md/index.ts",
"../node_modules/angular-bootstrap-md/angular-bootstrap-md.d.ts"
],
"awesomeTypescriptLoaderOptions": {
"useWebpackText": true
},
"compileOnSave": false,
"buildOnSave": false
}
tslint;json
{
"rules": {
"callable-types": true,
"class-name": true,
"comment-format": [
true,
"check-space"
],
"curly": true,
"eofline": true,
"forin": true,
"import-blacklist": [ true ],
"import-spacing": true,
"indent": [
true,
"spaces"
],
"interface-over-type-literal": true,
"label-position": true,
"max-line-length": [
true,
300
],
"member-access": false,
"member-ordering": [
true,
{
"order": [
"public-static-field",
"public-instance-field",
"public-constructor",
"private-static-field",
"private-instance-field",
"private-constructor",
"public-instance-method",
"protected-instance-method",
"private-instance-method"
]
}
],
"no-arg": true,
"no-bitwise": true,
"no-console": [
true,
"debug",
"info",
"time",
"timeEnd",
"trace"
],
"no-construct": true,
"no-debugger": true,
"no-duplicate-variable": true,
"no-empty": false,
"no-empty-interface": true,
"no-eval": true,
"no-inferrable-types": [ true, "ignore-params" ],
"no-shadowed-variable": true,
"no-string-literal": false,
"no-string-throw": true,
"no-switch-case-fall-through": true,
"no-trailing-whitespace": true,
"no-unused-expression": true,
"no-use-before-declare": true,
"no-var-keyword": true,
"object-literal-sort-keys": false,
"one-line": [
true,
"check-open-brace",
"check-catch",
"check-else",
"check-whitespace"
],
"prefer-const": true,
"quotemark": [
true,
"single"
],
"radix": true,
"semicolon": [
true,
"always"
],
"triple-equals": [
true,
"allow-null-check"
],
"typedef-whitespace": [
true,
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
}
],
"typeof-compare": true,
"unified-signatures": true,
"variable-name": false,
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type"
],
"directive-selector": [ true, "attribute", "app", "camelCase" ],
"component-selector": [ true, "element", "app", "kebab-case" ],
"use-input-property-decorator": true,
"use-output-property-decorator": true,
"use-host-property-decorator": true,
"no-input-rename": true,
"no-output-rename": true,
"use-life-cycle-interface": true,
"use-pipe-transform-interface": true,
"component-class-suffix": true,
"directive-class-suffix": true,
"no-access-missing-member": true,
"templates-use-public": true,
"invoke-injectable": true
},
"rulesDirectory": [
"node_modules/codelyzer"
]
}
I just don't have the resources to give you a better answer.
Learning Angular 6 wrapped in .Net Core 2.1 was hard enough.
If it ain't broke don't fix it
Discover my world at jkirkerx.com
modified 25-Sep-18 14:22pm.
|
|
|
|
|
Message Closed
modified 23-Sep-18 16:24pm.
|
|
|
|
|
Ooookkkeeeeyyyy... and?
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Hi, apologies, was typing the message during this time.
|
|
|
|
|
I am trying to create a dynamic text box but I am getting a null reference error.
protected void Page_PreInit(object sender, EventArgs e)
{
List<string> keys = Request.Form.AllKeys.Where(key => key.Contains("txtDynamic")).ToList();
int i = 1;
foreach (string key in keys)
{
this.CreateTextBox("txtDynamic" + i);
i++;
}
}
protected void Page_Load(object sender, EventArgs e)
{
}
protected void AddTextBox(object sender, EventArgs e)
{
int index = pn1TextBoxes.Controls.OfType<TextBox>().ToList().Count + 1;
this.CreateTextBox("txtDynamic" + index);
}
private void CreateTextBox(string Id)
{
TextBox txt = new TextBox();
txt.ID = Id;
try
{
pn1TextBoxes.Controls.Add(txt);
}
catch (Exception e )
{
Response.Write(e.ToString());
}
Literal lt = new Literal();
lt.Text = "<br/>";
try
{
pn1TextBoxes.Controls.Add(lt);
}
catch (Exception e)
{
Response.Write(e.ToString());
}
}
}
|
|
|
|
|
|
I'm just learning Asp.net Web APIs. It was smooth until it's simple application/json type headers to deal with.
But now I'm trying to submit data with Content-Type:application/x-www-urlencode , but it's been really tough to get it working.
I tried different things, right from using [FromBody] attrib to "AliasBinder" etc. But nothing seem to work.
The API is dead simple , The code looks like:
class Point
{
int x {get;set;}
int y {get;set;}
}
[httpPost]
public string getValues(Point pt_in)
{
Diagnostics.Trace.TraceInfo(pt_in.x);
//Also tried using HttpUtility.Encode/Decode to read pt_in.x
}
that's it.
When I try from postman, different combo, different errors:
"Message": "The request contains an entity body but no Content-Type header. The inferred media type 'application/octet-stream' is not supported for this resource."
And at times (during various trial), I get 415 unsupported media type* error
I just need a simple Asp.net Web API example, where we are able to push Data as x-www-urlencode format & read the values inside the API.
Any help please?
thanks
Sum
modified 20-Sep-18 6:02am.
|
|
|
|
|
|
Thanks will try it out. most of the things explained there, I did try. But let me verify it well and get back. thanks.
|
|
|
|
|
This is a quality of life issue I've been researching. For certain controllers I would like to add a static method or property that will contain it's absolute URL so I can make redirects a little cleaner but I cannot figure out an elegant solution.
For instance
return RedirectToRoute("Index", "Home");
return RedirectToRoute(Controllers.HomeController.DefaultRedirect); Is this possible?
I've been looking at routing but all the documentation that I find is limited to top layer functionality. Additionally, everything I find requires a RequestContext , a ControllerContext , or some other object that can only be known from within the controller during a web request.
One thing that I am not liking about MVC is having the code behind peppered with string literals all pointing to different controllers and actions. I like to be able to rename the Index controller to Index2 without having to hunt down 45 different places that reference the URL. Not to mention all of the other controllers that might have an Index action that just make it more difficult to find.
if (Object.DividedByZero == true) { Universe.Implode(); }
|
|
|
|
|
|
I did see that one during my searching but since it is called from within a controller, it doesn't really help me since I am looking for a static method in a controller that will generate a correct Url all the time. I did find a way to do it but it still isn't elegant as it does not provide the absolute Url like I would like.
[MyAuthorizationFilter]
public class HomeController : Controller
{
public static string GetDefaultRedirectUrl(RequestContext context)
{
var routeValues = new RouteValueDictionary();
routeValues.Add("area", "somearea");
routeValues.Add("controller", "Home");
routeValeus.Add("action", "Index");
var urlHelper = new UrlHelper(context);
string url = urlHelper.RouteUrl(routeValues);
}
} I'm still debugging my code due to tearing it apart and rewriting it dozen times trying to figure this out. I has worked but I have to fix other things before I can see if it works for what I intend it to do.
if (Object.DividedByZero == true) { Universe.Implode(); }
|
|
|
|
|
Controllers don't have urls, that is why you are struggling to do this.
What'a the URL for this action?
public class HomeController : Controller
{
public ActionResult Index(int? id)
{
}
}
Is it /Home/Index/1? Is it /MyUrl/Index/1/Home?
The answer is both of them.
routes.MapRoute(
name: "Test",
url: "MyUrl/{action}/{id}/{controller}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
|
|
|
|
|
I was assuming that if the application can deduce which controller and action to route an http request to when a request is received that the reverse was also possible. I guess that it isn't possible after all.
It would appear that a controller cannot know where it's located in the website hierarchy until after it's called. Since the default routing basically follows the file system and/or namespaces I thought that there might be a way provided to backtrack up the structure to get a controller's absolute URL at runtime.
Sigh, back to peppering my controller and filter code with string literals.
if (Object.DividedByZero == true) { Universe.Implode(); }
|
|
|
|
|
How to Combine simple form and grid CRUD operations in single view and also post the user entered data in single submit button clicked ?
|
|
|
|
|
Good day,
as the subject suggest i would like to ask the community or atleast point em in the right direction .. i am afraid im lost within the google walls of search engine.. in fact i have 3
listed below( and some follow up question as soon as these are answered):
1) can i implement ADFS(Active Directory Federation Service) log in to an existing asp.net website?
2) would i need to re do the website to implement it?
3) do i need to use any plug ins, or is there any direct way of doing that?
im sorry for being blunt... im a beginner in web and asp.net i only created a basic website... and our system admin ask me to connect it to our Active Directory as part of our company policy
thanks in advance! 
|
|
|
|
|