On the parent razor page, we add Partial View which will serve as the updatable container. On Ajax calls from the parent page, we update only Partial view content, not the whole page, thus creating a smooth user interaction experience.
If I recall correctly, I used the technique described at this link to persist data between requests (the site is blocked at work, but the URL seems familiar): Getting information into the Layout without using ViewBag. – jgauffin's coding den[^]
You cabn't do razor pages without controllers. The db work is done from the controller - not the view. The view simply presents the data to the user in the form of appropriate markup. Once data has been retrieved from the db, put it into a session var if you don't want to keep making the round...
I use a ckeditor, which wirte text in database in html tags.How can I read it and show as bold text, for example.some text but I getting only html text.
Let's say your equation is X^2 + Y^2Then you could have two variables (integers, probably) and set them each to a random number. (probably within certain limits - do you want to allow negative numbers, for example)Then get the user's attempt into another variable (answer).Then...
I want to create invoice Error Is An unhandled exception occurred while processing the request. SqlException: Incorrect syntax near '/'. Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, bool breakConnection, Action...
I have dropdown with values, whenever user selects a value from dropdown on change event it fetch data from table through EF and display in the page i.e. has input textboxes.Thanks in advance
Hello Friends i'm back with some questions which will help me.Answer as links directly give some information as Answer to my questions1)What is Razor is it having any relation with java script,whats the use of this we already having javascript for scripting techniques,html ,css for...
Hi,i have a student class like belowpublic class Student { public int stdId { set; get; } public string stdName { get; set; } public string dept { get; set; } }and my controller code is public ActionResult Student() { ...
Hi,I have created the project template for my MVC projects.And also I have created the wizard for these templates. Now I have used the project templates names are MVC3Razor,MVC4Razor,MVC5Razor, MVC3Aspx,MVC4Aspx, MVC5Aspx. Right now I have used 6 templates for my MVCprojects. Now I...
Hi every body.I create a mvc3 app.I use a ckeditor in my App for save news.I have a Content class for model: public class Content { [AllowHtml] public string Text { get; set; } }this is My razor view code:@model...
hi all.Please Help me.I use ckeditor_4.2_full in my mvc3 website.it works when I test it on my pc.(in FireFox and Chrome).But when I upload my website on server, not show anything where it must be exist.why this happens? I ref it in head of page :
This error occurs when you access a property of an object that is null.As a basic step, ensure you check for nulls before accessing properties of objects.This however, may suppress the error butmay not help you solve the problem.For this ensure, your connection is correctly...
Change .cshtml to .aspx. Do not use the Razor engine.and this thead is for you-Allow Design View for MVC3 and Razor View Engine [^]I hope it solves your question.
you can follow this approach[^] to disable the buttons from controller itself after execution of your postback event (within Index Action). Client side script is not required in this scenario.
How Can i make the EditorFor input disabledi have tried using the below which doesn't work@Html.EditorFor(model => model.TaskName, new { disabled = "disabled", @readonly = "readonly" })
ASP.NET MVC Views give you the power of Razor View Engine with the flexibility of writing C# code. However, if you do too much C#, you will end up with Fat-Razors that need to go on a diet or you might be risking separation of concern attacks.
I'm also working on a similar task - mine is to extract test-nodes from html/cshtml/aspx/etc. type files.So far, I am using the HtmlAgilityPack to parse the HTML - but how to distinguish Razor markup from plain-text during parsing - THAT is the question.I haven't tried it out yet, but one...
I have this problem: I want to store a list of phone numbers where the first is rended by default with a partial view, the others are created dynamically when I press a link (i.e.: Add Phone number)...In order to do this, I created a template with the fields I use, that is the following:...
IEnumerable is a generic collection of enumerated values (i.e., a list of objects). The code is casting the dynamic object ViewBag.Albums as a generic collection and then going through each enumeration by using the foreach command.
In my controller code, I need to return two objects to the Details view (details.cshtml)Below is the Controller code:FinishProductCompleteForm FinishProductCompleteFormDetails =...
To do that, you're using the function named filter. You need to handle this event and prevent the form to be submitted (which is the actual intended action to be triggered when user clicks on submit button). To prevent this, you can add event.preventDefault();To prevent the default...
That image is working fine, just use it like, This loads the image, just make sure you have the "http://" before other it will look under your own project website...
I worked on asp.net mvc razor pages . I face issue I can't pass data from page model to view What I have tried: what i try 1- I create view model as public class AddUserViewModel { public int SelectedBranchId { get; set;...
I working on MVC razor page with .NET core 7 .I face issue Ajax request not return branches drop down list based on selected value from drop down list country . with another meaning I need cascade branch drop down list based on country drop down...
I working on razor page with .NET core 7 . my mainly issue How to pass unchecked checkboxes from html page to page model on post method ? so If I have group of checkboxes not checked so I need to pass it to page model as List on post method...
I work on asp.net razor page Login user name and password . I call Web API validate user name and password . my issue I face it I can't receive data returned after login success JSON data returned from web API after success login username and...
I work on razor page asp.net .I face issue I can't show user details using mouse or popover without using bootstrap modal I pass user details using temp data from model to view and data passed success can you apply popover for sample code...
I work on asp.net razor page model . i face issue i can't edit data table on same page by edit cell without redirect to another page I need to edit cell on same page I need to edit data on table by edit every cell on rows my code details...
I work on razor asp.net page model . i need to implement tree view with children's checkboxes then submit changes on every parent from selected checkboxes so are you have any sample on razor page asp.net can you help me by provide me sample or...
I work on asp.net razor , i get error when try make ajax request to access OnPostshiftDataUp ERROR : Failed to load resource: the server responded with a status of 400 () console.log(formdata) // serialize data ...
I work on razor asp.net core .i face issue selectedbranchid is inside post form form is get selected value without any issue but if i use another post and get selectedbranchid it become null why so How to solve issue please on page model ...
I work on razor asp.net . I face issue I can't get value of blackprintername on bootstrap model although I get the values of this property on page model but on razor html not display on input text box Black server Ip or black printer name . I...
I work on an ASP.NET Core razor page. I need to retain value of address on the page after submit, because I check value of Address after submit - it is not retained, and becomes null. I need to retain the value of the Address without resetting,...
I work on razor asp.net core I need to allow datatable to have paginations options drop down with 5,10,15,20,25 so when load data it must display default rows per page as 10 rows as first page if i need to increase it to 10 or 15 etc it will...
I work on asp.net core entity framework I have csharp function done using ado dotnet stored proceure i need to convert it using entity framwork core with another meaning how to call stored proceure using entity framework core 6 and i don't...
I work on razor asp.net core . I face issue i can't store selected value id and selected text of select option drop down on hidden fields so I need to create two hidden fields first hidden field to store selected value id and second for store...
Hi , I have this method :public static IEnumerable ListeSessionFrais(MpxFraisContext db, int siteID, int stval, string codeFrais) { var sessionfrais = (from D1 in db.H59_MpxSessionFrais where D1.CodeFrais == codeFrais ...
Hi , I have this method :public static IEnumerable ListeSessionFrais(MpxFraisContext db, int siteID, int stval, string codeFrais) { var sessionfrais = (from D1 in db.H59_MpxSessionFrais where D1.CodeFrais == codeFrais ...
I want to test a big number of data input and ouput with Nunit but i haven't any idea if someone has an idea tell me pls , khnowig that my project is done with ASP.NET MVC 4, RAZOR , Linq to enties
i use httpContextBase in almost of method that i want to do a test , and the result of almost querries contains more than 300 rows ,i can't do the test with simple Nunit test
How to show all data in a list using EF and MVC What I have tried: i write a code to show a list TeleGUID Screen Name Mobile Number @foreach (var item in Model) { @Html.ActionLink("Edit", "Edit", new { id =...
Hi!I have some difficult time to pass data to Partial view httpPost ActionResult method in Controller.Let me explain:1.Have entity which i have been generated with Entity Framework ORM and this looks like this.
I am not able to create an array to input into a db. Its most likely my syntax as this is my first MVC, Razor project, so if you can spot the errors and tell me it would be a huge help!This is my view; // Checkbox ...
I'm following a tutorial on how to build a website with MVC. I created the project as Web under C#, then chose Empty from ASP.Net 4.6.1 Templates and chose the option MVC. I created two new folders and added bootstrap, CSS, and fonts files to these new folders. I also created a new folder...
I have 10 records and My first record when I click on the picture of a field of a field picture shown But if a record 10 shots in a field in the same column I click on the image first record will be displayed again. In general I click on any field in the same column of the first record...
These are three images from the list.If you look at my first record the image the image the color purple, but when I click on my picture 3 Picture # 1 will be displayed. I'm so upset :(
My friend. My problem is that I took pictures of the database are read. And I have no information from the pictures I took, and now I want to run them by clicking Show me. The same
Please on page render populate the list as ViewBag.List= ......@Html.DropDownListFor(model => model.Id, new SelectList(ViewBag.List, "value", "text", Model.SelectedId))
Problem Description:I a trying to pass the Ienumerable data from controller to view to populate my dropdownlist.While doing so i have somehow succeded to get the data till the controller.How do i pass it to the view?.I am a bit unaware about the razor syntax as m a rookie fr mvc.Any help...
hi guys, i had developed on project in asp.net MVC. Now, as per my new requirement i want to integrated new design so, my question is in razor-view which syntax is better to use html or razor view syntax.
Hi, I want to export the content to word file which is in a div in my view page. Once when i tried, the word file got exported with html tags(div). How can i get rid of those html tag and show the exact content.Please provide sample code. Thanks.
//use this code this will help you to post the data and get the data is call back function, your action method should return the you databse value.$.ajax({ type: "POST", url: "/contrller/Actionmethod", dataType: "json", data: { value:...
You can pass the value as a query parameter in the form submission. a Step-by-step can be followed at - How to pass parameters to action methods in ASP.NET Core MVC[^] Create a C# function that will hold, request and redirect the address value -...
I have this query:var binstock = db.Bin_Material .GroupBy(m => m.Material.Name) .Select( g => new{Name = g.Key,Total = g.Sum(m => m.Qty)});ViewBag.BinStock = binstock;return.View();When I access the result via the ViewBag in the .cshtml:@foreach (var item in...
Cheers, here is what I did://Helper Classpublic class BinStockModel{ public string Name { get; set; } public double Total { get; set; }}and then in my controller:var binstock = db.Bin_Material .OrderBy(m=>m.Material.Name) .GroupBy(m => m.Material.Name) ...
have a page that searches employees by campus. The campuses are populated in a select using razor. I then get all the filtered employees but the page refuses to redraw the DOM with the current number of employees I have an onchange() of the select it calls an ajax that will call the...
Hi , Last 4 month i have learn MVC 4 using razor engine. i am very confuse about HTML5 (i don't know anything about HTML 5)what is the differecne in HTML5 and ASP.NET Razor . and how to use in MVC 4 if anybody have any link regarding this Please share with me Thansk
Hello ,try by this procedureIn the design page i declare two input type submit button with same name but different value.one is for create a student information and another is for update a student information.
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", ...
Hi,I´m creating a MVC5 app using Attribute Routing. After reading many Error Handling stuff, I create a CustomErrorHandlerAttribute, create an Application_Error method into global.asax and modify the web.config customErrors tag.The routes are mapped as attributes aka [Route("Account")].......
Hey Chetan,This Article of mine might solve your problem:http://www.c-sharpcorner.com/UploadFile/cd7c2e/implement-insert-update-and-delete-functionality/[^]
You can create a Action Filter that you need to place with the action.And In this Action Filter (OnActionExecuting and OnActionExecuted) you can write your authentication code.
Hi, I am very new to ASP NET Core razor pages. I have a requirement to set up Google Tag Manager in ASP NET Core razor pages. Usually in the ASP.Net solution we use Google Analytic's tag.js script in page load. In angular we usually set up in...
I need to convert data from my model that is available as an C# array to a Javascript array.I tried JavaScriptserializer and other methods I foundbut nothing worked so far. Maybe I got some kind of syntax error.My site also uses Razor Viewengine. I don'T know if that may cause the...