AspNet MVC4 tutorial-14: Asp. Net MVC4 ViewBag and other data transmission technologies quick comparison Demo, mvc4viewbag
Create a Project of the Basic type.
1. HomeController. cs:
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.Mvc;namespace MvcViewBagTest.Controllers{ public class HomeController : Controlle
ASP. NET Aries getting started development tutorial 3: Develop a list page and control query area, aries query AreaPreface:
After all, the Aries framework is a development framework, so the focus is to write code so that developers will not be unemployed.Step 1: Create an html
Create an Html file in three steps:
1: Introduce Aries. Loader. js2: Get a table tag 3
Let's say that we want to record it with friends in the garden and ASP. net mvc uses the Petapoco micro-ORM framework + NpgSql driver to connect to the PostgreSQL database. This blog corresponds to a video. Since there is no time to record the video in a month, I have fulfilled my promise to my friends today ..
The Directory of this video tutorial is video, code
method cannot have a public set type.
· This method cannot be a method of the controller base class.
· This method cannot contain reference (ref) or output (out) parameters.
Note that the return type of the controller action is unlimited. A controller action can return an instance of the string type, date and time type, and Random type, or a null value. The ASP. net mvc Framework converts any other type th
If you want to reprint it, Please retain your copyright:/** Description: ASP. NET custom server control internal details series tutorial* Auther: chongchong-innocent haoban* MSN: chongchong2008@msn.com* Dates: 2007-05-20* Copyright: chongchong2008 Yichang Hubei China*/
Lifecycle of controlsThe lifecycle of the control determines when to save the control and res
If you want to reprint it, Please retain your copyright:/** Description: ASP. NET custom server control internal details series tutorial* Auther: chongchong-innocent haoban* MSN: chongchong2008@msn.com* Dates: 2007-05-20* Copyright: chongchong2008 Yichang Hubei China*/
4. server control-related metadata attribute1. Design Phase attributeAttribute during the des
ArticleDirectory
Renderpartial
Renderaction
Master page (master)
1. The master page is not related to the controller. The master page is only a view file, and no controller corresponds to it.
2. In fact, the aspx of the view in ASP. net mvc is not closely associated with the master page as in webform.
For example, if you want to replace An ASPX master page, you only need to specify the
attribute
In addition to the above hard encoding method, we also have more elegant methods.
ASPnet provides us with three generated IDs. Interit
By default, all controls on the page use clientidmode with the value of inherit, which indicates that the control will apply to the same clientidmode as its parent control, that is, This value specifies that the control generates an id like its parent control. Static
Use the original control naming method Autoid
Use the default 3.5 Generation Meth
The two armies competed with each other, and PHP and ASP. NET fought against each other. You have many choices when talking about Web development. Many of these methods involve preprocessing-that is, embedding code into HTML pages using specific tags, which tell you that there are many options when Web development is mentioned. Many of these methods involve preprocessing-that is, embedding code into HTML pa
All server controls must appear in the
Note: This form is always submitted to its own page. If you specify an action attribute, it is ignored. If you omit the method attribute, it is set to method = "post" by default ". At the same time, if you do not specify the name and id attributes, they are automatically allocated by ASP. NET.
Note: One. aspx can only contain one
If you view. source code of the aspx
MyProgramDevelopment Environment:
System: win7
IIS: iis7
Development Tool: vs2008 SP1
MVC version: ASP. net mvc 2.0 RC
Before deploying an MVC application, make sure that the bin folder containsSystem. Web. MVC. dll(Very important),
If no, open the reference list in your MVC project,
Right-clickSystem. Web. MVC, Select "properties" and go to the following window:
Set "Copy local"
It is not possible to emulate the ASP (Microsoft's strongest development language) with PHP (which is now the mainstream development language), especially in the case of PHP (which is now the mainstream development language), for dynamic languages with incomplete object-oriented support. It's a lot of difficulty. In these simulations, it is said that this example can be used to understand the operating mechanism of the
. btn_startwork.enabled = true;This. div_load.visible = false;Break;}}}
# Code generated by region web Form DesignerOverride protected void oninit (eventargs E){//// Codegen: This call is required by the ASP. NET web form designer.//Initializecomponent ();Base. oninit (E );}/// /// The designer supports the required methods-do not use the code editor to modify/// Content of this method./// Private void init
Templates provided on the main webpage. Other webpages are on your website.Main webpageThe primary web page allows you to create consistent appearances and actions for all web pages (or a group of pages) on your network.The main webpage provides templates for other webpages to share the layout and functions. The content defined by the placeholder of the main web page, which can be overturned on the content web page. The output result is the content of the main webpage.The content of the webpage
Program requirements:
JQuery EasyUI Plugin: http://www.jeasyui.com/download/index.php
Details:
Reference some code:
Front-end page:
Controller code of ASP. net mvc:
Public JsonResult List (string page, string rows)
{
List
List
Foreach (Area a in areas)
{
If (a. _ parentId. Equals (0 ))
{
Result. Add (new {Identifier = a. Identifier, Area_Name = a. Area_Name });
}
Else
{
Result. Add (new {I
This section describes helper in ASP. net mvc.
Helper is actually a method group written in view to implement some flexible functions.
In fact, ASP. net mvc view is An ASPX page, which can declare the definition method. Why is there a helper?
In fact, it is nothing more than separating the interface from the logi
be exhausting and prone to errors.
What should we do?
So we need to use urlhelper
A Href="Index","Home") %>"> HomepageA>
In this way, the correct address will be obtained when the route rule changes.
Transfer
The above method enables the URL to cope with changes, but there is another problem: href = "
= Html. actionlink ("Homepage", "Index", "home ")%>
In this way, you can easily perceive and debug the code, and the code is clean.
End
The above is a simple description o
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.