I've been studying TDD for a few years and read quite a few books but none that good to be honest. Can anyone recomend any good ones. I'm not interested in BDD but am keen on anything that tackles the many problems of mocking intrinsic MVC objects.

Member Avatar
Member Avatar
+1 forum 1

I have a bootstrap view which I am trying to get a modal working for. Unfortunately the modal is displaying as part of the page, not invisable. So it is displaying with it's content as part of the page. Here is my code: <!-- Placing excel upload modal here... --> @using (Html.BeginForm("UploadExcel", "Home", FormMethod.Post, new { enctype = "multipart/form-data", @class = "form-horizontal" })) { <div class="modal fade" id="excelModal" role="dialog"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title">Excel Upload</h4> </div> <div class="modal-body"> <p>Please upload an excel file that contains the data you are wishing to include in …

Member Avatar
Member Avatar
+0 forum 2

I am currently experiencing something strange with one of my routes' responses and haven't been able to find any information elsewhere. So, let's say I make a call to a route in my controller with JQuery, like this. It's a POST action and I expect JSON data. // Send the data $.ajax({ type: "POST", enctype: 'multipart/form-data', //'application/json', url: "/Claims/Application/SaveCurrentFormData", data: data, dataType: 'json', // we're expecting back a json processData: false, contentType: 'application/json', cache: false, timeout: 600000, success: function (result) { for (var formCode in result.forms) { var selector = "[data-formcode='" + formCode + "']"; $(selector + " [name='TicketDocumentId']").val(result.forms[formCode]); } …

Member Avatar
Member Avatar
+0 forum 3

I'm currently doing some encoding work to protect a site from XSS attacks. We've stuck a bunch of `<script>debugger;</script>` tags in the db. Dispite my best efforts, the strings I've encoded to stop the debugger getting hit (to prevent an XSS attack), are still getting hit in developer tools. Is there a chance that double encoding something could cause this to happen or is that not possible? Thanks in advance!

Member Avatar
Member Avatar
+0 forum 2

Is it possible to make a web page that takes up responsibility for backing up a web applications tables(Oracle DB, and perhaps SQL server I am trying to be multi db supportive)? Essentially I want to create a database backup script that is kicked off by pressing a button on a web page. I have no idea what a dba backup script would look like. Ideally I would place the backup someplace secured, and I can impersonate accounts. I could also use a Quarts .NET cron job, the main hurdle is I don't know anything about DBA tools.

Member Avatar
Member Avatar
+0 forum 12

I am developing a website that gives statistics for soccer games,and i want to convert the schedule of the match depending on the time zone. I created this function but it seems not to be working. public static DateTime UtcToLocalTimeZone(DateTime argDateTime,TimeZoneInfo argTimeZoneInfo) { try { return TimeZoneInfo.ConvertTimeFromUtc(argDateTime, argTimeZoneInfo); } catch (Exception) { return argDateTime; } } And this is how i display the date and time in my view: TimeZoneInfo timezone = (TimeZoneInfo)Session["timeZone"] ?? TimeZoneInfo.Local; <a style="cursor:pointer;" id="id1" versus-id="@c.MatchID" data-toggle="tooltip" data-placement="top" title="@homeMLName - @awayMLName"> @BetGuns.Web.Helper.UtcToLocalTimeZone(@c.MatchDate, timezone).ToString(dateFormat) <br /> @BetGuns.Web.Helper.UtcToLocalTimeZone(@c.MatchDate, timezone).ToString(timeFormat) </a>

Member Avatar
Member Avatar
+0 forum 7

<pre> hi every one I am working on vs 2012 and mvc 4 ,just small project , i need to apply theme( http://all-free-download.com/free-website-templates/download/magic_city_template_2087.html ) and remove default one ,can any one help me how to do this ?? </pre>

Member Avatar
Member Avatar
-1 forum 1

<div class="list-group"> <div id="id1" class="list-group-item" data-target="@Url.Action("Index","DayilyProposials")" > <span class="badge" style="font-size:10px;color:#fff" id="DailyPropNumber">0</span> <span style="font-size:10px;font-weight: 900;font-weight: 900;">Daily Proposals</span> </div> <div id="id1" class="list-group-item" data-target="@Url.Action("HotG","home")"> <span class="badge" style="font-size:10px;color:#fff" id="HotGamesNumber">0</span> <span style="font-size:10px;font-weight: 900;">@index.Index.hotgames</span> </div> <div id="id1" class="list-group-item" data-target="@Url.Action("Index","home")"> <span class="badge"style="font-size:10px;color:#fff" id="TodayNumber">0</span> <span style="font-size:10px;font-weight: 900;">Today</span> </div> <div id="id1" class="list-group-item" data-target="@Url.Action("Index","home")"> <span class="badge" style="font-size:10px;color:#fff" id="ByTimeNumber">0</span> <span style="font-size:10px;font-weight: 900;">@index.Index.bytime</span> </div> <div id="id1" class="list-group-item" data-target="@Url.Action("Live", "home")"> <span class="badge" style="font-size:10px;color:#fff" id="LiveMatchesNumber">0</span> <span style="font-size:10px;font-weight: 900;">@index.Index.livematches</span> </div> </div> this is my script $(function(){ $.ajaxSetup ({ cache: false }); var ajax_load = "<img src='http://automobiles.honda.com/images/current-offers/small-loading.gif' alt='loading...' />"; var loadUrl = $(this).attr("data-target"); $("#id1").click(function(){ $("#mainInfo").html(ajax_load).load(loadUrl); }); });

Member Avatar
Member Avatar
+0 forum 1

So here is my problem laid out as simple as I can put it. I cant combine multiple entities together that have related data but are different (one database table has id number that is shared by database table 2 and table 2 has employee number which is shared with database table 3, I need to limit the active employees in table 3 while searching for the current employees with id number “Something” because table 1 has their job details, which are also marked as active or none active and need to be limited in that search as well) Table …

Member Avatar
Member Avatar
+0 forum 2

using (MySqlCommand cmd = new MySqlCommand("SELECT EmpId, Emp_Name, Salary , Start_date , End_date , CASE WHEN (Employees.End_Date is null) THEN DATEDIFF(DATE_ADD(Start_Date, INTERVAL 30 DAY), Start_Date) * Salary/30 ELSE DATEDIFF(End_Date, Start_Date) * Salary/30 END AS Total_Salary From Employees;")) { using (MySqlDataAdapter sda = new MySqlDataAdapter()) { cmd.Connection = con; sda.SelectCommand = cmd; using (DataTable dt = new DataTable()) { sda.Fill(dt); //Build the CSV file data as a Comma separated string. string csv = string.Empty; foreach (DataColumn column in dt.Columns) { //Add the Header row for CSV file. csv += column.ColumnName + ','; } //Add new line. csv += "\r\n"; foreach (DataRow …

Member Avatar
Member Avatar
+0 forum 3

@model Stattips.Models.MatchesList <br /> <div class="col-sm-8 container-fluid"> <table class="table table-striped "> <tr rowspan="3"><ul class="breadcrumb"> <li><a href="#">Soccer</a></li> <li><a href="#">Albania</a></li> <li class="active">Kategoria Superiore</li> </ul></tr> <tr> <th>Matches</th> <th>Country</th> <th>Odds</th> </tr> @using (Html.BeginForm("AddMatches", "Matches")) { for (int i = 0; i < Model.Matches.Count(); i++) { <tr> <td> @Html.CheckBoxFor(m => Model.Matches[i].IsCheck) @Model.Matches[i].HomeTeam-@Model.Matches[i].AwayTeam @Html.HiddenFor(m => Model.Matches[i].HomeTeam) @Html.HiddenFor(m => Model.Matches[i].AwayTeam) </td> <td> @Model.Matches[i].Country @Html.HiddenFor(m => Model.Matches[i].Country) </td> <td> @Model.Matches[i].Odds @Html.HiddenFor(m => Model.Matches[i].Odds) </td> </tr> } <tr> <td> <input type="Submit" value="Add" name="button1" id ="button1" class="btn btn-primary" /> </td> </tr> } <tr> <td> <ul name="myselect" id="myselect"></ul> </td> </tr> </table> </div> <script> $('#button1').click(function(){ $('#myselect').empty(); $('checkbox.IsCheck').each(function () { var _row_data = …

Member Avatar
Member Avatar
+0 forum 1

Hi guys, as I'm looking into the MVC pattern, I thought I'd create a small application to understand a bit more. Let's look at the code: //model package model; public class StudentModel { private String name; private String surname; private int number; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getSurname() { return surname; } public void setSurname(String surname) { this.surname = surname; } public int getNumber() { return number; } public void setNumber(int number) { this.number = number; } } //controller package controller; import model.StudentModel; import view.StudentView; public class …

Member Avatar
Member Avatar
+0 forum 14

I have a SPA which uses an AngularJS front end and C# back end. The issue I'm having is when I navigate to the login page, it is using @Html.Partial("_LoginPartial"). The url then becomes .../Account/Login. When I click on say the "About" tab, this uses an AngularJS route which in turn instead of routing me to the About Page, it tacks on the route to the end of the login route like so: .../Account/Login#/about. Would anyone know how I would resolve this? I have spent hours looking into this issue and haven't really found anything as of yet.

Member Avatar
Member Avatar
+0 forum 1

Im working on a small website and im a little confused on one step. I'm following a very simple mvc pattern, ive currently got one controller that creates a session array that holds all the posted data IF the form has been submitted, This data is coming from several different dropdown boxes which all have different Ids: if(isset($_POST['btn-calcCon'])){ $_SESSION['post-data'] = $_POST; $_SESSION['post-data']['heatingType']; $_SESSION['post-data']['meterType']; $_SESSION['post-data']['noBedrooms']; $_SESSION['post-data']['houseType']; $_SESSION['post-data']['houseAge']; } I have a select statement in my Model class that uses these session variables in a WHERE clause as below: <?php session_start(); require_once('../Config/config.php'); class ConCalc { public $dbconn; public function __construct() { $database …

Member Avatar
Member Avatar
+0 forum 2

SEEMS AS IF MY ARTICLE HAS BEEN SUBMITTED TWICE. I DO APOLOGISE FOR THAT Hi guys, I'm working on a small website and I'm currently stuck on a small issue. Ive got a set of dropdown boxes created and populated in HTML, for example: <select name="heatingType" id="heatingType" required> <option value="" disabled selected>Select Your Option</option> <option value = "Gas">Gas</option> <option value = "Electricity">Electricity</option> <option value = "Other">Other</option> </select> I'm able to store the values in a variable once the form has been posted/submitted, These are stored in my Controller Class eg: $newCalc = new ConCalc(); // instantiate drawing tool $draw = …

Member Avatar
Member Avatar
+0 forum 2

This is a continuation of our basic tutorial on MVC Framework. In this section, we will be creating the template files for both the TBS and the Smarty template engines. **The recap** In [part one](http://www.daniweb.com/web-development/php/tutorials/476695/part-one-php-mvc-framework-understanding-the-basics), we have created application controllers, models, and the one and only lone View class. Once again, please allow me to present few segments of those Classes here. **Main Controller** We will use this as our example. All of our application controllers have the method called index(). If we can recall from part one, we made the parent controller as an abstract class with an abstract …

Member Avatar
Member Avatar
+3 forum 9

I am declaring in my model the following: import DS from 'ember-data'; export default DS.Model.extend({ name: DS.attr('string'), age: DS.attr('number') }); My server is returning the following json: {"name":"ali","age":33} When i extend the JSONserializer that expects this form must I override any method like extractArray since I am calling findAll in the route as follows: import Ember from 'ember'; export default Ember.Route.extend({ model: function(){ return this.store.findAll('person'); } });

Member Avatar
+0 forum 0

Hi, I am working of a PDF to image converstion. I found ghostscriptsharp which is a c# wrapper written for ghostscript. I used it and developed my application. Most thing if not all worked fine when i was testing with my console application. After I integrated it into the webapp It just would not work. A quick search on the internet pointed me towards permission issues and framework incompatibility. but i have ruled them out. gs32dll is there in my webapplications bin folder. so no problems there either. The webapplication is one project (webappLive) ghostscriptsharp is also a seperate project …

Member Avatar
Member Avatar
+0 forum 2

I want to save an image from my computer to my project. c:\\image1.jpg to MyWebProject image folder. how can I do it?

Member Avatar
+0 forum 0

Hi. im developing a loan processing system using mvc c# asp.net. One of the requirements of the system is to perform a credit history check on the customer applying for a loan. so this is how it works: -the customer applies for a loan. the customers id number gets stored in the id document table in the database. -since we can't automate the credit history heck process, the information is sent to an excl file so the employee then enters the customer's ID number in the system they have to do the necessary check. -so the employee clicks on the …

Member Avatar
Member Avatar
+0 forum 5

Hello. I have a SQL database called bd with a table called dados. I want to get one row from it. Web.config <add connectionString="Data Source=(local);Initial Catalog=bd;Integrated Security=True" name="bd" providerName="System.Data.SqlClient"/> variable declarations Dim DS As New bd Dim a1row As bd.dadosRow this code in the method won't return anything. In fact it throws a "object not set to an instance of an object" error. a1row = DS.dados.FindBycode(5440987) but if I perform a query I get the values: <img alt="snapshot" src="[https://www.flickr.com/photos/29661370@N04/21923636492/](https://www.flickr.com/photos/29661370@N04/21923636492/)"/> Where did I go wrong? Thanks

Member Avatar
Member Avatar
+0 forum 3

Hello guys! I need advice. So I'm working on a Reservation feature of a system. I have created a DAO's for Customer, Employee, and CustomerInquiries. I will explain to you how this works first. The customer creates a "customer inquiry" on the company website to inquire about rental of buses. The employee, then, could log into the website and view the customer's inquiry, and confirm it with the customer. It is better to remove the CustomerInquiriesDAO and just add the methods under Customer? I was also thinking that customer inquiries could just be stored under reservations table and the employee …

Member Avatar
Member Avatar
+0 forum 1

Hello. I right-clicked on a a view (Views/input/index.vbhtml) and chose "set as start page". But it always gave me an error on the browser (The resource cannot be found.) I have to manually enter the url localhost:xxxxx/input/index for it to work. I've already checked routeconfig.vb and it's ok routes.MapRoute( name:="Default", url:="{controller}/{action}/{id}", defaults:=New With {.controller = "input", .action = "index", .id = UrlParameter.Optional} Where can I correct this once and for all? thanks

Member Avatar
Member Avatar
+0 forum 1

Hi. I have to do a MVC project and I don't know exactly how to do it. on the clientside I will have an input form the data (at least two codes and up to 8) will be sent to the server (best way?) then the server will access a database and run a series of algorithms (i already have the code in **vb** from a previous windows forms app) and return 5 to 10 objects (numbers and strings) to the client which will display the results on a different view depending of the result. **can anyone make a quick …

Member Avatar
Member Avatar
+0 forum 2

This may appear as child problem but i have confusion about this When we document Root what this means?? I am creating directory strucure for framework eg this is directory structure from code tutsplus `----public Document root where public files are accessed -css -images -content -js ------ Resources -library -template -config.php about above structure someone has commented ** this puts credentials inside the doc root meaning it may get publicly available at some point** what does it means?? this is confusing for me help? I have xampp installed and has codeigniter projects in htdocs folder so which is document root …

Member Avatar
Member Avatar
+0 forum 5

What is the best practice for including JQuery in Codeigniter? I've tried including the following line in my controller code: $this->load->library('javascipt/jquery'); But, when the page loads, I get > Unable to load the requested class: Jquery My setup is using xampp, CodeIgniter folder "CI" is located in /htcdocs/ci/. Thanks in advance.

Member Avatar
Member Avatar
+0 forum 2

Hi, thanks for viewing this thread. How to call MVC controller action method from ASP.NET webform and pass few parameter to the MVC? I have found this solution: http://www.codeproject.com/Articles/37539/Redirect-and-POST-in-ASP-NET and would like to know whether is there any other ways to do it. Just like to explore other solutions.

Member Avatar
Member Avatar
+0 forum 1

I have followed all the tutorials, but still I have a problem that I can't get an object from a form to the controller using Spring MVC. What might be the case? I am using Thymeleaf to format my jsp pages. <!DOCTYPE HTML> <html xmlns:th="http://www.thymeleaf.org"> <head> <title>Getting Started: Handing Form Submission</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> </head> <body> <h1>Form</h1> ${priceIncrease.getMessage()} ddd <form action="" th:action="@{/increaseprice}" th:object="${priceIncrease}" method="post"> <input type="text" th:field="*{message}" /> <p><input type="submit" value="Submit" /> </form> </body> </html> package com.springapp.mvc; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import store.service.PriceIncrease; import org.apache.commons.logging.*; @Controller public class PriceIncreaseFormController{ protected final Log …

Member Avatar
+0 forum 0

I have followed all the tutorials, but still I have a problem that I can't get an object from a form to the controller using Spring MVC. What might be the case? I am using Thymeleaf to format my jsp pages. <!DOCTYPE HTML> <html xmlns:th="http://www.thymeleaf.org"> <head> <title>Getting Started: Handing Form Submission</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> </head> <body> <h1>Form</h1> ${priceIncrease.getMessage()} ddd <form action="" th:action="@{/increaseprice}" th:object="${priceIncrease}" method="post"> <input type="text" th:field="*{message}" /> <p><input type="submit" value="Submit" /> </form> </body> </html> package com.springapp.mvc; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import store.service.PriceIncrease; import org.apache.commons.logging.*; @Controller public class PriceIncreaseFormController{ protected final Log …

Member Avatar
Member Avatar
+0 forum 1

Hi there so i was just wondering how i would go about developing some sort of page to display whether or not a module has been loaded or not, is there some simple way to do this that can scan your web app on launch and then report if a module has loaded or not?

Member Avatar
Member Avatar
+0 forum 2

The End.