Permalink
Browse files

Fix

  • Loading branch information...
1 parent c193f7c commit a50e82a21dd147885265cbb327028864ab0c6775 @Overhead Overhead committed Dec 9, 2011
Showing with 22 additions and 34 deletions.
  1. +5 −0 JoMAR/Controllers/ChatController.cs
  2. +1 −0 JoMAR/Views/Chat/Index.cshtml
  3. +16 −34 JoMAR/Views/Chat/UploadFile.cshtml
@@ -163,5 +163,10 @@ public ActionResult Profile(FormCollection collection)
return View(user);
}
+ public ActionResult UploadFile()
+ {
+ return View();
+ }
+
}
}
@@ -59,6 +59,7 @@
});
}
$("Messages").clean();
+
$("form").submit(function () {
$.ajax({
type: "POST",
@@ -1,49 +1,31 @@
-@model JoMAR.Models.ChatModel
-
-@{
- ViewBag.Title = "UploadFile";
+@{
Layout = "~/Views/Shared/_Layout.cshtml";
}
-
- <h2>UploadFile</h2>
-
-
-<h2>Chatroom: @Html.DisplayTextFor(model => model.Name)</h2>
-
+<h2>Upload your file</h2>
@using (Html.BeginForm("Index", "Upload", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
@Html.ValidationSummary(true)
<fieldset>
- <legend>Chatting</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>
+ <legend>Chatting upload</legend>
<p>
<input type="file" name="file" />
- <input type="submit" value="OK" />
+ <input type="submit" value="Upload File" />
</p>
-
-
-
</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.