在MVC中为初学者创建一个简单的项目 [英] Creating a simple Project In MVC for a beginner

查看:184
本文介绍了在MVC中为初学者创建一个简单的项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello All,



首先,我是一名中级C#开发人员(Windows Forms)。我很清楚这个网站,我是一个普通用户,当我问一个问题,我通常会显示我的工作或代码。



现在,我有刚刚介绍到MVC和C#.Net,我完全是初学者,事实上我是假的。我玩过它(MVC),我对文件夹的工作方式有了一点了解。



我的主要问题是,我真的很想知道如何从浏览器的用户输入中获取数据并通过单击按钮保存到数据库,我还将如何在浏览器中向用户显示数据。



(快速方案)



在mvc中创建一个项目,通过文本框获取用户的名字和姓氏,并通过按钮单击将提供的数据保存到数据库中。同时在浏览器上显示数据(用户名和姓)。



我可以轻松地在Windows窗体中执行此方案,但我无法在MVC和我试过了。



所以基本上有人可以一步一步地运行这个吗?我真的很感激它真的会。



基本上我想知道的是:

1)创建数据库表

2)创建文本框并将ID提供给他们插入数据的表中的哪些列。

3)通过按钮单击运行sql命令。

4)检索表格。

5)如果您还有什么想让我知道的话请告诉我。

我说我会的在Windows窗体中轻松完成此操作!



注意:我理解HTML和Javascript(但我需要知道它们如何成为少数HTML)



亲切的问候

亚伯拉罕

Hello All,

To begin with, I am an intermediate C# Developer (Windows Forms). I am well aware of this site and I am a regular user and when ever I ask a question I usually do show my working or code.

Now, I have have just been introduced to MVC and C#.Net in which I am completely a beginner, matter of fact I am dummy to it. I have played around with it (MVC) and I have got a little bit understanding of how the folders work.

My main question is, I would really like to know how to get data from a users inputs from the browser and save to database by a click of a button, and I also how to display data to user in the browser.

(Quick Scenario)

Making a project in mvc that takes a users first name and last name via textbox and saving the provided data onto a database via button click. Also displaying the data (Users first and last name) onto the browser.

I can do this scenario above in windows form with ease but I can't do it in MVC & I have tried and tried.

So basically is there anyone who can run this step by step please ? i would really appreciate it really really will.

Basically what I would like to know and see is :
1) creating the database table
2) creating the textboxes and giving ID's to which columns of the table they are inserting the data in.
3) running the sql commands via button click.
4) retrieving the tables.
5) if there is anything else you would like me to know please let me know.
As I said I would do this in windows forms with ease!

NOTE: I understand HTML and Javascript (But I need to know how they become handful HTML)

Kind Regards
Abraham

推荐答案

ASP.NET MVC有一些约定,如果你关注他们说,它们的工作原理是自动地。令人敬畏的是它并没有让你遵守约定。你可以在这里制定自己的规则,但是你需要遵循MVC模式。



在我看来,以下是一个非常好的起点,可以快速启动你的MVC开发。虽然它适用于MVC4,但它确实值得关注。



http://www.microsoftvirtualacademy.com/training-courses/developing-asp-net-mvc-4-web-applications-jump-start [ ^ ]
Hi, ASP.NET MVC has some conventions and if you follow them it works "Automagically" they say. The awesomeness is that it doesn't bind you to follow the conventions. You can make your own rule here, but yet you need to follow the MVC pattern.

In my opinion, the following is a very good starting point to jump start your MVC development. Though it is with MVC4, it really is worth following.

http://www.microsoftvirtualacademy.com/training-courses/developing-asp-net-mvc-4-web-applications-jump-start[^]


学习MVC [ ^ ]



点击此链接。如果你遇到困难请求帮助。
Learn MVC[^]

Follow this link. Ask for help if you get stuck.


嗨...



如果你是MVC的初学者,请参考我的博客。

我还创建了解释它的视频。

关于MVC实体框架和JQGrid的简单演示。



我想这对你有所帮助。



http ://dotnetsourcedileep.blogspot.in/2014/06/test.html [ ^ ]


这篇关于在MVC中为初学者创建一个简单的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆