- 博客(60)
- 收藏
- 关注
原创 常用又好用的Sql语句
--sql template pathC:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\SqlWorkbenchProjectItems\Sql--plugin urlhttps://www.devart.com/dbforge/sql/sqlcomplete/?utm_campaign=ui_p...
2018-03-02 11:11:44 295
原创 jQuery如何跳转到另一个网页 就这么简单
如何在jQuery中跳转到另外一个网页HTML。其实下面我列举的几种方法也不一定都是用jQuery,也有的使用了Javascript的原生的方法,所以也算是前端跳转的一个总结吧。我们可以利用http的重定向来跳转window.location.replace("http://www.jb51.net");使用href来跳转window.location.
2017-03-31 22:36:58 58556 1
转载 web.config配置连接字符串的方法
代码如下: <add name="connstr4" connectionString="......" providerName="System.Data.Sqlclient"
2017-03-21 22:12:36 6018
原创 C#获取web.config配置文件内容的方法
本文实例讲述了C#获取web.config配置文件内容的方法。分享给大家供大家参考。具体实现方法如下:1.ConfigurationManager提供对客户端应用程序配置文件的访问。其有两个属性:ConnectionStrings 获取当前应用程序默认配置的 ConnectionStringsSection 数据。方法一:复制代码 代码如下:string myConn =S
2017-03-21 22:01:17 477
转载 left join(左联接)right join(右联接) inner join(等值连接) 区别
left join(左联接) 返回包括左表中的所有记录和右表中联结字段相等的记录 right join(右联接) 返回包括右表中的所有记录和左表中联结字段相等的记录inner join(等值连接) 只返回两个表中联结字段相等的行举例如下: --------------------------------------------表A记录如下:aID aNum1
2017-03-10 20:12:08 1540
转载 MvcHtmlString解决MVC中从后台返回HTML代码被编码问题
因为mvc中从控制器中返回回来的字符串都是经过编译的,所以如果返回来的字符是HTML直接就进行了编译,显示出来的是经过编码的后的字符,为了能让HTML能正常的应用到页面,我们可以这样做,看下面说明:首先介绍一下MvcHtmlString:表示不应再次进行编码的 HTML 编码的字符串解决方案:ViewData["funHtml"] =new MvcHtmlStrin
2017-02-23 14:20:36 3735
原创 启动MongoDB Service步骤
比如MongoDB安装在“C:\Program Files\MongoDB\Server\3.2\bin” 目录下,以管理员形式打开cmd窗口后输入以下命令即可:cd C:\Program Files\MongoDB\Server\3.2\binmongod -dbpath "C:\Program Files\MongoDB\Server\3.2\bin"
2016-12-12 16:17:29 1048
原创 3 ASP.NET Web API and SQL Server
In this video we will discuss creating ASP.NET Web API service that returns data from a SQL Server database. We will be using this service as the basis for understanding many of the Web API concepts i
2016-11-13 13:51:51 1498 1
原创 2 HTTP GET PUT POST DELETE
In this video we will discuss HTTP PUT, POST and DELETE verbs. This is continuation to Part 2. Please watch Part 2 from ASP.NET Web API tutorial before proceeding. When we talk about a databas
2016-11-13 13:49:51 355
原创 1 Creating a Web API Project
In this video we will discuss1. Creating a new ASP.NET Web API Project2. Explore and understand the Web API code auto-generated by Visual Studio For this course, we will be using Visual Studio 2
2016-11-13 13:46:53 449
原创 Part 72 - HandleError attribute in mvc
In this video, we will discuss HandleError attribute in asp.net mvc. HandleErrorAttribute is used to display friendly error pages to end user when there is an unhandled exception. Let us understand
2016-11-13 13:29:54 253
原创 Part 71 - childactiononly attribute in mvc
In this video, we will discuss childactiononly attribute in asp.net mvc. Let us understand this with an example. Step 1: Create a blank asp.net mvc 4 applicationStep 2: Add HomeController. Co
2016-11-13 13:21:01 587
原创 Part 70 - Authorize and AllowAnonymous action filters in mvc
In ASP.NET MVC, by default, all the controller action methods are accessible to both anonymous and authenticated users. If you want action methods, to be available only for authenticated and authori
2016-11-13 13:17:05 276
原创 Part 68 - What is the use of NonAction attribute in mvc
The following questions could be asked in an interviewWhat is the use of NonAction attribute in MVC?ORHow do you restrict access to public methods in a controller? An action method is a public
2016-11-13 13:14:55 225
原创 Part 69 - Action filters in mvc
What are action filters in asp.net mvc?Action filters are attributes that can be applied either on a controller action method or on a controller. When applied at the controller level, they are appli
2016-11-13 13:12:55 208
原创 Part 67 - Action selectors in mvc - ActionName AcceptVerbs
Actions are public methods in an mvc controller that responds to an URL request. You can control or influence which action method gets invoked using action selectors in mvc. Action selectors are att
2016-11-13 13:10:29 239
原创 Part 90 - Remote validation in mvc when javascript is disabled
Please watch Part 89 from asp.net mvc tutorial, before proceeding.Out of the box, Remote attribute only works when JavaScript is enabled. If the end user, disables JavaScript on his/her machine
2016-11-13 12:27:55 406
原创 Part 89 - Remote validation in asp.net mvc
Sometimes, to check if a field value is valid, we may need to make a database call.A classic example of this is the user registration page. To register a user, we need a unique username. So, to chec
2016-11-13 12:25:24 280
原创 Part 88 - Unobtrusive validation in asp.net mvc
Client side validation in asp.net mvc is unobtrusive. To turn on client side validation and unobtrusive JavaScript, make sure the following 2 keys under appSettings element within web.config file ar
2016-11-13 12:24:23 233
原创 Part 87 - What is Unobtrusive JavaScript
What is Unobtrusive JavaScript?Unobtrusive JavaScript, is a JavaScript that is separated from the web site’s html markup. There are several benefits of using Unobtrusive JavaScript. Separation of co
2016-11-13 12:23:25 192
原创 Part 86 - ValidationSummary in asp.net mvc
In this video, we will discuss displaying all validation errors at one place using validation summary html helper. A red asterisk (start) should be displayed next to every field that has failed the
2016-11-13 12:19:04 362
原创 Part 85 - Enable client side validation in asp.net mvc
Validation attributes in asp.net mvc provides both client and server side validation.There are 2 simple steps to enable client side validation in asp.net mvc.Step 1: Enable ClientValidation and Un
2016-11-13 12:17:46 308
原创 Part 84 - Compare attribute in asp.net mvc
Compare attribute is used to compare 2 properties of a model. Comparing email addresses and passwords is the common use case of Compare attribute. Let's understand using Compare attribute with an ex
2016-11-13 12:16:12 313
翻译 Part 83 - RegularExpression attribute in asp.net mvc
Regular expression attribute is great for pattern matching validation. Let's understand using Regular expression attribute with an example. We will be continuing with the example that we started in
2016-11-13 12:14:11 371
原创 Part 82 - Creating custom validation attribute in asp.net mvc
At the moment, any value outside the range of "01/01/2000" and "01/01/2010" for HireDate filed, will raise a validation error. [Range(typeof(DateTime), "01/01/2000", "01/01/2010")][DisplayFormat(Da
2016-11-12 13:34:43 250
原创 Part 81 - Range attribute in asp.net mvc
RangeAttribute checks if the value of a data field is within a specified range of values. We will be working with the example, that we started in Part 80. Please watch Part 80, before proceeding.
2016-11-12 13:31:48 196
原创 Part 80 - mvc 中的 StringLength 属性
用法很简单,具体示例如下:StringLength attribute is present in System.ComponentModel.DataAnnotations namespace and is used to enforce minimum and maximum length of characters that are allowed in a data field.
2016-11-10 17:10:22 1643
原创 Part 78 - MVC中不同的ActionResult 类型
In this section, we will discuss different types of ActionResult objects that can be returned by an action method.The following is the signature of a typical action method in a controller. Notice
2016-11-10 16:10:32 366
原创 Part 76 - ValidateInput attribute in mvc 允许文本框输入html标签
只需设置ValidateInput属性为false,即可允许在文本框输入html标签。若需要详细了解,请往下看:This validateInput attribute is used to enable or disable request validation. By default, request validation is enabled in asp.net mvc, Let's
2016-11-10 15:41:55 1079 1
原创 Sql Server服务器未开启产生的error
如果用到数据库,而Sql Server数据库未开启,就会报下面的错误,解决方法就是开启数据库服务就好了。
2016-11-04 15:01:56 338
原创 Part 66 - Check及Uncheck所有CheckBox 同时删除多行数据记录的实现
实现效果:勾选Name左边的CheckBox(后面部分简称‘它’),则所有CheckBox都会被选中, 再次Unckeck它,所有都不被选中;如果其他所有CheckBox都选中了,Name左边的CheckBox会自动选中;反之,如果其他的没有全部被选中,则它不会被自动选中或者由自动Uncheck.Controller代码如下:using MVC_DeleteMultiRow.Mod
2016-11-03 23:52:32 537
原创 @Html.EditorForModel()用法
MSDN上对@Html.EditorForModel()的解释是Returns an HTML input element for each property in the model, using additional view data, 即使用另外一个View来为本VIew中Model每一个属性返回一个Html 输入元素。以Student类为例具体用法如下:1, 在Student
2016-11-03 23:08:20 4569
原创 C# Selenium 读取本地Excel文件并测试
实现效果:选择本地Excel文件,excel名称显示在ComBoBox中,excel内容显示在DataGridView中,点击"Send Web to Test" 按钮,就会进行相关测试。Form1.cs代码如下:using System;using System.Data;using System.IO;using System.Windows.Forms;using E
2016-11-01 17:52:12 1660
原创 使用OleDbConnection读取Excel时的Microsoft.Ace.OleDb.12.0异常
使用OleDbConnection读取Excel文件时,代码没问题,编译时却报错:The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.解决办法:下载AccessDatabaseEngine.exe, 并右键单击,选择Open, 然后它自动配置好环境。这样再编译就不会报错了。附一
2016-10-30 22:32:02 9083
原创 使用Selenium的一个简单程序
步骤1,创建一个控制台程序2,下载selenium-dotnet-driver包,解压后,有一个net40的文件夹,把里面的引用添加到步骤1所建的控制台程序引用中3,下载geckodriver.exe和phantomjs.exe,并把它们放到项目的debug文件夹中4,开始写代码,如下代码实现了不同的功能:using System;using System.Collecti
2016-10-30 21:52:03 1578
原创 Part 64 - MVC Sorting 排序
本文的效果是在 Part 62,及63 的基础上实现的。实现效果: 1. Name 和 Gender 列必须是可点击的超链接。 2. 点击 Name 或 Header,就可以实现排序功能, 如果没有点击 Name 或 Header, 则该列的数据以升序排列,如果点击了该列,数据降序排列 。 3. 默认情况下,数据按“Name”升序排列。
2016-10-25 17:38:21 219
原创 Part 63 - mvc 分页
By the end of this section, the index page should support both search functionality andpagination as shown below. Step 1: Install PagedList.Mvc using NuGet package manager. PagedList.Mvc is dep
2016-10-25 13:35:18 278
原创 Part 62 - mvc search 搜索查询
Let's discuss, implementing search page in an asp.net mvc application. We should be able to search by Employee Name and Gender. The search page should be as shown below. We will be using table
2016-10-24 23:06:37 405
原创 Part 61 - Named sections in layout files in mvc
Let us understand sections in a layout file with an example. Please watch Parts 59 and 60 before proceeding. At the moment on all the views(Index, Create, Edit, Details & Delete), we see the sam
2016-10-24 20:49:15 172
原创 Part 60 - ViewStart in asp.net mvc
To associate a view with a layout file, we have to set Layout property on each and every view. This violates DRY (Don't Repeat Yourself) principle, and has the following disadvantages1. Redundant co
2016-10-24 17:07:38 209
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人