一张图片说千言万语?

我希望第二行(和连续行)与第一行对齐.有任何想法吗?
Html是
<input><span>text</span>
Run Code Online (Sandbox Code Playgroud) 我只是遇到一个奇怪的问题,我无法检索sql存储过程输出参数值.我解决了这个问题将近2个小时.
代码很简单
using (var con = new SqlConnection(connectionString))
{
con.Open();
SqlCommand cmd = new SqlCommand("sp_mgsearach", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter param1 = new SqlParameter("@SearchTerm", SqlDbType.VarChar);
param1.Value = searchTerm;
param1.Direction = ParameterDirection.Input;
cmd.Parameters.Add(param1);
SqlParameter param2 = new SqlParameter("@start", SqlDbType.Int);
param2.Value = start;
param2.Direction = ParameterDirection.Input;
cmd.Parameters.Add(param2);
SqlParameter param3 = new SqlParameter("@end", SqlDbType.Int);
param3.Value = end;
param3.Direction = ParameterDirection.Input;
cmd.Parameters.Add(param3);
SqlParameter param4 = new SqlParameter("@total", SqlDbType.Int);
param4.Direction = ParameterDirection.InputOutput;
param4.Value = 0;
cmd.Parameters.Add(param4);
var reader = cmd.ExecuteReader();
LoadHits(reader);
if (lstHits.Count > 0) …Run Code Online (Sandbox Code Playgroud) 验证失败时,我应该返回哪一个?视图(); 或查看(模型); ?
我注意到这两个工作.这令人困惑.
编辑:
public class MoviesController : Controller
{
MoviesEntities db = new MoviesEntities();
//
// GET: /Movies/
public ActionResult Index()
{
var movies = from m in db.Movies
select m;
return View(movies.ToList());
}
public ActionResult Create()
{
return View();
}
[HttpPost]
public ActionResult Create(Movie movie)
{
if (ModelState.IsValid)
{
db.AddToMovies(movie);
db.SaveChanges();
return RedirectToAction("Index");
}
else
return View();//View(movie);
}
}
Run Code Online (Sandbox Code Playgroud)
我的Create.aspx:
<% using (Html.BeginForm()) {%>
<%: Html.ValidationSummary(true) %>
<fieldset>
<legend>Fields</legend>
<div class="editor-label">
<%: Html.LabelFor(model => model.Title) %>
</div> …Run Code Online (Sandbox Code Playgroud) 我需要检查值是否定义为任何值,包括null.isset将null值视为未定义并返回false.以下面的例子为例:
$foo = null;
if(isset($foo)) // returns false
if(isset($bar)) // returns false
if(isset($foo) || is_null($foo)) // returns true
if(isset($bar) || is_null($bar)) // returns true, raises a notice
Run Code Online (Sandbox Code Playgroud)
请注意,这$bar是未定义的.
我需要找到满足以下条件的条件:
if(something($bar)) // returns false;
if(something($foo)) // returns true;
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
如何根据字典键获取唯一值,字典键是目标C中数组的元素?
例如:
我有一个项目数组
aryItem
aryItem[0] = Dictionary{
ItemCategory
ItemName
ItemPrice
}
aryItem[1] = Dictionary{
ItemCategory
ItemName
ItemPrice
}
...........
...........
aryItem[n] = Dictionary{
ItemCategory
ItemName
ItemPrice
}
Run Code Online (Sandbox Code Playgroud)
现在我想获得唯一的ItemCategory,而不是重复.如果我可以写[[aryItem objectatIndex:i] valueForKey:ItemCategory]我得到所有类别,同样的类别也包括在内.我只需要独特的类别.我有一个选项搜索整个数组然后获得唯一的Itemcategory对象,但我正在寻找任何简短的方法来完成相同的事情.
谢谢.
我有一个指向moodle网站的iframe.我需要传递我的用户名和密码,以便在加载iframe时,我会自动登录moodle.所以我有这样的事情:
<div id="iframe" style="width:787px; height:700px;">
<iframe id="iframeCon" src ="http://www.somesite.net/moodle/login/index.php"
width="100%" height="100%" frameborder="0">
</iframe>
</div>
Run Code Online (Sandbox Code Playgroud)
我的问题是如何使用POST方法将我的用户名和密码发送到此URL?
我正在使用谷歌应用程序在我的域上使用谷歌应用程序引擎应用程序.由于中国阻止谷歌应用程序,我想隐藏谷歌应用程序,在我的域名和谷歌应用程序之间添加一个层.有没有办法可以做到?
我在eclipse helios中创建了一个带有单个子模块的最小maven项目.
在src/test/resources文件夹中,我放了一个文件"install.xml".在文件夹src/test/java中,我创建了一个包含单个类的包:
@Test
public void doit() throws Exception {
URL url = this.getClass().getClassLoader().getResource("install.xml");
System.out.println(url.getPath());
}
Run Code Online (Sandbox Code Playgroud)
但是当我将代码作为junit 4单元测试运行时,我只得到一个NullPointerException.这之前已经运行了数百万次.有任何想法吗?
我遵循了这个指南:
http://www.fuyun.org/2009/11/how-to-read-input-files-in-maven-junit/
但仍然得到相同的错误.
我想解决这个问题的方法非常简单,但我已经考虑了一段时间,但却找不到优雅的解决方案.
我有一系列数字,例如1..10 = (1,2,3,4,5,6,7,8,9,10),它是圆形的,这意味着最后一个数字后面的数字又是第一个数字(next(10)=1).
对于i>0范围内的给定数字,我想计算下一个m和前m一个数字.例如next(5,1)=6 next(10,1)=1 next(10,2)=2 prev(5,2)=3 prev(1,1)=10 prev(1,2)=9.
对于next我可以采取(i+m)%n其中n在该范围的长度(n=10在本例中).但是因为prev我找不到一个优雅的解决方案.
ado.net ×1
asp.net-mvc ×1
c# ×1
classloader ×1
css ×1
dns ×1
eclipse ×1
google-apps ×1
html ×1
iframe ×1
isset ×1
java ×1
maven-2 ×1
modulo ×1
moodle ×1
null ×1
objective-c ×1
php ×1
post ×1
proxy ×1
sql-server ×1