我开发了一个MVC3应用程序,因为我运行应用程序时使用html5视频控件,它在Chrome浏览器中播放但是当我尝试在IE8浏览器中播放它不播放视频只是它只显示白页...如何在所有浏览器中播放视频请帮帮我..
这是我在我的页面中所做的代码
<video controls="controls" poster="http://sandbox.thewikies.com/vfe-generator/images/big-buck-bunny_poster.jpg"
width="640" height="360">
<source src="../../Videos/Nenu Nuvvuantu - Orange - MyInfoland.mp4" type="video/mp4" />
<%-- <source src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.webm" type="video/webm" />--%>
<source src="../../Videos/Nenu Nuvvuantu - Orange - MyInfoland.ogv" type="video/ogv" />
<object type="application/x-shockwave-flash" data="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf"
width="640" height="360">
<param name="movie" value="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf" />
<param name="allowFullScreen" value="true" />
<param name="wmode" value="transparent" />
<param name="flashVars" value="config={'playlist':['http%3A%2F%2Fsandbox.thewikies.com%2Fvfe-generator%2Fimages%2Fbig-buck-bunny_poster.jpg',{'url':'../../Videos/Nenu Nuvvuantu - Orange - MyInfoland.mp4','autoPlay':false}]}" />
<img alt="Big Buck Bunny" src="http://sandbox.thewikies.com/vfe-generator/images/big-buck-bunny_poster.jpg"
width="640" height="360" title="No video playback capabilities, please download the video below" />
</object>
</video>
Run Code Online (Sandbox Code Playgroud) 我有以下遗留代码,我想模仿,一列内的所有动作链接.但是,我似乎无法正确使用Razor语法.我应该如何在剃刀中表达这一点?
ASPX列模板是这样的:
.Columns(column =>
{
column.Template(o =>
{%>
<%= Html.ActionLink("Edit", "Edit", new{ id = o.DeviceID}) %> |
<%= Html.ActionLink("Delete", "Delete", new { id = o.DeviceID })%>
<%});
Run Code Online (Sandbox Code Playgroud)
我只能使用Razor获得三个单独的列而不会抱怨语法等,如下所示:
.Columns(columns =>
{
columns.Template(o => @Html.ActionLink("Edit", "Edit", new { id = o.ProductId })).Width(50);
columns.Template(o => @Html.ActionLink("Details", "Details", new { id = o.ProductId })).Width(50);
columns.Template(o => @Html.ActionLink("Delete", "Delete", new { id = o.ProductId })).Width(50);
Run Code Online (Sandbox Code Playgroud)
如何使用Razor语法定义包含所有三个操作链接的一个模板列?
编辑: 在下面尝试以下对Mike的答案的小改编,我得到错误"只有赋值,调用,递增,递减和新对象表达式可以用作语句":
columns.Template(o => @<text>@Html.ActionLink("Edit", "Edit", new { id = o.CampaignId }) |
@Html.ActionLink("Delete", "Delete", new { id …Run Code Online (Sandbox Code Playgroud) 我正在尝试获得一个固定的高度标题和填充屏幕的内容区域.内容div包含telerik mvc网格.我已经在stackoverflow上尝试了一些建议,但是作为内容区域的控件总是看起来大小不正确,因为它没有考虑标题固定高度,所以如果标题是40px它将滚动额外的40px.有什么建议?
<div id="header">
</div>
<div id="content">
<telerik mvc grid control>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS
html,body
{
margin:0;
padding:0;
height:100%;
}
#header {
position:absolute;
height: 40px;
left:0;
top:0;
width:100%;
background:green;
}
#content {
position: absolute;
top:40px;
left:0;
width:100%;
height:100%;
background:#eee;
}
Run Code Online (Sandbox Code Playgroud)
更新:必须在加载和窗口重新调整大小时手动重新调整网格大小.加
.ClientEvents(events => events.OnLoad("resizeGrid"))
<script type="text/javascript">
window.onresize = function () {
resizeContentArea($("#Grid")[0]);
}
function resizeGrid(e) {
debugger;
resizeContentArea($("#Grid")[0]);
}
function resizeContentArea(element) {
var newHeight = parseInt($(element).outerHeight(), 10) - parseInt($(".t-grid-header", element).outerHeight(), 10) - parseInt($(".t-grid-pager", element).outerHeight(), 10);
$(".t-grid-content", element).css("height", newHeight + "px");
} …Run Code Online (Sandbox Code Playgroud) 我试图在测试ASP.NET MVC3应用程序中填充ComboBox(Telerik RAD COmboBox).
我在我的ASPX页面上定义了ComboBox,在控制器中我定义了返回JsonResult的动作调用.
我遇到的问题是我使用的Web服务已经将结果集作为JSON字符串返回.如何直接从Webservice传递响应.
以下是代码片段:ASPX页面:
<% Html.Telerik().ComboBox()
.Name("cbRefTables")
.DataBinding(b => b
.Ajax()
.Select("GetCALMdata","Common")
)
.Render();
%>
Run Code Online (Sandbox Code Playgroud)
控制器:称为CommomController
public JsonResult GetCALMdata()
{
CALMwsP.wsCALMSoapClient wsC = new CALMwsP.wsCALMSoapClient("wsCALMSoap");
string resultset = wsC.GetRefTables("P_1", "P_2", "P_3", "P_4");
return ??; -- I want to return resultset which is already formatted.
}
Run Code Online (Sandbox Code Playgroud) 我在MVC3中使用KendoUI MVC.
我设法在网格列中获得一个下拉列表.但我不知道如何设置所选值,当我保存它时不保存我选择的值.
网格
@using Perseus.Areas.Communication.Models
@using Perseus.Common.BusinessEntities;
<div class="gridWrapper">
@(Html.Kendo().Grid<CommunicationModel>()
.Name("grid")
.Columns(colums =>
{
colums.Bound(o => o.communication_type_id)
.EditorTemplateName("_communicationDropDown")
.ClientTemplate("#: communication_type #")
.Title("Type")
.Width(180);
colums.Bound(o => o.sequence).Width(180);
colums.Bound(o => o.remarks);
colums.Command(command => command.Edit()).Width(50);
})
.Pageable()
.Sortable()
.Filterable()
.Groupable()
.Editable(edit => edit.Mode(GridEditMode.InLine))
.DataSource(dataSource => dataSource
.Ajax()
.ServerOperation(false)
.Model(model => model.Id(o => o.communication_id))
.Read(read => read.Action("AjaxBinding", "Communication", new { id = @ViewBag.addressId }))
.Update(update => update.Action("Update", "Communication"))
.Sort(sort => { sort.Add(o => o.sequence).Ascending(); })
.PageSize(20)
)
)
</div>
Run Code Online (Sandbox Code Playgroud)
EditorTemplate"_communicationDropDown
@model Perseus.Areas.Communication.Models.CommunicationModel
@(Html.Kendo().DropDownListFor(c …Run Code Online (Sandbox Code Playgroud) 我正在使用telerik mvc网格.在我的表中,我为字段定义了唯一键.在控制器中我使用try ... catch在DbUpdateException中捕获错误.
在catch块中我想处理错误并在视图中显示错误消息.所以使用以下行,
ModelState.AddModelError("PROGRAM_ID", "Access for this program already exists.");
return View();
Run Code Online (Sandbox Code Playgroud)
但这并没有显示错误信息.知道为什么吗?
我正在使用Kendo UI网格,GridEditMode.InCell我需要在网格列中添加删除/销毁命令的超链接,而不是默认的"删除"按钮.
我目前的代码如下:
c.Command(command => command.Destroy()).Width(90);
Run Code Online (Sandbox Code Playgroud) 有谁知道要设置什么属性来制作剑道MVC文本框多线?
@(Html.Kendo().TextBox()
.Name("txtComments")
.Value(@Model.Comments)
.HtmlAttributes(new { style = "width:100%" })
)
Run Code Online (Sandbox Code Playgroud)
谢谢.
我有一个允许用户过滤的网格.如果用户更改用于填充网格的搜索词,则上一次搜索的过滤器将保留在原位.
<label for="UserName">
User Name:</label>
<%= Html.TextBox("UserName", "") %>
<input id="btnSearch" type="submit" value="Submit" />
</p>
<div class="<%= "t-" + Html.GetCurrentTheme() %>" style="width: 400px;">
<%= Html.Telerik().Grid<ADGroup>()
.Name("Groups")
.Columns(columns=>
{
columns.Add(c => c.GroupName).Width(350);
})
.Sortable()
.Filterable()
.Pageable(paging =>
paging.PageSize(20)
)
.Ajax(ajax => ajax.Action("_GetGroups", "GroupSearch", new { userName = "John Doh" }))
.BindTo((IEnumerable<ADGroup>)ViewData["Groups"])
%>
</div>
Run Code Online (Sandbox Code Playgroud)
当按下btnSearch时,我触发了网格的重新绑定.
<%
Html.Telerik().ScriptRegistrar()
.OnDocumentReady(() =>
{
%>
var groupsGrid = $('#Groups').data('tGrid');
$('#btnSearch')
.live("click", function() {
var user = $('#UserName').val();
// rebind the related grid
groupsGrid.rebind({
userName: …Run Code Online (Sandbox Code Playgroud) 我A public action method 'cache' was not found on controller在执行时偶尔会遇到actionresult.虽然这里没有在我的代码中定义或使用缓存.不知道从哪里得到这个.它发生在telerik mvc grid的ajax绑定上.这是来自elmah的堆栈跟踪
HTTP Referrer
/mycontroller/75/myaction
Path Info
/mycontroller/cache/b19858cce4adf72d090c2334d5584f06
Run Code Online (Sandbox Code Playgroud)
堆栈跟踪
System.Web.HttpException (0x80004005): A public action method 'cache' was not found on controller 'myapp.Controllers.MyController'.
at System.Web.Mvc.Controller.HandleUnknownAction(String actionName)
at System.Web.Mvc.Controller.ExecuteCore()
at System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext)
at System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext)
at System.Web.Mvc.MvcHandler.<>c__DisplayClass6.<>c__DisplayClassb.<BeginProcessRequest>b__5()
at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass1.<MakeVoidDelegate>b__0()
at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.End()
at System.Web.Mvc.MvcHandler.<>c__DisplayClasse.<EndProcessRequest>b__d()
at System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f)
at System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action)
at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)
at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Run Code Online (Sandbox Code Playgroud) asp.net-mvc telerik asp.net-mvc-routing telerik-mvc asp.net-mvc-3
telerik-mvc ×10
asp.net-mvc ×5
telerik ×4
razor ×3
c# ×2
kendo-ui ×2
telerik-grid ×2
css ×1
html ×1
html5-video ×1
jquery ×1
jsonresult ×1
multiline ×1
textbox ×1