我正在运行一个世界目标网站,来自世界各地的人们访问.该数据库包含国际日期线西格式的时间.我使用JavaScript获取用户时区,并将数据库中的时间转换为用户的时间,然后在页面上显示.我想问一下,International Date Line West是世界级网站的正确格式吗?或者设置为UTC或GMT会更好吗?UTC和GMT以及International Date Line West有什么区别?这三个一样吗?最后我应该在什么时间设置我的服务器,将使用用户的时区偏移进行转换?
我的Windows窗体应用程序中有一个textBox和一个webBrowser控件.每当用户在textBox中输入HTML代码时,webBrowser控件都会显示其编译的表单.这个代码:
private void textBox2_TextChanged(object sender, EventArgs e)
{
webBrowser1.DocumentText = textBox2.Text;
}
Run Code Online (Sandbox Code Playgroud)
但是每当我单击webBrowser控件中的链接时,它都会在同一个webBrowser控件中打开它.我想要的是它应该在系统的默认Web浏览器中打开.那么这个处理链接点击的webBrowser控件有什么事件吗?
我无法为这个主题写好标题,因为我的问题有点奇怪.我在我的网站上使用AjaxControlToolkit HTMLEditorExtender发送HTML格式的电子邮件.其他所有功能,如粗体,斜体,下划线等都可以正常工作,但是当我添加一个链接时,它会显示如下的HTML代码:

正如您所见,BOLD正在运行,但锚标签以HTML代码格式显示.
扩展程序代码和文本框:
<asp:TextBox ID="TextBox2" runat="server" Height="376px"
TextMode="MultiLine" Width="795px"></asp:TextBox>
<asp2:HtmlEditorExtender ID="TextBox2_HtmlEditorExtender"
runat="server" Enabled="True" TargetControlID="TextBox2">
</asp2:HtmlEditorExtender>
Run Code Online (Sandbox Code Playgroud)
任何人都可以告诉我为什么会这样吗?这是扩展器的一些错误吗?
我正在开发一个视频流媒体网站.我想计算每个视频的独特视图.我在互联网上提到了一些网站,甚至还问过其他一些程序员.他们说使用cookie或会话或IP地址.但是这些事情会随着时间而改变 如果可能的话,我们可以使用用户机器的MAC地址吗?我在这里也遇到了类似的问题 - > http://bit.ly/Qh1KNR.他们说有类似浏览器指纹的东西使用MAC地址.所以你能告诉我哪种方法最好吗?
我HTMLEditorExtender在我的网站上使用AjaxToolKit的控件.标记如下:
<asp:TextBox ID="TextBox2" runat="server"
Font-Names="'lucida grande',tahoma,verdana,arial,sans-serif" Height="100%" OnTextChanged="TextBox2_TextChanged"
style="margin-bottom: 26px; font-size: small;" Width="90%"></asp:TextBox>
<asp:HtmlEditorExtender ID="TextBox2_HtmlEditorExtender" runat="server"
Enabled="True" TargetControlID="TextBox2">
<Toolbar>
<asp:Undo />
<asp:Redo />
<asp:Bold />
<asp:Italic />
<asp:Underline />
<asp:StrikeThrough />
<asp:Subscript />
<asp:Superscript />
<asp:InsertOrderedList />
<asp:InsertUnorderedList />
<asp:RemoveFormat />
<asp:SelectAll />
<asp:UnSelect />
<asp:Delete />
<asp:Cut />
<asp:Copy />
<asp:Paste />
<asp:Indent />
<asp:Outdent />
<asp:FontNameSelector />
</Toolbar>
</asp:HtmlEditorExtender>
Run Code Online (Sandbox Code Playgroud)
运行应用程序,并在有焦点时按Enter键TextBox2,不会插入新行; 相反,TextBox2失去了焦点.
这不会发生,除非将HTMLEditorExtender连接到TextBox2.
更多细节
我在本地IIS中运行该应用程序.该网站已上线但该功能尚未在主网站上推出.我正在使用ASP.NET …
我有一个CheckBoxList控件,其中包含动态生成的复选框项.此复选框列表将包含用户名.我正在使用AjaxControlToolkit中的Gravatar控件来允许用户拥有自己的个人资料图片.我想要的是当一个带有用户名作为文本的复选框添加到CheckBoxList时,还应该在复选框之前或之后添加Gravatar控件,显示用户的相应显示图片.我想到的另一种方法是使用复选框和gravatar来设置自定义用户控件.但如果有任何其他精简和简单的解决方案可用,那么请建议我.以下是代码:
<table class="style1">
<tr>
<td align="right" style="padding: 5px" width="25%">
Username/Email:</td>
<td style="padding: 5px">
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" CssClass="newButton"
onclick="Button1_Click" Text="Search" />
</td>
</tr>
<tr>
<td align="right" style="padding: 5px" valign="top" width="25%">
Results:</td>
<td style="padding: 5px">
<asp:CheckBoxList ID="CheckBoxList1" runat="server"
onselectedindexchanged="CheckBoxList1_SelectedIndexChanged"
AutoPostBack="True">
</asp:CheckBoxList>
</td>
</tr>
<tr>
<td align="right" style="padding: 5px" width="25%" valign="top">
Selected People:</td>
<td style="padding: 5px">
<asp:ListBox ID="ListBox1" runat="server" Height="149px" Width="260px">
</asp:ListBox>
</td>
</tr>
</table>
Run Code Online (Sandbox Code Playgroud)
如您所见,它还有一个列表框,其中包含checkboxlist中的选定项目.如果可能的话,请为列表框建议我.
我正在尝试在其客户端的两个网站之间建立数据交换系统。为此,我正在使用 EasyXDM。(http://easyxdm.net/)。这是我的父网站代码:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>EasyXDM Test</title>
<script type="text/javascript" src="easyXDM.debug.js"></script>
<script type="text/javascript">
var serv_socket = new easyXDM.Socket({
remote: "http://localhost:39452/EasyXDM/Default.aspx",
onMessage: function (message, origin) {
document.getElementById('msg').innerText="Received '" + message + "' from '" + origin + "'";
},
onReady: function () {
serv_socket.postMessage("ID");
}
});
</script>
</head>
<body>
<form id="form1">
<div>
<iframe src="http://localhost:39452/EasyXDM/Default.aspx"></iframe>
<input type="text" id="msgtext" /><a href="#" onclick="serv_socket.postMessage('d')">Send message</a>
<div id="msg"></div>
</div>
</form>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
以下是位于localhost:39452域的子网站代码:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Server</title> …Run Code Online (Sandbox Code Playgroud) 我有以下代码:
public string getFinalCon(string desid)
{
string finalConId = null;
try
{
query = "select finalConID from discussions where desid=@did";
com = new SqlCommand(query, con);
com.Parameters.AddWithValue("@did", desid);
con.Open();
sdr = com.ExecuteReader();
while (sdr.Read())
{
if (sdr.GetString(0).Equals("none") == false && sdr.GetString(0)!=null)
{
finalConId = sdr.GetString(0);
break;
}
}
con.Close();
}
catch (Exception)
{
}
return finalConId;
}
Run Code Online (Sandbox Code Playgroud)
正如您所看到的,我正在捕捉"异常",即全局异常.但问题是每当执行此行finalConId = sdr.GetString(0)时,系统都会抛出System.Data.SqlTypes.SqlNullValueException.是的,只要相应字段中的数据库中存在NULL值,它肯定会抛出它.但我想要的是这个异常应该被catch块捕获,并且函数应该返回默认值finalConId,该函数在启动时声明为NULL.但这不会发生,而是显示我的错误页面.我这样调用这个函数:
string conid = getFinalCon(Request["id"].ToString());
if (conid == null)
{ /*---some code---*/}
else
{/*---some code---*}
Run Code Online (Sandbox Code Playgroud)
请有人告诉我如何处理这个例外.
我无法解释我的问题。但如果有人理解我想要什么,请进行编辑。
我有以下代码
<table style="width:100%">
<tr style="border-style: none solid solid solid; border-width: thin; border-color: #C0C0C0; background-color: #FFFFFF">
<td class="style4" width="100%"
style="border-bottom-style: solid; border-bottom-width: thin; border-bottom-color: #C0C0C0"
align="left">
<h1 style="font-style: normal; font-weight: normal;">
<%=t.getTitle() %>
</h1>
Run Code Online (Sandbox Code Playgroud)
每当t.getTitle()返回一行中的较大字符串时,我的标题就会超出页面(溢出)。我想把它的内容包装h1进去td。
就像 stackoverflow.com 用于其问题标题一样。
我不是那么专业的CSS和JavaScript.我正在一个用户创建和编辑文章的文章网站上工作.目前,只要用户想要删除或编辑文章,他就会点击每个代表文章的DIV下面的某个按钮.代码是这样的
<div id="article"><!-- article data --></div>
<asp:Button ID="Button1" runat="server" onclick="Button1_Click"
style="height: 26px" Text="Delete" />
Run Code Online (Sandbox Code Playgroud)
但我想要的是,当页面加载时,此删除按钮必须不可见.只有当用户将鼠标悬停在相应的div上时它才应该可见,并且它应该与div的右下角的div重叠.请告诉我怎么做?