Replace WebForms with MVC

2

Is there any way, or just a tool, just to avoid rewriting, to replace code developed in WebForms and transported to MVC? In WebForms there is the runat = server , user control , asp: Label and etc ... Example of part of the code to be replaced: / p>

<asp:ScriptManager ID="scpManager" runat="server" OnPreRender="scpManager_PreRender">
    </asp:ScriptManager>

    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:Label ID="Label10" runat="server" BackColor="#E1EBF2" Font-Bold="True" Font-Size="12pt"
                ForeColor="#666666" Text="CNPJ: " Style="margin-left: 10px;"></asp:Label>
            &nbsp;<asp:TextBox ID="txtCnpj" runat="server" Width="175px"></asp:TextBox>
            <asp:Button ID="cmdPesquisar" runat="server" OnClick="cmdPesquisar_Click"
                Text="Pesquisar" Width="106px" Style="margin-left: 10px;" />
            <asp:UpdateProgress ID="UpdateProgress1" runat="server">
                <ProgressTemplate>
                    <div style="position: absolute; width: 99%; height: 99%; z-index: 1;">
                        <br />
                        <asp:Image ID="imgCarregando" runat="server" ImageUrl="~/Images/Carregando.gif"
                            Style="position: absolute; top: -27px; left: 393px; height: 32px;" Width="32px" />
                        <asp:Label ID="lblAtualiza" Style="position: absolute; top: -17px; left: 440px;" runat="server" Font-Size="12pt" ForeColor="#6D7CA3" Text="Pesquisando..."></asp:Label>
                    </div>
                </ProgressTemplate>
            </asp:UpdateProgress>
    
asked by anonymous 06.05.2014 / 15:27

1 answer

3

No, there is no tool for this.

The largest - and practically unique - layer to be changed to make this portability is the one of presentation - in the MVC , the famous "view" - and there's nothing that will automate the process for you: you really need to do "on the arm."

If you are in a hurry and do not have many options, the advice I can give you to minimize a little your route, is to use a Chrome Developer's Tool to save the generated HTML of your pages and save them in" .cshtml "files. Remember, if you insist on this "technique", be considerate of the JavaScripts and other necessary dependencies; in addition, it is worth remembering that the code generated by WebForms for presentations does not fully comply with W3C standards.

    
06.05.2014 / 15:44