Part 1: Master the ASP.NET MVC Project Template & Technologies (Razor, jQuery, JavaScript, Bootstrap, CSS). Part 2: Build an ASP.NET MVC app which runs in the browser but feels like using a desktop app.
This article is an attempt at splitting out the controller layer to reduce its complexity and improve quality and maintainability of the resulting code.
"return Json(true,JsonRequestBehavior.AllowGet)" returns 'true' on screen instead of calling Onsuccess MethodI am calling Action method from Ajax.BeginForm("ActionMethod",new AjaxOptions{OnSuccess="MyScript",HTTPMethod="POST",OnFailure="MyScript2"})What I have tried:I tried...
Follow below steps to implement AJAX.BeginForm in MVCStep1: Enable Unobustrive in web.config Step2: Add following code in your view page(*.cshtml)@using (Ajax.BeginForm("PerformAction", new AjaxOptions { OnSuccess = "OnSuccess", HttpMethod="POST", OnFailure =...
The "A" in "AJAX" stands for "asyncronous". That means the code doesn't wait for the $.ajax call to complete before it continues. Your success callback will be called once the request has completed, but that will be after the modal is shown. ...
want to dynamically populate dropdownlist. have table of District{district_id,distrint_name} and Thana{thana_id,thana_name,district_id(fk)}.The controller code:public class CenterController : Controller { string connection...
If the pass the registered email id and password to login it's showing the error. There is Exception thrown in entityframework.dll and Repository.dll What I have tried: I have tried deleting .vs folder. Tried cleaning the source and rebuild it.
I am trying to pass valued from my database to a shared view but I keep getting this error (Please note I am very new to MVC, so I dont understand the error I get) - The model item passed into the dictionary is of type...
Im having trouble disabling or set textbox to readonly after postback submission.what code do i need from controller to disable a razor textbox in views.please dont suggest to use jquery for me to familiarize mvc thanks.What I have tried:i can do this by default but cant control the...
MVC is a server-side technology, you can't use it to dynamically amend the DOM in the browser, so I'm afraid you're going to have to use javascript or jQuery to do this.
2. I am having 2 webgrids , when i check the rows of a first grid then it delete and moves on to the second grid. and when i check the rows of a second grid then it delete and moves on to the first grid.
I have 2 buttons but I cant bring my model to the page and click a button to determine how to set my model. I’m thinking if I can get my model in my page I’ll be able to figure out these buttons possibly. I tried bring the model like usual new { model = Model} but my model Is still null… Here...
i want to fill two textboxes from database on the seletion of dropdownlist.What I have tried:can anyone give me demo on this question. i am stucking here.i tried my best.but not getting output.
what is the difference between 3tier architecture and mvc . and can use 3 tier architecture in MVC.kindly suggestWhat I have tried:i have worked on 3 tier architecture. and beginer in mvc can use 3 tier in mvc. what are the advantage and disadvantage
That's like comparing apples and oranges. MVC is a presentation framework that separates the various parts of displaying the data (into model which represents the data, the view which shows it and the controller which is the interface between the two) whereas 3tier architecture allows you to...
I have several URLs which I need to transfer to domain name. I have tried through code but I am getting two 301 redirects. My requirement is to simply redirect below URLs to...
I am creating a ASP.NET MVC web site and as the title say i am trying to send a POST request to Web Api controller with jquery, but am always receiving a 404 error. The crazy thing is that in the .NET framework 4.5 the exact the same thing worked, but in the .NET framework 4.6.2 it really...
404 is "page not found". You are looking for a route that does not exist. As "j snooze" mentions, as part of the debugging of routes, try it manually. Also, use the Web Browser debugging tools and check the actual raw conversation to see if the URLs being called are in fact what your route table...
Did you check the Cross-Origin Requests (CORS) setting? I'm guessing, this is the error the application is throwing when invoking the API through jQuery AJAX request. HTTP404: NOT FOUND - The server has not found anything matching the requested URI (Uniform Resource Identifier). XHR OPTIONS ...
I have a partial view in which I am passing a model (the model object is not null). This is the method in the controller: [ChildActionOnly] public ActionResult LargeHeader() { PWQuote quote = db.GetRandomQuote(-1); return PartialView("_LargeHeader", quote); } When I try to use the...
it will be heplful if some one can tell where from this "model => model.StateName" is comming and also about htmlAttributes: new { @class = "control-label col-md-2" } auto generated in .cshtml file using entity framework@Html.LabelFor(model => model.StateName, htmlAttributes: new { @class...
The following line:@class = "control-label col-md-2"is "bootstrap" selectors. (bootstrap.css stylesheet classes)"model => model.StateName"...this is a property on the model object. Your model object class will be defined at the top of the cshtml as "@model myModel" or something...
Hello! I have a problem with sending objects (as hidden) to the controller for it to operate with them.I have a table that has hyperlinks in its first column's values. I want to call a method which recives the object of that row, but I dont want that user to see the object. How can I achieve...
Hi,I think you can serialize and de-serialize the object to get the desired output.convert an user-defined object to the javascript option using Json.Enocode(Item)Then pass the object to the controller using the ajax function call.
Dear All! I am new to asp .net mvc. I have made a project in asp .net mvc. When hosted my project on uniquelinks shared web hosting panel I got this exception.Please help me to resolve it. Thanks in advance. What I have tried: I have googled it and applied some solutions like change in web i.e...
As the exception says, you need to change your AppPool from the "classic" (IIS6) mode to the newer "integrated" (IIS7) mode: Moving an ASP.NET Application from IIS 6.0 to IIS 7.0[^] If you can't find how to make that change in your web hosting panel, then you need to contact the hosting...
i have used CRUD for:parcel type, weight, delivery area, collection area, delivery type, width, height, length, vat and quantity.all those tables above, i have created eg:public int typeID {get;set;}public string typeName {get;set;}public double typePrice {get;set;}outcome:...
hello i have to developpe a fuel products prices management system there are several prices with its formula that i have implemented and i have to calculate all this prices and store theme in database -price for domestic customers -prices for foreign customers -price for foreign regular...
1 There is rarely a "best" technology, but asp.net and mvc are certainly more than capable and a good option 2 It's up to you. These days people tend to use Entity Framework\LINQ as it's easier to do. Especially for simple operations like CRUD and basic queries so EF is probably a good option...
I want to convert html to pdf in mvc . for this i am use Abcpdf converter .i am use following code but its gives error ""Unable to render HTML. Unable to load page. (HTTP 403)." . Every time we i run this following line gives error and brake execution " theID =...
See HTTP 403 - Wikipedia[^]. AbcPdf is not a web browser. It might not work as such regarding redirections which are used by the Yahoo URL from your example. If you type that URL in your browser, you will notice that there is a redirection (in my case to "https://de.yahoo.com/?p=us"). You can...
i have a ajax action link button like below@Ajax.ActionLink("View Document", "ViewDocument","Property", new RouteValueDictionary { { "id", ViewBag.DocumentName } }, new AjaxOptions{ HttpMethod="GET", ...
abp boilerplate ASP.Net MVC , showing error AuditingInterceptor.cs not foundWhat I have tried:[AbpAuthorize(PermissionNames.Pages_Tenants)] public async Task CreateTenant(CreateTenantInput input) { //Create tenant var tenant =...
Why are you asking us, a bunch of people who have never heard of ABP Boilerplate?Ask in a forum dedicated to the library you're using, here[^]. See that little "Forum" link at the top of the window? Click it and ask your question in there.
Hi, How to give access permision to Network path from web server to file server in IIS?What I have tried:I am accessing network path to download files from web server to file server but it is showing some prvillage error.
You need to run your site's code under an account that has the desired permissions to access the network share. This will explain how you change the account the code runs underApplication Pool Identities : The Official Microsoft IIS Site[^]If no suitable account exists then you'll need...
I have a DataTable object, that i'm using to represent data in a view. The view is generic and therefore i want to just pass in data and display it on the page for all my models (rather than having a different view for each model, when all going to look the same visually).My problem is, i'm...
I am new for Active Directory authentication. Need to create login using active directory. Please help me with explained example or link where i can learn to create active directory login
Yes, you can merge rows and columns dynamically. First you need to get Id of row or columns. You can get it by inspecting element of WebGrid.Following links will you idea to achieve...
I have a basic key value table from a SQL Server Local DB. I would like to add a checkbox which expands (and contracts) the table if selected/unselected.Start:Add Prices With Sides: [unchecked checkbox]Pancakes: $4.00Waffles: $5.00Add Prices With Sides: [checked...
I have one datable consist around 25000 record datable look like this Id Name Lname bday 1 abc hdhd 25-02-1991 2 cnd dhdhd 7-05-1995 3 dhdhd ddjd 15-07-1993 4 dhhdd ddddhd 05-09-1999 i am converting above...
This is your 49th question, pretty much all of which can be answered with a trivial google, or a little knowledge of the classes you are playing with. In this case, it's simple to work out what you need to do by thinking about a DataTable and...
I am displaying data from database using a model. While displaying data I have added one more column with textboxes so that a user can input the quantity in that text box. After submitting the data I want that data to be stored in different table how can I achieve the.for ExampleI have a...
So to make sure I understand correctly.You have 2 models. Inventory and Orders. These models correspond to tables of Inventory and Orders as well?Since i don't see any code for your Action in your controller i'm going make one up.I'll first provide one of many possible solutions,...
when you already have quantity value when you are inserting that data into inventory table at same time you can also insert quantity value into order table. you don't need any viewmodel in this scenario.
Hi experts, I want to add google calendar for event same as google contact in my mvc applicationmy need is i have a textbox for date and a button for add this date to google calender. and i have no idea how i implement this. if any one has the code for the same send me....
My MVC5 application already has some users with assigned role created. I have a Ticket model with some basic ticket information. What I want to do now is I want to add an extra property called AssignedToUser to this Ticket model. In my Index View, I want to see a single User Name assigned to...
Add one properties AssignedToUser of type int and one unmapped properties AssignedUserName (which will hold the name of that user) of string type in ticket model. So one ticket can assign to only one user at a time. When u fetch a ticket info that time you can set the AssignedToUser value. For...
hello guys !I'm using ELMAH to store exception logs to database. on elman.axd it's showing few columns like StatusCode User and more.how can I increase these columns ? add more columns to show on page ??and how can i change the existing columns ? like if it shows HOST column these...
Hi,I have created a model class using Database first approach in MVC5.I used the ADO.net for connection with Sql server.But now I added a new table in sql server.What I need to do to use this table.Can this new table be added in the same existing .edmx model.Please...
Hi,I am new to MVC and I am trying to add a user to a role after login. I have managed to use the AuthorizeRoles on actions in a controller but when trying to add a user to a like as per the below code I get an error saying User Not Found.System.Web.Security.Roles.AddUsersToRole(new...
HiI imagine thathttpContext.User.Identityis not being set to the logged in user.You need to make sure that in your application some code is setting it to correct value.An example is to use FormsAuthentication to set the cookie and configure FormsAuthentication in web.config for it to work.
I've created a training site in MVC 5. I've been asked how easy it would be to add webinar capability to it. All my "webinar" searching shows webinars on MVC, but not how to add a webinar page to an MVC app.Any suggestions on where to start?
I want to add a '+' symbol below the table that shows the content of a particular table enabling the user to add another row of data to the table. I want the data to be saved in the database.I tried integrating my two current views together but it doesn't work. Here is my View for...
1st apporach:The View you have shared here is showing all the records from database. If you want to add one more row which means that you are creating a new record. For that you'd be requiring a different View. (Which you removed already)2nd approach:You can do it via jQuery. See this:...
Execuse me, How we can add an image in Html code of asp.net mvc5..and how we can to change the colour of Navigation Bar in Layout..please answer for me..
I have 2 roles Admin and DonorUpon registration any user must be added to the Donor role. How do I achieve this with identity and mvc5. [HttpPost] [AllowAnonymous] [ValidateAntiForgeryToken] public async Task Register(RegisterViewModel model) ...
First check for result, then only add role. That mean change the position of UserManager.AddToRole like:var user = model.GetUser();var result = await UserManager.CreateAsync(user, model.Password);if (result.Succeeded) result = UserManager.AddToRole(user.Id, "User");You can add...
I have made a simple MVC project and added a .svc file to it and trying to call the function under the .svc file from another client project but every time i am getting the error for Additional information: There was no endpoint listening at...
Previous I was working on the Asp.Net(C#) with the ADO.Net Web Application, Now i want move on MVC 5. I am totally new in the MVC.I want to know which one is better in MVC 5, that ADO.Net or Entity Framework ?What I have tried:I have not perform any project with the use of MVC...
Which is better: a speedboat, or a Ferrari? *Without knowing the intricate details of your project, or your team's experience, capabilities and preferences, there's no way we can tell you which technology is "better". They're both pretty good, and both perfectly usable in ASP.NET MVC....
This is one of the most common problems we get asked, and it's also the one we are least equipped to answer, but you are most equipped to answer yourself. Let me just explain what the error means: You have tried to use a variable, property, or a...
I working on MVC razor pages asp.net core 7 . I can't display success message after submit and insert data on same page . I get error System.NullReferenceException: 'Object reference not set to an instance of an object.' error happen on...
I have a controller named CustomersInfoAPIController. I'm using Knock out, webapi2, asp.net mvc5 to build an application. I'm binding the data using knout JS. When I run the application and debug the knockout script, I don't see any error .When I try to insert data using AJAX I see error...
Use dev tools (F12 in Chrome) to inspect the JavaScript that the client has. You might find the URL supplied for the call is not what you expect it to be.Does this...url: '@Url.Action("SetSelectedHO","../../Controllers/ReportsController")'... generate a valid URL? It looks as...
You don't need to specify the path when using Url.Action() method. You need to specify the Controller name instead.So if you have a Controller that was named ReportsController, then you could try doing something like this:url: '@(Url.Action("SetSelectedHO","Reports"))'Note that...
For OnChange event of a dropdown, I am making a ajax call. In the url path, when I give the Controller/Action path it does not hit the method at all.My code looks like:function FillHO() { //alert('Test'); var stateId = $('#ddlHO').val(); $.ajax({ type: "POST", ...
Hello, in my Controller, json result returns start date as 04/04/2017 but when I print start date in AJAX call return in view it displays as /Date(1488133800000)/ I manipulated start date as below but it prints 4/4/2017.I need to print 04/04/2017. how can I do that? $.ajax({ url:...
try var str = '4/4/2017'; var parts = str.split('/'); var month = ('0' + parts[0]).slice(-2); var day = ('0' + parts[1]).slice(-2); var year = parts[2]; var result = month + '/' + day + '/' + year;
i have called ajax call that had worked successfully with success function also but i have used on modal popup in my project. once modal popup closed then i had called ajax cal at the time action method called that had excuted sucessfully with...
It seems to me, You are trying to mix Ajax.BeginForm and Html.BeginForm. Yout code should work without @Html.Beginform block. Try to use this code without this block.
List files = new List(); List fi = new List(); string dpath = Path.GetDirectoryName(Server.MapPath("~/Files/")); while (sd.Read()) { if (sd["attachmentname"] != DBNull.Value) ...
In your view you define the Model@Model List Remove that line. The @Model is a dynamic, if you put a List into it from your controller, it will work as a List of strings. Also, because the items in the list are strings, you do not have use the .ToString() on each and every @Model[i]
Projcet in MVC & VB.net This is the full error message: System.Data.Entity.Core.ProviderIncompatibleException: 'An error occurred accessing the database. This usually means that the connection to the database failed. Check that the connection...
Always google any error messages you get, there are lots of pages that explain the problem and solution, this is just one The entity or complex type 'Categories' cannot be constructed in a LINQ to Entities query.[^] You can search for more yourself The entity or complex type cannot be...
As the message says, what you're doing is not supported in LINQ to SQL. Specifically, creating a new object Person. There is a simple workaround though. Just convert the data to .ToList() or .ToArray() and after that you can do Select: .ToArray().Select(i => new Person { ... });