小编Yus*_*suf的帖子

如何在asp.net的文本框中提交HTML标记?

首先,我想让每个人都知道我使用的是aspx引擎而不是Razor引擎.

我在表格中有一张桌子.我的一个文本框包含html标签

</br>Phone: </br> 814-888-9999 </br> Email: </br> aaa@gmail.com.  
Run Code Online (Sandbox Code Playgroud)

当我去构建它时它会给我一个错误

从客户端检测到潜在危险的Request.Form值(QuestionAnswer="...ics Phone:<br/>814-888-9999<br...").

我尝试了验证request ="false"但它没有用.

对不起,我没有添加我的HTML代码供你查看到目前为止.如果需要的话,我正在提出一些问题,我可以编辑它.

 <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master"   Inherits="System.Web.Mvc.ViewPage<dynamic>" %>


<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
EditFreqQuestionsUser
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<script type="text/javascript">
$(document).ready(function () {
    $("#freqQuestionsUserUpdateButton").click(function () {
        $("#updateFreqQuestionsUser").submit();
    });
});
</script>
<h2>Edit Freq Questions User </h2>

<%Administrator.AdminProductionServices.FreqQuestionsUser freqQuestionsUser =   ViewBag.freqQuestionsUser != null ? ViewBag.freqQuestionsUser : new   Administrator.AdminProductionServices.FreqQuestionsUser(); %>
<%List<string> UserRoleList = Session["UserRoles"] != null ? (List<string>)Session["UserRoles"] : new List<string>(); %>
<form id="updateFreqQuestionsUser" action="<%=Url.Action("SaveFreqQuestionsUser","Prod")%>" method="post" onsubmit+> …
Run Code Online (Sandbox Code Playgroud)

javascript c# asp.net-mvc decoding

24
推荐指数
2
解决办法
5万
查看次数

只允许输入Tag中的Numbers而不使用Javascript

我很新.我正在创建一个网页,询问用户的ID.我希望它是一个必填字段,只允许数字.如果你带领我走向正确的方向,我感激不尽.这就是我到目前为止所拥有的.

<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<!DOCTYPE html>

<html>
<head runat="server">
  <title>Search</title>
</head>
<body>
 <div>
  <table align="center">
    <tr>
        <td class="label">
            Enter ID:
        </td>
         <td>
            <input type="text" name="UserId" id="UserId" />
        </td>
     </tr>
   </table>
  </div>
 </body>
</html>
Run Code Online (Sandbox Code Playgroud)

html input asp.net-mvc-3

8
推荐指数
3
解决办法
11万
查看次数

如何将Datetime字符串转换为Datetime对象

string DateCreated = "2012-05-24 12:34:40.060"; 美国文化

如何使用包含月,日,年,小时,分钟,秒,毫秒的格式将字符串创建为日期时间对象.我认为格式是"MM/dd/yyyy hh:mm:ss.fff tt",但不确定.****=红色下划线,这是一个错误

我需要datetime对象,因为我想通过另一个只接受"DateTime"值而不是字符串的函数传递它

任何帮助,将不胜感激.

谢谢

这是我到目前为止,但我知道它错了

  string DateCreated = "2012-05-24 12:34:40.060";
  DateTime dt = **new DateTime(DateCreated);** 
  DateTime dateCreated = **dateCreated.ToString("MM/dd/yyyy hh:mm:ss.fff tt")**;
Run Code Online (Sandbox Code Playgroud)

c# datetime datetime-format datetime-parsing

2
推荐指数
1
解决办法
2713
查看次数