我有一个运行时间很长的进程,我想在进程过程中更新页面上的标签,但我没有运气.
这是aspx:
<%@ Page Language="C#" Async="true" AutoEventWireup="true" CodeFile="Async.aspx.cs" Inherits="Website.structureDoc.Async" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="startAsyncButton" runat="server" Text="Run" onclick="startAsyncButton_Click"/>
<asp:Button ID="cancelAsyncButton" runat="server" Text="Cancel" onclick="cancelAsyncButton_Click"/>
<asp:label id="resultLabel" runat="server"></asp:label>
</div>
</form>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
这是背后的代码:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
namespace Website.structureDoc
{
public partial class Async : System.Web.UI.Page
{
BackgroundWorker backgroundWorker1;
protected void Page_Load(object sender, EventArgs e) …Run Code Online (Sandbox Code Playgroud) 我试图这样做,但我没有找到任何方法.我问这个是因为我是Windows的新手.我试过stl-strings,但是visual studio 2008-在stl-wstring-handling中积累了bug.在其他问题上,我稍后会对此事说很多.现在有人可以解释这个问题吗?
是否可以在任何浏览器中使用任何插件以编程方式启用或禁用代码中的断点?
我已经知道设置条件断点了,但我真的很想通过代码设置它们.
我在VS2010测试项目中进行了简单的Selenium测试,如下所示.
[TestMethod]
public void MyTestInIE8()
{
IWebDriver driver = new InternetExplorerDriver();
try
{
driver.Navigate().GoToUrl("http://localhost/MyMVC/ABC/DoStuff");
driver.FindElement((By.Id("Name"))).SendKeys("John");
//... run rest of the test
}
finally
{
driver.Quit();
}
}
Run Code Online (Sandbox Code Playgroud)
这在本地服务器上运行良好.但是在构建服务器上它失败并显示以下消息....抛出异常:OpenQA.Selenium.WebDriverException:服务器没有响应url http:// localhost:4444/session/5e5e9b7a-e05c-40d8-9a20-9cab138b2b87.
问题似乎是在finally子句中调用Quit()方法.我试图传入一个已知的端口号,即InternetExplorerDriver(8080),但它没有任何区别.Firefox驱动程序在本地和构建服务器上运行良好.我发现有人报告了类似问题,但没有找到可行的解决方案.http://groups.google.com/group/webdriver/msg/4347971da4d96e97
这是我的配置.Windows 7专业版SP1,64位.
Webdriver - selenium-dotnet-2.0b2.
IE8.
我的构建服务器是带有IE8的Windows Server2008 R2 Standard.
谢谢.
大家,早安,
我有一个RSS阅读器,当单击tableView中的一个feed时打开一个Detail视图控制器.Feed的HTML是从DetailController的自定义setFeed()方法中的items数组加载的:
[self.itemContent loadHTMLString:[NSString stringWithFormat:@"%@"[item objectForKey:@"content"]] baseURL:nil];
Run Code Online (Sandbox Code Playgroud)
HTML加载没有任何问题.如果单击其中的任何链接,则新请求将加载到同一UIWebView中.问题是我想在单击itemContent中的链接时在另一个UIWebView中显示该网页.
所以,我做的是我宣布
itemContent.delegate = self
Run Code Online (Sandbox Code Playgroud)
并在委托类(self)中定义以下方法:
-(BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType {if (navigationType == UIWebViewNavigationTypeLinkClicked) {
NSLog(@"Opening Outside link!!!\n");
BrowserViewController *browserViewController = [[[BrowserViewController alloc] init] autorelease];
//following line doesn't change anything in the result
//browserViewController.webView.delegate = self;
[browserViewController.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.google.com"]]];
[self.navigationController pushViewController:browserViewController animated:YES];
return NO;
}
return YES;
Run Code Online (Sandbox Code Playgroud)
}
此方法肯定会在itemContent中首次加载HTML 与在itemContent webView中对链接执行的点击之间进行识别.NavigationController推送到下一个View但没有加载任何内容.我的意思是我在BrowserViewController的NIB文件中将一个标签放在UIWebView旁边,以确保通过查看标签来加载NIB; 和它的表现.另外,我在NIB文件中定义了一个与UIWebView连接的Outlet webView,所以这应该不是问题.
如果不清楚似乎是什么问题是:当点击链接时,browserViewController会显示标签,但webView不会加载请求.
如果有人可以查看提供的代码,那就太好了.
我祝你生日愉快,L
在java中使用简单的画笔时出现问题.让我的清除按钮重绘的问题.阵列正在清除,但没有重新绘制.任何人都可以发现我的问题,或者是否有任何不同的方法为此代码生成一个清除按钮.
public class DrawingPanel extends JPanel {
private double x1=0;
private double x2=0;
private double y1=0;
private double y2=0;
private ArrayList<Shape> myArr = new ArrayList<Shape>();
//private ArrayList<Shape> clearMyArr = new ArrayList<Shape>();
ButtonPanel buttonPress;
public void paintComponent(Graphics g)
{
for (Shape i : myArr)
{
Graphics2D g2d = (Graphics2D)g;
g2d.draw(i);
}
/*for (Shape i : clearMyArr)
{
Graphics2D g2d = (Graphics2D)g;
g2d.draw(i);
} */
}
//inner class
class Listener1 extends MouseAdapter
{
public void mousePressed(MouseEvent e)
{
x1=e.getX();
y1=e.getY();
System.out.println("Mouse Pressed"); …Run Code Online (Sandbox Code Playgroud) 我刚刚升级到XCode 4,我正在尝试创建一个早期项目的adhoc版本.每当我使用"归档"选项时,我或者在管理器窗口中根本没有归档,或者有归档,但是没有选项将其打包为.ipa,因为"归档类型不存在包装器" ".
对于已从XCode 3.2迁移的项目,有没有人在XCode 4下使用adhoc构建工作?
使用VS 2008,我有一个Repeater控件:
<asp:Repeater runat="server" ID="storesRep" DataSourceID="storeSqlDataSource"
OnItemDataBound="StoresRep_ItemDataBound">
<ItemTemplate>
<table style="padding:0px">
<tr>
<td style="width:200px"><asp:Label ID="infoLbl" runat="server">
Choose stores for upload:</asp:Label>
</td>
<td style="width:110px">
<asp:Label ID="storeLbl" runat="server" Text='<%# Bind("Name") %>'>
</asp:Label>
</td>
<td><asp:CheckBox runat="server" ID="storeCheck" /></td>
</tr>
</table>
</ItemTemplate>
</asp:Repeater>
<asp:SqlDataSource ID="storeSqlDataSource" runat="server"
ConnectionString="<%$ ConnectionStrings:someConnectionString %>"
SelectCommand="SELECT [StoreId], [Name] FROM [Store] Order By [Name]">
</asp:SqlDataSource>
Run Code Online (Sandbox Code Playgroud)
现在,如果数据源没有从数据库返回任何项目,我想显示默认文本,如"找不到商店".到目前为止,我主要使用的GridView是因为EmptyDataText属性而没有问题的地方.
在我的自定义表单上,我想显示一个自定义Guid字段.
我通过一个功能以通常的方式创建了该字段:
<Field ID="88813c02-799b-4fc8-8ed8-72fe668e257c" Type="Guid"
Name="myGuid"
StaticName="myGuid"
DisplayName="My Guid" />
Run Code Online (Sandbox Code Playgroud)
我希望首先通过代码设置此字段并在表单上显示.在表单上我有以下控件(供参考我还包括一个标题字段):
<SharePoint:GuidField runat="server" ID="myGuidField" FieldName="myGuid" />
<SharePoint:TextField runat="server" ID="myTitle" FieldName="Title" />
Run Code Online (Sandbox Code Playgroud)
Guid字段不会显示在常规的New/Edit表单上 - 它只是空的.在自定义表单后面的代码中,我可以执行以下操作:
myTitle.Value = "Some Title Value";
string testValue = myTitle.Value; //-->"Some Title Value"
Run Code Online (Sandbox Code Playgroud)
但是当试图设置Guid字段的值时 - 它无法以某种方式完成:
string anotherValue = myGuidField.Value; //--> null
Guid myGuid = new Guid("7f824c3f-4049-4034-a231-85291fce2680");
myGuidField.Value = myGuid;
string anotherValue = myGuidField.Value; //--> still null
//but myGuidField is seen as a "Microsoft.Sharepoint.WebControls.GuidField"
Run Code Online (Sandbox Code Playgroud)
所以不知怎的,我只是无法以编程方式设置Guid值,而且我也无法只显示Guid.
两个问题:
这是一个我已经坚持了好几个小时的问题,到现在为止我感到非常绝望.我将我们的应用程序从Spring 2.5/Hiberante 3.3迁移到Spring 3.0.5/Hibernate 3.6.完成以下工作:
在经过不同的小修复和调整后从Eclipse IDE启动时仍然存在的错误如下:
Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/tx]
Run Code Online (Sandbox Code Playgroud)
我查看了其他线程,并意识到当在类路径中找不到特定的lib(在本例中为spring-tx)时会出现这样的问题,但我在Maven依赖项中清楚地看到它.
我做的下一件事是,我为以前的版本构建了WAR,将它部署在Tomcat上,应用程序运行良好!
通过这个我可以得出Eclipse环境配置中缺少某些东西的结论.有趣的是,所有的抱怨都是关于spring-tx, - 当我使用tx命名空间删除单行时
<tx:annotation-driven transaction-manager="transactionManager" />
...应用程序启动正常而没有抱怨其他命名空间(当然,它没有正常工作,但至少没有抱怨期间初始).
关于我的IDE /项目设置的一些摘要:
正式的问题是:在迁移到Spring 3x后,从IDE启动项目会导致此类错误的可能原因是什么(并且作为构建的WAR可以正常部署)?
我不指望直接的答案(除非有人有完全相同的环境和问题),但指导方针,建议会有很大的帮助!
编辑 忘记提及在IDE启动应用程序期间,我有一堆这样的警告:
[WARN] Server class 'javax.persistence.EntityManagerFactory' could not be found in the web app, but was found on the system classpath
[WARN] Adding classpath entry 'file:/D:/maven/repository/org/hibernate/javax/persistence/hibernate-jpa-2.0-api/1.0.0.Final/hibernate-jpa-2.0-api-1.0.0.Final.jar' to the web app classpath for this …Run Code Online (Sandbox Code Playgroud) asp.net ×2
c# ×2
iphone ×2
java ×2
asynchronous ×1
breakpoints ×1
c++ ×1
debugging ×1
delegates ×1
eclipse ×1
field ×1
graphics2d ×1
guid ×1
gwt ×1
ios ×1
ipad ×1
javascript ×1
mfc ×1
objective-c ×1
repaint ×1
repeater ×1
request ×1
selenium ×1
sharepoint ×1
spring ×1
swing ×1
uiwebview ×1
visual-c++ ×1
webdriver ×1
xcode ×1