asp.net mvc 4 - How To make own Template Inbox view use MVC using C# -
i using smtp mail sending . wokring normal mail message send inbox want own custom template mail . have using trying simple layout own
@{ viewbag.title = "mylayout"; } <h2>mylayout</h2>
in contact page
i have added layout
@model inspinia_mvc5.models.mailmodel @{ viewbag.title = "index"; @layout = "~/views/shared/mylayout.cshtml"; } <script src="~/scripts/jquery-2.1.1.min.js"></script> <script> $(document).ready(function () { $('.summernote').summernote(); if ('@viewbag.message' == 'sent') { alert('mail has been sent successfully'); } $(document).ready(function () { $('.summernote').summernote(); }); }); </script> <div class="wrapper wrapper-content"> <div class="row"> <div class="col-lg-2"> <div class="ibox float-e-margins"> <div class="ibox-content mailbox-content"> <div class="file-manager"> <div class="row"> <a class="btn btn-block btn-primary compose-mail" href="@url.action("contactus", "contactus")">compose mail</a> </div> </div> </div> </div> </div> <div class="col-lg-8 animated fadeinright"> <div class="mail-box-header"> <h2> compse mail </h2> </div> <div class="mail-box"> @using (@html.beginform("contactus", "contactus", formmethod.post, new { @id = "form1", @enctype = "multipart/form-data" })) { <div class="mail-body"> <form class="form-horizontal" method="get"> <div class="form-group"> <label class="col-sm-2 control-label">to:</label> <div class="col-sm-10"> <input type="text" name="to" class="form-control" placeholder="enter email here"></div> </div> <br /> <div class="form-group"> <label class="col-sm-2 control-label">subject:</label> <div class="col-sm-10"> <input type="text" name="subject" class="form-control" placeholder="enter subject here"></div> </div> <br/> <br/> <br /> @*@html.textboxfor(m => m.subject)*@ <div class="form-group"> <label class="col-sm-2 control-label">attachment:</label> <input type="file" name="fileuploader" /> </div> </form> <div class="mail-text h-200"> <div class="summernote"> @html.textareafor(m => m.body, new { @class = "form-control", style = "width: 840px; height: 139px;" }) <br /> <br /> </div> <div class="clearfix"></div> </div> <div class="mail-body text-right tooltip-demo"> @html.validationsummary() <input type="submit" class="btn btn-sm btn-primary" data-toggle="tooltip" data-placement="top" value="send" /> </div> </div> } </div> </div> </div> </div> @section styles { @styles.render("~/plugins/summernotestyles") @scripts.render("~/plugins/summernote") }
after running code getting error
the layout page "= "~/views/shared/mylayout.cshtml";" not found @ following path: "~/views/contactus/= "~/views/shared/mylayout.cshtml";"
please 1 tell how send own template mail inbox
should be:
@model inspinia_mvc5.models.mailmodel @{ viewbag.title = "index"; layout = "~/views/shared/mylayout.cshtml"; }
Comments
Post a Comment