|
Sorry the problem is its not one form and the problem not happening when I call first time, it happens when I insert into Database by using "Create Form" and redirect to the List page using "Action method", whatever is inserted in to Database using Action method should reflect in the List page when its loaded.
First time yes AngularJS is bringing all data I think maybe second time IE is just getting values from Cache rather than calling the method to get values from database.
Is there anyway to escape from this behavior of IE.
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
|
Yes, caching sounds like the culprit.
There are various options to disable caching. You can either change the server code to override the caching headers; or configure the caching headers in IIS; or change the Angular configuration[^] to prevent it from caching responses to AJAX requests.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Use ng-href instead.
<td><a ng-href="/User/UpdateUser/{{usr.UserId}}"> {{usr.UserId}} </a> </td>
<td><a ng-href="/User/UpdateUser/{{usr.UserId}}">{{usr.UserName}}</a></td>
See: https://docs.angularjs.org/api/ng/directive/ngHref[^]
Also:
<a href="http://www.codeproject.com/Members/html">@Html</a>.ActionLink("Create User", "CreateUser")
Not sure if this happened when you pasted it in, but that's pretty broken.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
Yes
"@Html.ActionLink("Create User", "CreateUser")"
This happened why I posted.
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
|
How can I print from web application in asp.net mvc ? Please check "PrintFromWebApplication" document. pdf PrintFromWebApplication [PDF/274KB] http://download.brother.com/pub/com/dev/pdf/bpac_webapplication_eng.pdf
|
|
|
|
|
No. What exactly is your question?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
i want build print in client ...using asp.net mvc .thanks
|
|
|
|
|
mvc runs on the server, you can't create client software with it. You need to focus on a technology that will deliver what you want.
|
|
|
|
|
How to create CRUD operation using WebService and call it in mvc4
pls reffer the related tutorials and your valuable guidance..
|
|
|
|
|
sunil3 wrote: pls reffer the related tutorials You can try Web Development[^] or a general search through Google.
|
|
|
|
|
I have 1 image as background and other as main image, now i need to do drag main image and drop on background image and save combined image using mvc.net 5.0
|
|
|
|
|
Better start writing some code then, you're going to need a lot of it 
|
|
|
|
|
at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
at System.Collections.Generic.Dictionary`2.ContainsKey(TKey key)
at System.Collections.Generic.Dictionary`2.KeyCollection.System.Collections.Generic.ICollection<TKey>.Contains(TKey item)
at DotNetAgent.Trackers.ComponentCountInfo.RecordExternalComponent(String componentName)
at DotNetAgent.Trackers.DefaultTracker.Finish()
at DotNetAgent.Trackers.db.DbCommandTracker.Finish()
at DotNetAgent.Trackers.DefaultTracker.Exit()
at DotNetAgent.Sequences.Sequence.FinishTracker(ITracker tracker, IAgent agent)
at DotNetAgent.Instrumenter.Factories.Web.CallHandlerExecutionStepTrackerFactory.FinishTracker(Object dummy)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously
|
|
|
|
|
We can't see your screen. We can't access your computer. We can't read your mind.
Even if we had the error message, which you managed to avoid posting, we don't have access to your code. Without seeing your code, we can't tell you what the problem is.
All we can tell you is that part of your code is using a Dictionary<TKey, TValue> incorrectly. If I had to guess, I'd say you're using it from multiple threads without proper synchronization, which is corrupting the internal state. If that's the case, then I'd suggest using a ConcurrentDictionary<TKey, TValue>[^] instead.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hello, I wrote my first API today and I used AutoMapper. I have a simple clarification question about the bolded line of code here:
public IEnumerable<MoviesDto> GetMovies()
{
return _context.Movies.ToList().Select(Mapper.Map<Movie, MoviesDto>);
}
I am aware that Mapper.Map is an AutoMapper function which is mapping my domain model to my Data Transfer Object (I wrote all of this code from scratch earlier), but I'm slightly confused on this syntax...
Is this basically pulling all of the data in my Movies table out of the database and then taking it and inserting the values into my DTO's properties and then returning those Dto properties to the client all in one step??? I'm guessing that is what it is doing but I'm not 100% sure. Sorry for the ignorance, I've only been coding since May but am excited to have made my first API!
|
|
|
|
|
The .ToList() call pulls all of the data from your Movies table into memory.
The .Select(...) call is part of Language-Integrated Query (LINQ)[^]. It's a projection operation[^] which converts a sequence of values of one type into a sequence of values of a different type, by calling a user-defined function for each item in the source sequence. In this instance, the function it calls is Mapper.Map<Movie, MoviesDto> , which is the AutoMapper function to translate your data class to your DTO class.
It's almost equivalent to something like this:
List<Movie> movies = new List<Movie>();
foreach (Movie movie in _context.Movies)
{
movies.Add(movie);
}
List<MoviesDto> result = new List<MoviesDto>();
foreach (Movie movie in movies)
{
MoviesDto dto = Mapper.Map<Movie, MoviesDto>(movie);
result.Add(dto);
}
return result;
The main difference is that LINQ is lazily evaluated. The Select projection isn't processed until the returned sequence is enumerated, and the items are processed as they are requested, rather than being stored in a list.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
How to use two dropdownlist to select the province and the city?
Thanks.
|
|
|
|
|
|
That's called a cascading dropdown, so google "asp.net cascading dropdown" and you'll find various examples.
|
|
|
|
|
Hi
I am new in DROOLs pls provide me some sample how Drools implemented with MVC Dot Net
Thanks
|
|
|
|
|
All someone is going to do is google "asp.net drools getting started" and post come links from the results, so you might as well just do the search yourself.
|
|
|
|
|
I've spent many, many hours toiling through learning ASP.NET MVC. The good news is, I actually understand most of it. However, there's one thing I'm not making a connection on.
I have a simple view called Customers which just shows a table with customer names and their membership types. I discovered that in the CustomerController, if I do not put this line of code in (in bold), my view cannot access the Membershiptype.Name field:
public ViewResult Index()
{
var customers = _context.Customers.Include(c => c.MembershipType).ToList();
return View(customers);
}
However, I don't have to put a specific Include() in there to access customer.Name. See Customer View code below:
@foreach (var customer in Model)
{
<tr>
<td>@Html.ActionLink(customer.Name, "Details", "Customers", new {id = customer.Id}, null)</td>
<td>@customer.MembershipType.Name</td>
</tr>
}
In this example, I had to add the
Include(c => c.MembershipType). into the chain to access customer.MembershipType.Name from within the View, but there is not a
Include(c => c.Name) needed in order to access customer.Name. Why is this? What exactly is this Include method doing? Thanks.
|
|
|
|
|
This isn't an MVC question but an Entity Framework one (I assume _context is an Entity Framework database context).
If you have data in two tables like
MembershipType
MembershipTypeID, Type
1, Basic
2, Full
Customer
CustomerID, Name, MembershipTypeID
1, John, 1
2, Dave, 1
These two tables relate on the MemebrshipTypeID, but they are part of different entities (each table is an entity). In EF when you ask for Customer entities;
_content.Customers.FirstOrDefault().Name
all it is doing is loading the data from the Customer table so you can only reference things in that table. However as the tables are related, your Customer class will have a MembershipType property too that will hold the data from MembershipType. By default this data isn't loaded though, so this
_content.Customers.FirstOrDefault().MembeshipType
will be null, so this
_content.Customers.FirstOrDefault().MembeshipType.Type
will throw a null reference extension. When accessing data you can tell EF to load related tables too by using Include
_content.Customers.Include("MembeshipType").FirstOrDefault().MembeshipType.Type
this will now work as when Customers is loaded, EF also loads the data from the related MembershipType table too and you can access properties from that entity.
|
|
|
|
|
Awesome, thank you! Makes a lot of sense now!
|
|
|
|
|
I am trying to understand how MVC Model Binding works so that I can switch from using a Textbox to using a Dropdownlistbox.
In my Edit View I have a form that allows users to Edit a product after modifying its Name, Price, and CategoryId.
The Merchandise's CategoryID is the Primary Key in the Categories table and a Foreign Key in the Merchandise table in the database.
Instead of making users enter a number for the CategoryID I want them to select a CategoryName from a Dropdownlistbox. Once a CategoryName in the Dropdownlistbox is selected the CategoryID is selected automatically.
I have tried to use the following code in my ProductController but it is not working.
[HttpGet]
public ActionResult Edit(string id)
{
MerchandiseServiceClient msc = new MerchandiseServiceClient();
MerchandiseViewModel mvm = new MerchandiseViewModel();
mvm.Merchandise = msc.FindMerchandiseByID(id);
ViewBag.CategoryList = new SelectList(msc.FindAllCategories(), "ID", "Name");
return View("Edit", mvm);
}
[HttpPost]
public ActionResult Edit(MerchandiseViewModel mvm)
{
MerchandiseServiceClient msc = new MerchandiseServiceClient();
msc.EditMerchandise(mvm.Merchandise);
return RedirectToAction("Index");
}
// --------------Edit View-------------------------------------
<tr>
<td>@Html.LabelFor(model=>model.Category.ID, "Category")</td>
<td> @Html.DropDownList("CategoryList", "Select Category")</td>
</tr>
How can I change my code above to use the dropdownlistbox?
modified 19-Jul-16 13:21pm.
|
|
|
|