使用C#.NET进行Web开发的好处[关闭]

my question might sound stupid to some of you, but I need some good answers here. I have experience working with PHP and Ruby on Rails. I know what are the benefits in using both technologies, (MVC, performance and etc). Now I am working on a project written in C#. Based on what I have seen so far, the browser code is a mixture of HTML, inline and external CSS, and I some C# methods to generate HTML content. Everything is so messy, I have been working on it for 3days and I am still confused.From that C# implementation, there is not well structured MVC. My impression is that C# does not seem like a good choice when it comes to web app (for me). Maybe the code I am working with is written in a wrong way. My question is, is the messy HTML/CSS and the lack of MVC implementation something common when it comes to C# ? What are the benefits of C# over PHP, Java and ROR for developing small and big web applications.

Exaple from the code I work with:

</td>
    <td align="left">
       <asp:TextBox ID="txt_to" runat="server" Enabled="true" 
                    TextAlignment="Center" MaxLength="7000"
                    AcceptsReturn="True"  ToolTip="Add ; after a recepient to add another recepient" 
                    CssClass="txt_Message1" TextMode="MultiLine"></asp:TextBox>
       <asp:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" 
                    TargetControlID="txt_to" MinimumPrefixLength="2" 
                    CompletionInterval="10" CompletionSetCount="3"
                    EnableCaching="true" FirstRowSelected="true" 
                    UseContextKey="True" ServiceMethod="GetCompletionList"
                    DelimiterCharacters=";, :"  howOnlyCurrentWordInCompletionListItem="true" /> 

       <asp:Label ID="lbl_ToError" runat="server" CssClass="Error"></asp:Label>
    </td>

This look too much complicated for me, at the end of the day it is just a text field :) And another thing, most of my global Css gets overloaded by the inline values ( I believe they are generated using some sort of a generator or VS tool).

Please, dont get offended, I have no experience with C# .NET this is my first contact and my impression is "Never ever". I hope it is the code I am working with, not the C#. Give me explanation why I should use C#? So far it has been a pain for me :)

dpno17028
dpno17028 你的例子与C#并不真正相关......这真的是asp.netweb表单的问题,它的服务器端编程比其他东西更好或更差(比如MVC)。你所谓的凌乱对于那些采用服务器端方法的人来说可能是有意义的。我不认为你会在堆栈上找到你的答案。作为一个.net开发者,我可以告诉你,我有类似的挫折感,从网络表单转移到像轨道上的ruby或objective-c。当你改变堆栈时,你需要了解新的哲学。你现在可能总是同意他们。
8 年多之前 回复
douyun3022
douyun3022 我同意ASP.NET的控件可能有点多,虽然我不认为你显示的代码很难遵循。ASP.NETMVC是向IMO迈出正确方向迈出的一大步,特别是在与Razor一起使用时。无论您使用何种语言/框架,都需要程序员编写好的代码。虽然你总会发现自己正在研究一个看起来像是由实习生写的项目;p该死的!
8 年多之前 回复
dpstir0081
dpstir0081 主观是我要找的词,谢谢@jwiscarson!
8 年多之前 回复
dongtuoao7987
dongtuoao7987 对我来说,这个问题几乎无法回答-C#适用于某些人,而不适用于其他人。这取决于开发人员的经验和项目的要求是的,这只是一个文本框-但是具有CSS类,工具提示,宽度,最大长度和启用的属性集。设置很多属性通常意味着编写大量代码。
8 年多之前 回复
douya2433
douya2433 不太确定这个问题对SO有意义。与其他面向Web的语言相比,这是关于ASP.NET(而不是C#)的主观讨论。
8 年多之前 回复
dqk42179
dqk42179 我不会说C#,但你所展示的不仅仅是一个文本字段,不是吗?并且您完全忽略了上述代码带来的开箱即用的功能(如验证),您必须在PHP中精心添加(导致更多代码。)
8 年多之前 回复

1个回答



也许你应该尝试 ASP .NET MVC 。 看起来它更符合您的要求:)</ p>
</ div>

展开原文

原文

Maybe you should try ASP.NET MVC. Seems like it would fit your requirements more :)

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问