我有以下HTML:
<table id="MwDataList" class="data" width="100%" cellspacing="10px">
....
<td class="centerText" style="height: 56px;">
<input id="selectRadioButton" type="radio" name="selectRadioGroup">
</td>
....
</table>
Run Code Online (Sandbox Code Playgroud)
换句话说,我有一个几行的表,在最后一个单元格的每一行中我都有一个单选按钮.
如何获取所选单选按钮的父行?
我尝试过的:
function getSelectedRowGuid() {
var row = $("#MwDataList > input:radio[@name=selectRadioGroup]:checked :parent tr");
var guid = GetRowGuid(row);
return guid;
}
Run Code Online (Sandbox Code Playgroud)
但似乎这个选择器不正确.
我想保护我的cookie,我读了ASP.NET_SessionId cookie的"HTTPOnly"和"Secure"cookie标志.我在VS中创建了新的asp.net项目.在检查员的小提琴手 - >原始我有:
Cookie: DXCurrentThemeMVC=Office2010Black; ASP.NET_SessionId=1gq0t1mi234xyljqnxrzbqfx
Run Code Online (Sandbox Code Playgroud)
然后我修改web.config:
<system.web>
<compilation debug="true" targetFramework="4.0" />
<httpCookies httpOnlyCookies="true" requireSSL="true"/>
<authentication mode="Forms">
<forms loginUrl="~/Account/Login.aspx" timeout="2880" requireSSL="true" />
</authentication>
Run Code Online (Sandbox Code Playgroud)
但在提琴手中的数据相同
Cookie: DXCurrentThemeMVC=Office2010Black; ASP.NET_SessionId=1gq0t1mi234xyljqnxrzbqfx
Run Code Online (Sandbox Code Playgroud)
我想当我添加
<httpCookies httpOnlyCookies="true" requireSSL="true"/>
我不能看到小提琴中的cookie,或cookie将被加密.这是正确的结果吗?或者我在某处有错误?
编辑
为什么我不会在小提琴手中看到
Set-Cookie: ASP.NET_SessionId=ig2fac55; path=/; secure; HttpOnly
Run Code Online (Sandbox Code Playgroud)
但只有没有set-,安全和HttpOnly的cookie也在firebug中我看到相同的结果
EDIT2 似乎我发现了我的问题:我在iis和firebug上主持应用程序寻找cookie,我有安全和httpOnly标志的cookie:
ASP.NET_SessionId=98sfd90sdf89sd0f80s8; path=/; secure; HttpOnly
Run Code Online (Sandbox Code Playgroud) 我有一个简单的wpf应用程序.在主窗口中,我有堆栈面板和2个按钮.第一个按钮添加了100个用户控件(没有任何数据绑定,事件,位图),第二个按钮从面板中删除所有这些控件并调用GC.Collect().并且存在一些问题:1.在我第一次单击"删除"按钮并不是我的所有内存释放后,我必须单击它几次以释放更多内存.2. 5-10分钟内存释放后,但不会有几兆字节.
例如,在我的应用程序启动之后,当我添加500个控件时需要~22mb - 在我第一次点击"删除"按钮后~~~60mb~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ,我不明白这一点,我是WPF的新手,也许我想念一些我想立刻释放内存的东西.
<Window x:Class="WpfApplication10.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="385" Width="553">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="25" />
<RowDefinition Height="240*" />
<RowDefinition Height="25" />
</Grid.RowDefinitions>
<Grid
Name="border1"
Grid.Row="1"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" >
<ScrollViewer VerticalAlignment="Stretch"
Name="scrollViewer1"
HorizontalAlignment="Stretch">
<StackPanel
Margin="3,3,3,3"
Background="Transparent"
VerticalAlignment="Stretch"
Name="activityStackPanel"
HorizontalAlignment="Stretch">
</StackPanel>
</ScrollViewer>
</Grid>
<Button Content="Button" Grid.Row="2" Height="23" HorizontalAlignment="Left" Margin="12,0,0,0" Name="button1" VerticalAlignment="Top" Width="75" Click="button1_Click" />
<Button Content="Button" Grid.Row="2" Height="23" HorizontalAlignment="Left" Margin="141,0,0,0" Name="button2" VerticalAlignment="Top" Width="75" Click="button2_Click" />
<Label Content="Label" Grid.RowSpan="2" Height="28" HorizontalAlignment="Left" Margin="34,0,0,0" Name="label1" VerticalAlignment="Top" />
</Grid>
Run Code Online (Sandbox Code Playgroud)
namespace WpfApplication10
{
public …
Run Code Online (Sandbox Code Playgroud) 这适用于我的开发机器,但不适用于生产服务器.我试图用ajax更新一些div,但它们没有更新,虽然其他部分工作正常.我在服务器上使用IIS 6.当我使用firebug在服务器端调试此代码时,它不会触及我添加到success函数的任何断点.
脚本:
function updateServiceInfo(nodeId) {
var id = { id: nodeId };
$.ajax({
url: '/ServiceInfo/ServiceInfoPartial',
type: 'GET',
data: id,
dataType: 'html',
success: function (data) {
$('#serviceInfoContent').html(data);
},
error: function (request, error) {
}
});
}
Run Code Online (Sandbox Code Playgroud)
控制器:
public class ServiceInfoController : Controller
{
public ActionResult ServiceInfo()
{
return PartialView("ServiceInfo");
}
public ActionResult ServiceInfoPartial(string id)
{
return PartialView("ServiceInfoPartial");
}
}
Run Code Online (Sandbox Code Playgroud)
浏览次数:
serviceinfopartial
@model string
<p>
????? ?????</p>
Run Code Online (Sandbox Code Playgroud)
serviceinfo
<div id="serviceInfo">
<div id="ContainerPanel" class="ContainerPanel">
<div id="serviceInfoHeader" class="collapsePanelHeader">
<div id="dvHeaderText" class="HeaderContent">
???? ???????</div> …
Run Code Online (Sandbox Code Playgroud) 在项目中我引用了Microsoft.Office.Word.Server并且在代码中我有方法接受类型为ConversionJob的参数,但是当我尝试编译它时我有一个错误
The type or namespace name 'Office' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
The type or namespace name 'ConversionJob' could not be found (are you missing a using directive or an assembly reference?)
Run Code Online (Sandbox Code Playgroud)
但是当在ConversionJob上按f12时,它让我进入了阶级辩护
using Microsoft.Office.Word.Server.Service;
using Microsoft.SharePoint;
using System;
namespace Microsoft.Office.Word.Server.Conversions
{
public class ConversionJob
{
public ConversionJob(WordServiceApplicationProxy serviceApplicationProxy, ConversionJobSettings settings);
public ConversionJob(WordServiceApplicationProxy serviceApplicationProxy);
Run Code Online (Sandbox Code Playgroud)
...
怎么了?
目标框架是.Net framework 3.5
解决方案
我解决了这个问题.我查看输出,有消息:
Microsoft.Common.targets(1360,9): warning MSB3268: The primary reference "<assembly reference>" could not …
Run Code Online (Sandbox Code Playgroud)
我们有关于Umbraco 4(网络表格)的项目.现在我们想要使用Umbraco 5.有没有办法将网站从v4迁移到v5(并将用户控件的asp.net项目替换为具有部分剃刀视图或类似内容的mvc3项目)在解决方案中我有许多类库和带有用户控件和Web服务的asp.net项目.
谢谢
所以我有一个Windows服务我开始在OnStart上完成任务
partial class AppServices : ServiceBase
{
private static readonly ILog Log = LogManager.GetCurrentClassLogger();
private Task _task;
public AppServices()
{
InitializeComponent();
}
protected override void OnStart(string[] args)
{
Log.Info("Service started");
_task = Task.Factory.StartNew(StartWork, TaskCreationOptions.LongRunning);
}
protected override void OnStop()
{
Log.Info("Service stopped");
}
private void StartWork()
{
while(true)
{
// grab some data from db or services
}
}
Run Code Online (Sandbox Code Playgroud)
我是否需要在OnStop中添加CancellationToken并停止任务,否则是不必要的?因为当服务停止时 - 任务也会停止.它安全与否?
这些方法有什么区别,为什么SortDropDown是正确的但是Page_load和GetCases不是?
我不明白.
以及如何解决这个问题?
编辑不能在图片上看得很清楚
码:
/// <summary>
/// Sort items in drop down list
/// </summary>
/// <param name="dropDown">Drop down list</param>
internal static void SortDropDown(ref DropDownList dropDown)
{
}
/// <summary>
/// PageLoad event handler
/// </summary>
/// <param name="sender">Sender</param>
/// <param name="e">Event Args</param>
protected void Page_Load(object sender, EventArgs e)
{
}
/// <summary>
/// Get all cases by authority and ShopNo
/// </summary>
/// <param name="authority">Authority</param>
/// <param name="shopNo">Shop No</param>
/// <returns>Cases list</returns>
private static IEnumerable<CaseSummary> GetCases(string authority, …
Run Code Online (Sandbox Code Playgroud)