i write certain piece of code using mvc 4 and jquery and jtable ,but data is not visible in grid ,only blank grid is present , (No data available!) although i have updated all references of jquery in vs 2012 , action method is showing 3 records at quick watch but not showing in grid any help here is view action method [HttpPost] public JsonResult DeptList() { try { List<TBL_Department> persons = new List<TBL_Department> { new TBL_Department{DepartmentID=1,Department="Aaa",Abbreviation="a",prefix="AR",DeptInchargeID=2}, new TBL_Department{DepartmentID=2,Department="Bbb",Abbreviation="b",prefix="AR",DeptInchargeID=2}, new TBL_Department{DepartmentID=3,Department="Ccc",Abbreviation="c",prefix="AR",DeptInchargeID=2} }; return Json( persons, JsonRequestBehavior.AllowGet); } catch (Exception ex) { //return Json(new { Result = "ERROR", Message = ex.Message …

Member Avatar
+0 forum 0

can any one help me how to pass model object from view to controller using ajax .i have below code but not working.i am getting null in EmpAddType .even i selected any thing from drop downlist <script> function GetFilter() { var employeeAddress = { "EmpAddType": $("#drop1 option:selected").text() } alert($("#drop1 option:selected").text()); alert(employeeAddress.EmpAddType); $.ajax({ url: '@Url.Action("SaveAddress")', type: 'POST', cache: false, contentType: 'application/json', dataType: "json", data: JSON.stringify(employeeAddress), success: function (data) { alert("You Multiple Data Passed Successfully"); }, error: function () { alert("failed"); } }); } function showDiv() { $('#MailingContactDetails').show(1000) } function showDiv2() { $('#AccountDetail').show(1000) } </script>

Member Avatar
+0 forum 0

Hello, I have two submit buttons(submit OTP & Resend OTP) in form. I need model validation(submit OTP) on one button(if OTP is not entered) and on second button(Resend OTP), it should post/submit(send OTP in Email) the form. on server side, I'll check formaction and will do diff. operations for both buttons. Thanks.

Member Avatar
Member Avatar
+0 forum 2

i have following code @model EMS1.Models.UsersViewModel @{ ViewBag.Title = "List of users"; var grid = new WebGrid(source: Model.users, canPage: true, rowsPerPage: 10); grid.Pager(WebGridPagerModes.All); } @{ ViewBag.Title = "IndexViewModel"; } <script src="@Url.Content("~/Scripts/jquery-1.6.1.min.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/jquery.validate.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.js")" type="text/javascript"></script> <h2>Grid</h2> <style type="text/css"> .table { margin: 4px; border-collapse: collapse; width: 300px; } .header { background-color: gray; font-weight: bold; color: #fff; } .table th, .table td { border: 1px solid black; padding: 5px; } </style> <h2>IndexViewModel</h2> // This is For EmpDetail in Grid <fieldset> <legend><b>uSER Details</b></legend> <table border="1" cellpadding="10"> <tr> <th> @Html.DisplayNameFor(model =>model.id) </th> <th> @Html.DisplayNameFor(model => model.UserName) </th> <th> @Html.DisplayNameFor(model => model.Password) …

Member Avatar
Member Avatar
+0 forum 1

Hello All, I have searched every forum and google etc but nothing directed me in right path. Requirement: I am using a COM object which can be initialized only once. But, when I try with webapi the first run goes fine and the rest fails as the COM object does not allow initialization for second time. With the below code, I notice that the new COMClass(); is being triggered everytime there is a GET request. Is there a way I can define the COMClass object to be executed only once and can be re-used by all the GET requests? namespace …

Member Avatar
Member Avatar
+0 forum 6

I want to show record of one row in multiple rows of webgrid. How can i achieve this. View @grid.GetHtml( tableStyle: "grid", headerStyle: "head", alternatingRowStyle: "alt", columns: grid.Columns( grid.Column("vehicleType","Type"), grid.Column("make", " Make"), grid.Column("modelType", "Model"), grid.Column("color", "Color"), grid.Column("registartion", "Registartion"), grid.Column( header: "Action", format: @<text> <a href="DeleteVehicle#" id="deleteLink" onclick="DeleteVehicle">Delete</a></text>) ) ) instead of columns i want my modelType and registration in another row. Please help me

Member Avatar
Member Avatar
+0 forum 2

Microsoft ASP.NET MVC is arguably one of the most flexible frameworks for building modern web applications. One of the things that I've noticed over the last couple of years is that with many AJAX applications using Restful web service, many MVC controllers are now almost redundant. Using the default MVC HTTP handler means that regardless of whether you actually need server-side code for rendering each view, you must have a corresponding controller. In many cases, these controllers have a single action (e.g. Index) which simply returns the view. This seems inefficient and adds to the maintenance cost of the application. …

Member Avatar
+1 forum 0

O would like to understand how to manage my website with Multilingual option for exapmple if the user is cominf form the domain .fr or .it or co.uk ect... how can i do this??? Thanks a lot for your help

Member Avatar
+0 forum 0

Hi, i am looking for a full tutorial for MVC4!!! I need a complete tutorial where i can manage user registration and one list of articles with relative reviews!! Can anybody help me with this??? If you can tell me some links where i can find something like this (because i couldn't...) or if you are that kind to send me by mail some code to : grafic.web@gmail.com Thanks a lot!!

Member Avatar
Member Avatar
+0 forum 2

I have to consume webservice that have a method like this: SubmitUser(UserReg user, HttpPostedFileBase image) { // webservice side processing` } UserReg is a custom class on webservice side that have several properties like username,id,latitude,longitude etc.. I have to submit my data through this method and save webservice response after execution of this method. All this action will perform on button click. How can I do this all. I am using .net framework 4.5 and mvc 4 Note: i am only end user of webservice Remember SubmitUser is a webservice side method and my URL is somepage.com/api/SubmitUser

Member Avatar
Member Avatar
+0 forum 2

I am trying to combine the data from two repositories in MVC4. I am using a join statement in my Action function to gather information from two tables. I am passing this this data onto my view. I am a little confused to how to correctly combine the data from the two repositories. Some help would be appreciated. THANKS! In controller: public IOwnerRepository OwnerDB; public IDwellingRepository DwellingDB; public OwnerController() : this(new OwnerRepository(), new DwellingRepository()) {} public OwnerController(IOwnerRepository oRepository, IDwellingRepository dRepository) { OwnerDB = oRepository; DwellingDB = dRepository; } Action: public ActionResult Account(int id, int? activelink) { // Link values // …

Member Avatar
Member Avatar
+0 forum 1

I have jQuery, jQuery Mobile and jQuery-UI included in my MVC4 project. I am having a problem where the jQuery-UI script only loads if the page is refreshed, otherwise the jQuery-UI will not load initially. I have tried moving the include script to the bottom of the page instead of including it in the top. This seemed to work 80% of the time with one side effect. When I posted some data to the server, I would get two posts instead of one.. ugh! I seem to be stuck and I can find anything on Google that will help alleviate …

Member Avatar
Member Avatar
+0 forum 1

I'm new to MVC4 programming. I want to populate a **DropDownList** from a table's field but don't know how to, although I searched for relevant material from Internet but couldn't get some workable info. There are 2 tables **Software** and **Category** (showing the type of S/w e.g. Anti-Virus or Graphics or OS etc...). In Software table, `CategoryID` is in `smallint` form which has a *foreign key relationship* with the `CategoryID` in Category table (in which `CategoryID` and `CategoryName` are the only fields). Now while creating the `Create` view to add/upload a new software, I want that the `CategoryName` of all …

Member Avatar
Member Avatar
+0 forum 1

Hello, I'm trying to pass a List object from view to controller. The program works by pressing the link "Add new line", this adds a new row to my web page, with a input box and i would like for that input box content, on submission, to be passed to my controller so that a can treat the data... The code would be something like this @model MyModel.Models.Line @{ ViewBag.Title = "Create"; } @{ Layout = ""; } <h2> New Line</h2> @using (Html.BeginForm()) { @Html.ValidationSummary(true) @{var lines = new List<MyModel.Models.lines>();} <table class="createTable"> </table> <a href="#" class="addNew">Add new line</a> <script type="text/javascript"> …

Member Avatar
Member Avatar
+0 forum 3

The End.