有控制器:
public class MyController : Controller
{
[HttpGet]
public ActionResult MyAction(int iMode, string strSearch)
{
return View();
}
}
Run Code Online (Sandbox Code Playgroud)
在我看来,我有一个id = center的div
我在javascript中执行以下代码
url = "/MyController/MyAction?iMode=7&strSearch=as";
$('#center').load(url);
Run Code Online (Sandbox Code Playgroud)
当我在第一行的动作中调试断点时,iMode变量显示正确的值7,strSearch参数到达为null.
任何帮助/建议都是最受欢迎的.
这就是我想要做的。我有一个 Scrollviewer,里面嵌套了 UserControls,嵌套在其他 UserControls、网格、堆栈面板和其他容器中。当我单击在此层次结构中的某处添加另一个子项的按钮时,我想滚动以查看该子项。函数代码如下:
public static void ScrollParentNamedScrollViewerDown(DependencyObject child, string strTargetParent, DependencyObject newStartPoint = null)
{
if(child == null) return;
if(newStartPoint == null) newStartPoint = child;
ScrollViewer scvPotentialTarget = GetParentOfType<ScrollViewer>(newStartPoint);
if (scvPotentialTarget == null) return;
if (scvPotentialTarget.Name != strTargetParent)
{
ScrollParentNamedScrollViewerDown(child, strTargetParent, scvPotentialTarget);
}
else
{
UIElement scrollTarget = child as UIElement;
if (scrollTarget == null)
scvPotentialTarget.ScrollToBottom();
else{
Point pTarget = scrollTarget.TranslatePoint(new Point(0, 0), scvPotentialTarget);
if (pTarget == null)
scvPotentialTarget.ScrollToBottom();
else
scvPotentialTarget.ScrollToVerticalOffset(pTarget.Y);
}
}
Run Code Online (Sandbox Code Playgroud)
这个函数是这样使用的:
gbSubWindow.Visibility = System.Windows.Visibility.Visible;
gbSubWindow.Content = …Run Code Online (Sandbox Code Playgroud) 我想要应用的那个
input[type=text]#lookupFilterName.hlLightRed {
background-color: lightpink !important;
}
Run Code Online (Sandbox Code Playgroud)
无论我做什么,在所有浏览器中实际显示的那个.
input[type=text], textarea, input[type=password] {
background: #ffffff;
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJod…EiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
background: -moz-linear-gradient(top, #ffffff 0%, #afafaf 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#afafaf));
background: -webkit-linear-gradient(top, #ffffff 0%,#afafaf 100%);
background: -o-linear-gradient(top, #ffffff 0%,#afafaf 100%);
background: -ms-linear-gradient(top, #ffffff 0%,#afafaf 100%);
background: linear-gradient(to bottom, #ffffff 0%,#afafaf 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#afafaf',GradientType=0 );
}
Run Code Online (Sandbox Code Playgroud)
我可以让这个特定文本框变成粉红色的唯一方法是打开开发人员工具并关闭(输入[type = text],textarea,input [type = password])中的所有背景.
两者都来自2种不同的样式表.目标要素是:
<input id="lookupFilterName" type=text class="fullcellwdith changesdontmatter hlLightRed" />
Run Code Online (Sandbox Code Playgroud)
为什么这件事发生了?
asp.net-mvc ×1
children ×1
controller ×1
css ×1
css3 ×1
javascript ×1
null ×1
scroll ×1
scrollviewer ×1
string ×1
wpf ×1