当我们使用MPMoviePlayer(在自定义UIViewController中)创建应用程序并在电影播放器上使用覆盖UIViewController时,有什么更好的方法: - 使用self.view.presentModalView ...或者self.view.addSubView在播放器中加载电影......或者在那里任何其他更好的方式.我现在使用模态视图,一切正常,但我必须实现一些自定义旋转.我正在寻找更明确的方法来做到这一点.
好吧也许更多细节.在iPhone应用程序中,我添加播放器,如模态视图,并添加叠加视图,这是有效的.但这是通用应用程序,它在iPad上的工作方式与在iPhone上的工作方式相同.在ipad splitView中,我的播放器在细节方面(非完全屏幕),当我双击它时它会全屏显示.现在玩家是关键窗口.这是最大的问题.我试图添加叠加视图作为子视图和模态视图,我做了它,但是叠加层不知道设备方向,我必须转换叠加元素,这是我想要避免的.有没有办法检测该视图的旋转?
我有一个(剃刀)页面,包含5个不同的部分视图.每个局部视图负责来自数据库的一些数据.在该母版页中,我使用一个模型对象,但对于部分视图,我使用不同的模型对象.问题是,当我在局部视图中设置模型对象时,我的应用程序会出现以下错误:传递到字典中的模型项是类型'MyProject.WebUI.Models.BigPageViewModel', but this dictionary requires a model item of type 'MyProject.WebUI.Models.StatisticsViewModel'.
这是代码:这是包含部分视图的大页面:
@model MyProject.WebUI.Models.BigPageViewModel
@{
Layout = "../Shared/_BigPage.cshtml";
}
...
@{Html.RenderPartial("../Data/StatisticsFeed");}
...
Run Code Online (Sandbox Code Playgroud)
这是控制器代码.对于这个方法,我创建了应该在大页面中呈现的局部视图.
public ActionResult StatisticsFeed()
{
StatisticsViewModel cs = new StatisticsViewModel();
cs.TotalData = (new StatisticsRepository()).GetStatisticCompleteData(1);
return View(cs);
}
Run Code Online (Sandbox Code Playgroud)
这是部分视图中的代码:
@model MyProject.WebUI.Models.StatisticsViewModel
...
Run Code Online (Sandbox Code Playgroud)

我使用'RenderAction'方法而不是'RenderPartial'并返回值,但返回两个结果一个数据,一个没有,这一定是一些愚蠢的错误......
public ActionResult StatisticsFeed()
{
StatisticsViewModel cs = new StatisticsViewModel();
cs.TotalData = (new StatisticsRepository()).GetStatisticCompleteData(1);
cs.TotalCitizns = 569;
return View(cs);
}
Run Code Online (Sandbox Code Playgroud) 我使用完整的浏览器宽度高度jquery blockUI来显示从库中选择的图像.在图像下面是blockUI中的视图方案.
基本上在侧面块的视图中,宽度和高度设置为100%.
里面还有两个div.右边的宽度设置为视图的80%,它包含图像.
图像的宽度和高度设置为100%(但我知道这是错误的).
我在此处显示的图像是用户上传的原始尺寸的图像.但如果显示器是1024x768并且上传的图像是600x1900,那么我不知道该图像是什么从屏幕上消失.
那么如何解决这个问题来显示图像居中和比例?

我正在使用jquery来处理我的所有ajax,我不知道这是否正常但我现在使用它.
当用户输入字符时,我有一个文本输入我调用服务器端获取一些值并将其添加到视图上.
我使用的代码如下工作正常,但我想稍微改进一下.
如何进行此ajax调用,以便想要调查我的页面源代码的用户看不到我在这里调用的内容?
所以基本上我想从页面源隐藏什么url,我在这里使用什么类型和数据发送,是否可能?
$(function () {
$("#txtSearch").keyup(function (evt) {
$.ajax({
url: "/Prethors/Users/SearchUsers",
type: "POST",
data: "text=" + this.value,
success: function (result) {
$("#searchResult").prepend("<p>" + result + "</p>");
}
});
});
});
Run Code Online (Sandbox Code Playgroud) 我有一张桌子tbl_Info:
InfoId
Text
PrivacyTypeId
UserName
TypeId
IsInfo
InfoItemId
Run Code Online (Sandbox Code Playgroud)
数据示例:
1|Some text...|1|userX|1|False|NULL
2|New job created|1|system|3|True|765
3|Image commented|1|system|4|True|457
Run Code Online (Sandbox Code Playgroud)
在我的应用程序中,我从该表中获取所有值,并将其显示为列表.
应用程序用户可以单击每个项目,并应将它们重定向到应用程序中的某个位置.
我在数据库中有一些绑定到此表的表,但此连接非常动态.例如这个表:
tbl_Jobs{JobId, Title etc.}, tbl_Articles{ArticleId, Title etc.}
Run Code Online (Sandbox Code Playgroud)
问题出
在这里:在我添加之前IsInfo,InfoItemId我只有一种用户输入此信息的类型,我只需要获取信息列+用户全名:
select i.*, p.FirstName + ' ' + p.LastName as Author
from tbl_Info i
left join tbl_Profiles p on i.UserName = p.UserName
where i.PrivacyTypeId = 1
Run Code Online (Sandbox Code Playgroud)
现在我需要更改Author名称为的列,Title此值应为:全名或职位或文章标题等.
我不知道是否可以制作选择程序,因此它可以基于IsInfo并TypeId从ID为的另一个表中获取项目标题InfoItemId.
如下所示:如果IsInfo = True.获取typeId.并基于此typeId连接到某个表并从中获取一些列.
IF typeId = 2 ... …Run Code Online (Sandbox Code Playgroud) 我不知道这是否正常,但ChildActionOnly方法是否要求路线?例如
[ChildActionOnly]
public PartialViewResult List(string countryCode, string cityName)
{...
return PartialView(model);
}
Run Code Online (Sandbox Code Playgroud)
我渲染它像:
@{Html.RenderAction("List", "MyController", new { area = "MyArea", countryCode = ViewBag.CountryCode, cityName = ViewBag.CityName });}
Run Code Online (Sandbox Code Playgroud)
在调试中我得到了上线:
路由表中的路由与提供的值不匹配.
UPDATE
context.MapRoute("name",
"",
new { area = "MyArea", controller = "MyControlelr", action = "List", countryCode = UrlParameter.Optional, cityName = UrlParameter.Optional });
Run Code Online (Sandbox Code Playgroud) 我有一个Google Maps div和复选框列表,用于过滤地图上的标记.
但是,如果我单击标记,打开一个InfoWindow,然后单击复选框以删除该类型的标记,InfoWindow则不会从地图中删除.
删除标记后,我调用此代码,但InfoWindow保留:
try {
if( infowindow ) {
infowindow.close();
}
}
catch(err) { }
Run Code Online (Sandbox Code Playgroud) javascript google-maps google-maps-api-3 google-maps-markers
我有以下行动方法:
public ActionResult ProfileSettings()
{
Context con = new Context();
ProfileSettingsViewModel model = new ProfileSettingsViewModel();
model.Cities = con.Cities.ToList();
model.Countries = con.Countries.ToList();
model.UserProfile = con.Users.Find(Membership.GetUser().ProviderUserKey);
return View(model); // Here model is full with all needed data
}
[HttpPost]
public ActionResult ProfileSettings(ProfileSettingsViewModel model)
{
// Passed model is not good
Context con = new Context();
con.Entry(model.UserProfile).State = EntityState.Modified;
con.SaveChanges();
return RedirectToAction("Index", "Home");
}
@using (Html.BeginForm("ProfileSettings", "User", FormMethod.Post, new { id = "submitProfile" }))
{
<li>
<label>
First Name</label>
@Html.TextBoxFor(a => a.UserProfile.FirstName)
</li> …Run Code Online (Sandbox Code Playgroud) 我正在实现允许用户互相关注的功能.我有数据库表:
User{UserId, FirstName, LastName etc.}
Followings{FollowerUserId, FollowingUserId, CreatedOnDate etc.}
Run Code Online (Sandbox Code Playgroud)
所以我添加了EF类:
public class Follow
{
[Key, Column(Order = 1)]
public Guid FollowerUserId { get; set; }
[Key, Column(Order = 2)]
public Guid FollowUserId { get; set; }
public DateTime CreatedOnDate { get; set; }
public virtual User Follower { get; set; }
public virtual User Following { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
最后两个虚拟属性问题.我打电话的时候:
var model = con.Follows.Where(x => x.FollowerUserId == uid);
Run Code Online (Sandbox Code Playgroud)
我得到以下异常:
Invalid column name 'Following_UserId'.
Run Code Online (Sandbox Code Playgroud)
该问题可能是由于一个类中有两个User对象引起的.知道如何解决这个问题吗?
UPDATE
public class User
{ …Run Code Online (Sandbox Code Playgroud) 我有一个使用不显眼的验证的表单.最近我改变了文本区域使用微小的mce,现在验证不起作用.
我试过从这里使用解决方案但没有任何反应.
$('#form input[type=submit]').click(function () {
Run Code Online (Sandbox Code Playgroud)
从不执行.在这里我有:
@using (Html.BeginForm("Create", "UserAd", FormMethod.Post))
{
...
@Html.TextAreaFor(x => x.Description, new { id = "description" })
...
<input type="submit" value="Create"/>
...
Run Code Online (Sandbox Code Playgroud)
这是JS代码:
$(document).ready(function () {
tinyMCE.init({
mode: "textareas",
theme: "advanced",
skin: "o2k7",
height: "250",
plugins: "autolink,lists,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
theme_advanced_buttons1: "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist",
theme_advanced_buttons2: "",
theme_advanced_buttons3: "",
theme_advanced_buttons4: "",
theme_advanced_toolbar_location: "top",
theme_advanced_toolbar_align: "left",
theme_advanced_resizing: false
});
function toggleEditor(id) {
if (!tinyMCE.get(id)) {
tinyMCE.execCommand('mceAddControl', false, id);
}
else {
tinyMCE.execCommand('mceRemoveControl', false, id);
}
}
// new
$(function () …Run Code Online (Sandbox Code Playgroud) asp.net-mvc ×5
javascript ×4
jquery ×3
c# ×2
css ×1
css3 ×1
google-maps ×1
ios4 ×1
ipad ×1
iphone ×1
jquery-ui ×1
sql ×1
sql-server ×1
t-sql ×1
tinymce ×1