我在我的网页中使用checkboxlist如下:
<asp:CheckBoxList ID="chklstTelpas" runat="server" RepeatDirection="Horizontal"
AutoPostBack="True" Width="594px"
OnSelectedIndexChanged="chklstTelpas_SelectedIndexChanged">
<asp:ListItem Text="TELPAS Speaking" Value="1"></asp:ListItem>
<asp:ListItem Text="TELPAS Listening" Value="2"></asp:ListItem>
<asp:ListItem Text="TELPAS Reading" Value="3"></asp:ListItem>
<asp:ListItem Text="TELPAS Writing" Value="4"></asp:ListItem>
</asp:CheckBoxList>
Run Code Online (Sandbox Code Playgroud)
现在,如果我检查列表项,我想为该特定选定项应用一些背景颜色.如果我取消选中,我希望背景保持与最初显示的颜色相同,或者我想删除背景颜色.
大家好我有我的XML文件如下
的名字 XML XMLFile2.xml
<?xml version="1.0"?>
<Product ProductID="123"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="Product.xsd">
<ProductName>XYZ</ProductName>
</Product>
Run Code Online (Sandbox Code Playgroud)
我的XSD情况如下
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="Product"
targetNamespace="http://tempuri.org/Product.xsd"
elementFormDefault="qualified"
xmlns="http://tempuri.org/Product.xsd"
xmlns:mstns="http://tempuri.org/Product.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Product">
<xs:complexType>
<xs:sequence>
<xs:element name="ProductName" type="xs:string"></xs:element>
</xs:sequence>
<xs:attribute name="ProductID" type="xs:int" use="required"/>
</xs:complexType>
</xs:element>
Run Code Online (Sandbox Code Playgroud)
这是我的代码
string strPath = Server.MapPath("XMLFile2.xml");
XmlTextReader r = new XmlTextReader(strPath);
XmlValidatingReader v = new XmlValidatingReader(r);
v.ValidationType = ValidationType.Schema;
v.ValidationEventHandler +=
new ValidationEventHandler(MyValidationEventHandler);
while (v.Read())
{
}
v.Close();
if (isValid)
Response.Write("Document is valid");
else
Response.Write("Document is invalid");
Run Code Online (Sandbox Code Playgroud)
我收到以下错误
Validation event …Run Code Online (Sandbox Code Playgroud) 大家好,当我尝试从App.config文件检索连接时,我收到指定的错误。
我App.Config的如下
<add name="Conn"
connectionString="Data Source=SYSTEM19\SQLEXPRESS;Initial Catalog=Dora;Integrated Security=True"
providerName="System.Data.SqlClient" />`
Run Code Online (Sandbox Code Playgroud)
在这一行代码中,我收到提到的错误,任何人都可以帮助我
dataAdapter = new MySqlDataAdapter(selectCommand, MyConnectionString);
Run Code Online (Sandbox Code Playgroud) 我正在使用带有vb代码的asp.net进行Web应用程序.
我有一个时间字段的文本框,我正在使用正则表达式验证器.
我想要的格式是HH:MM am.我正在使用的正则表达式是"(0[1-9]|[1][0-2])[:]" + "(0[0-9]|[1-5][0-9])[ ][A|a|P|p][M|m]"
我正在输入时间示例:08:30 AM或08:30 PM,但正则表达式显示错误消息.
任何人都可以帮助我正确的正则表达.
谢谢大家
舒卜哈
我想创建一个在mysql一天结束时运行的作业,在那个作业中我想更新表中的一些列值.假设我有2个表,其中我有一个名为Statuswhich 的列Pending or Accepted.为此,我想创建一个Job,我想搜索这两个表并将Pending状态设置为Accepted.
是否有可能
大家好,我正在用 javascript 中的查询字符串构建一个 url,如下所示,一切正常,但查询字符串之间有一个通讯,所以有人可以帮助我吗
<script type="text/javascript">
function RedirectLocation() {
var cntrl = "Q1;Q2";
var str_array = cntrl.split(';');
var cnt = str_array.length;
if (cnt == 0) {
location.href = '/callBack.aspx';
}
else {
var arr = [];
for (var i = 0; i < str_array.length; i++) {
str_array[i] = str_array[i].replace(/^\s*/, "").replace(/\s*$/, "");
arr.push(str_array[i] + '=1');
if (i != str_array.length - 1) {
arr.push('&');
}
}
location.href = '/Sample.aspx?' + arr;
}
}
</script>
Run Code Online (Sandbox Code Playgroud)
这给了我如下的查询字符串Sample.aspx?Q1=1,&,Q2=1我需要这样`Sample.aspx?Q1=1&Q2=1
我在点击更新时有一个更新按钮我想提示用户,如果你想用Yes和No按钮分隔记录.如果用户点击是,我想执行可以分隔记录的代码,而不仅仅是更新记录.
我的示例代码
protected void btnUpdate1_Click(object sender, EventArgs e)
{
EmpID = Convert.ToInt32(HiddenField1.Value);
if (ID == 2)
{
oEmployeePersonalData.EmpID = EmpID;
oEmployeePersonalData.PhoneNumberTypeID = ddlPhoneType.SelectedValue;
oEmployeePersonalData.PhoneNumber = Convert.ToInt64(txtph1.Text);
oEmployeePersonalData.EndDate = DateTime.Today.AddDays(-1);
Run Code Online (Sandbox Code Playgroud)
//根据我的要求,如果我点击是,我想执行此代码
if (oEmployeePersonalData.PhoneDetailUpdate())
{
}
Run Code Online (Sandbox Code Playgroud)
//如果没有不同的代码
SQL代码应该如何格式化?
你应该使用什么样的缩进?
关键字应该是大写吗?
列表应如何排列?
我有一个写a Regex来检查字符串是否包含9 digits如下,但false即使我有我的字符串,这总是返回我123456789.
if (Regex.IsMatch(strSSN, " ^\\d{9}$"))
Run Code Online (Sandbox Code Playgroud)
可以任何人告诉我什么是错的,如果有更好的人提供我..我实现的是字符串应该只有numeric data,长度应该是=9
c# ×6
asp.net ×3
.net ×2
javascript ×2
app-config ×1
checkboxlist ×1
coding-style ×1
date ×1
jquery ×1
mysql ×1
regex ×1
sql ×1
string ×1
t-sql ×1
winforms ×1
xml ×1
xsd ×1