Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Pozivanje akcije iz viewa

[es] :: .NET :: ASP.NET :: Pozivanje akcije iz viewa

[ Pregleda: 1143 | Odgovora: 1 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

fresh.bm

Član broj: 162156
Poruke: 182
147.91.197.*



+1 Profil

icon Pozivanje akcije iz viewa13.07.2011. u 09:59 - pre 155 meseci
Code:

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MvcApplication4.Models.Picture>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Overview
</asp:Content>
<script runat="server">
    public void Commit_Click(object sender, EventArgs e)
    {
        MvcApplication4.Models.Comments kom = new MvcApplication4.Models.Comments();
        kom.comment = TextBox1.Text;
        kom.CreateDate = DateTime.Now;
        MvcApplication4.Controllers.CommentsController k = new MvcApplication4.Controllers.CommentsController();
        k.Create(kom);
    }
</script>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <div id="mainContent" style="width:500px; margin: 20px auto 20px auto; text-align:left;">
        Lorem ipsum dolor
        </div>

        <div id="gallery">
        <!-- Ovo je samo test -->
            <a href="Index.aspx"><img src="../../Images/1.jpg" alt="My description" title="My title"/></a>
            <img src="../../Images/2.jpg" alt="Another text" title="Another title"/>
        </div>
     
        <script type ="text/javascript">
            Galleria.loadTheme('../../Scripts/galleria/themes/classic/galleria.classic.min.js');
            $("#gallery").galleria({
                width: 500,
                height: 500
            });
            </script>

            <div style="width:800px; margin: 0px auto 0px auto; text-align:center;">
            <br /><br />
            <form id="Form1" action="/" method="post" runat="server">
            <div style="text-align:left; color: Black; width:500px; margin:0px auto 0px auto;">
                <asp:Label ID="labelaComment" runat="server" Text= "Unesite vaš komentar:"></asp:Label>
            </div>
            <br/>
            <asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine" Height="50px" Width="500px" Rows="0" MaxLength="60" CssClass="commentBox"></asp:TextBox>
            <br />
            <div style="width:500px; margin:0px auto 0px auto; text-align:right">
            <asp:Button ID="Commit"  runat="server" OnClick="Commit_Click" OnClientClick="return confirm('Ready to submit.');" />
            <input value="Commit" type="button" runat="server" onclick="Commit_Click" />
           </div>
            </form>
            </div>

</asp:Content>


Zasto se ne poziva Commit_Click?!
 
Odgovor na temu

Toxter
NS

Član broj: 39393
Poruke: 317
82.117.202.*



+6 Profil

icon Re: Pozivanje akcije iz viewa13.07.2011. u 14:38 - pre 155 meseci
Da li radis u ASP.NET WinForms in ASP.NET MVC ?
Ovde mesas ta dva frameworka.

Pozdrav
Sad mu nije nista, ubio si ga k'o zeca...
 
Odgovor na temu

[es] :: .NET :: ASP.NET :: Pozivanje akcije iz viewa

[ Pregleda: 1143 | Odgovora: 1 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.