Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Overhead committed Dec 9, 2011
1 parent c193f7c commit a50e82a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 34 deletions.
5 changes: 5 additions & 0 deletions JoMAR/Controllers/ChatController.cs
Expand Up @@ -163,5 +163,10 @@ public ActionResult Profile(FormCollection collection)
return View(user); return View(user);
} }


public ActionResult UploadFile()
{
return View();
}

} }
} }
1 change: 1 addition & 0 deletions JoMAR/Views/Chat/Index.cshtml
Expand Up @@ -59,6 +59,7 @@
}); });
} }
$("Messages").clean(); $("Messages").clean();
$("form").submit(function () { $("form").submit(function () {
$.ajax({ $.ajax({
type: "POST", type: "POST",
Expand Down
50 changes: 16 additions & 34 deletions JoMAR/Views/Chat/UploadFile.cshtml
@@ -1,49 +1,31 @@
@model JoMAR.Models.ChatModel @{

@{
ViewBag.Title = "UploadFile";
Layout = "~/Views/Shared/_Layout.cshtml"; Layout = "~/Views/Shared/_Layout.cshtml";
} }



<h2>Upload your file</h2>
<h2>UploadFile</h2>


<h2>Chatroom: @Html.DisplayTextFor(model => model.Name)</h2>





@using (Html.BeginForm("Index", "Upload", FormMethod.Post, new { enctype = "multipart/form-data" })) @using (Html.BeginForm("Index", "Upload", FormMethod.Post, new { enctype = "multipart/form-data" }))
{ {
@Html.ValidationSummary(true) @Html.ValidationSummary(true)
<fieldset> <fieldset>
<legend>Chatting</legend> <legend>Chatting upload</legend>
<div class="display-label right-float"></div>
<div class="display-field right-float">
<h4>Users</h4>
<ul>
<select id="lb" style="width:250px" multiple="multiple" size="10"> </select>
</ul>
</div>
<div class="display-label left-float"> MessageBoard</div>
<div class="display-field left-float">
@Html.TextArea("Messages",new { @class = "messageBoard"})
</div>

<div class="editor-label">
@Html.LabelFor(model => model.Message)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Message)
@Html.ValidationMessageFor(model => model.Message)
</div>
<p> <p>
<input type="file" name="file" /> <input type="file" name="file" />
<input type="submit" value="OK" /> <input type="submit" value="Upload File" />
</p> </p>



</fieldset> </fieldset>
} }
<script type="text/javascript">
$("form").submit(function () {
$.ajax({
type: "POST",
url: "/Chat/@Model.UrlName()",
data: $(this).serialize(),
success: alert("Success")
});
return false;
});
</script>


0 comments on commit a50e82a

Please sign in to comment.