2006年11月9日
#
要为网站做一个帮助页面,想把所有的内容按标题分级折叠起来,如下
*一级菜单1
*内容1
*二级菜单1
*三级菜单1
*内容2
*三级菜单2
*内容3
*二级菜单2
*内容4
*一级菜单2
*二级菜单3
*内容5
要实现的效果是点击某菜单显示其内容或下一级菜单,再点击折叠起来.
希望高人赐教.
听说有工具软件能很容易地实现这种页面,不知是什么.
2006年8月15日
#
string pattern ="";
Regex r=New Regex(pattern,RegexOptions.Multiline);
MatchCollection mc=r.Matches(WebpageSourceCode);
我相从网页source code中提取这些信息:以<a href="personen.d4w开头到第一个</tr>结束,网页中可能多个这样的字符串。提取之后,存到mc中:
我对正则表达式是没有一点研究的,请问第一行的那个pattern应该怎么写?
2006年7月12日
#
var OrgID;
var con;
function MM_openWindow(OrgID,con) { //v2.0
window.open('InputPerson.aspx?OrgID='+ OrgID + '&con='+con,'test','scrollbars=yes,width=600,height=300,left=200,top=200,resizable=yes');
}
<asp:imagebutton id="aaa" onclick="MM_openWindow(<%# OrgID %>, mycon>)" ImageUrl="../images/icon-pencil.gif" runat="server"></asp:imagebutton>
其中OrgID为后台的Public型的数据,但这样却不行,请教高手该怎么写??
2006年7月7日
#
CREATE TRIGGER dbo.AfterProcessDelete
ON dbo.tb_Processes
after update
AS
declare @DeleteTime datetime
set @DeleteTime=(select DeleteTime from inserted)
if(update(DeleteTime) and (@DeleteTime is not null))
begin
...........
end
C#中,弹出窗口的代码为:
MessageBox("用户名或密码错误!","错误:");
而在Asp.net中,则不可以用这种方法了,这时我们可以写一个类Message(名字随便取),内容如下:
//---------------------------------------
//作者:明天去要饭
//QQ:305725744
//---------------------------------------
using System;
namespace Common
{
/// <summary>
/// Message 的摘要说明。
/// </summary>
public class Message
{
public Message()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
//返回一个弹出窗口
public static string Show(string strMsg)
{
//这里0就指strMsg这东西,1就是指\这东西.
return String.Format("<script language={1}javascript{1}>alert({1}{0}{1});</script>",strMsg,"\"");
}
}
}
然后在要弹出对话框的页面上,添加一个label控件,假设命名为lblMsg,这时,后台写代码:
lblMsg.Text = Message.Show("这里写要弹出来的内容");
这样就可以实现弹出提示的效果了.注意,我的类是写在通用层中,所以还要先引用通用层:
using Common;
2006年7月3日
#
我要在后台程序的某个事件中实现框架中另外一个页面的跳转要如何来写,类似于hyperlink的navigitorurl和target的属性,但hyperlink没有相应的事件,不能用。求高人相助!
2006年6月23日
#
在网上找不到我想要验证dropdownlist的方法,
所以想了N久,才想到这个方法,
<asp:comparevalidator id="checkpwd" runat="server" Display="Dynamic" ControlToValidate="workClass" Type="String" ValueToCompare="父级分类" Operator="NotEqual" ErrorMessage="请选择类别" ></asp:comparevalidator>
ControlToValidate = 要验证的dropdownlist
Type = 要验证的字符类型 (我的这里是验证字符串)
ValueToCompare = 要验证的字符串的值
Operator="NotEqual" 不等于
现在我要验证的就是dropdownlist选择的值不等于 父级分类 否则提示:请选择类别
这个方法唯一的不好就是只能验证dropdownlist.selectedItem.value 不能对selectedItem.text 进行验证!
2006年6月19日
#
如果想给这样的东西加事件最笨的方法(也是我现在在用的方法)。DataGrid外面(窗体上)放一个宽度高度都是0的按钮(hidebtnTest)
从DataGrid中取出这个控件的引用。例:
Button btnTest = gdTest.Items.FindControl("gdbtnTest") as Button;
btnTest.AddAttribute("onclick","document.all.hidebtnTest.click();");
然后在hidebtnTest的Click事件里写你想要的操作。
2006年5月29日
#
private void DGzf_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)

{
if (e.Item.ItemType!=ListItemType.Header)

{
e.Item.Attributes.Add( "onmouseout","this.style.backgroundColor=\""+e.Item.Style["BACKGROUND-COLOR"]+"\"");
e.Item.Attributes.Add( "onmouseover","this.style.backgroundColor=\""+ "#EFF3F7"+"\"");
}
}
2006年5月25日
#
小弟无知,写成这样:
<asp:hyperlinkcolumn DataNavigateUrlField="ID" DataNavigateUrlFormatString="Master.aspx?id={0}&index=1&adminindex=3&IsEdit=0&IsDeleted=<%# IsDelete %>" DataTextField="Name" SortExpression="Name" HeaderText="Application (click to view)">
其中IsDelete 是后台程序中的一个参数,我试了一下,没有获得这个参数,地址栏中显示的是:
/Master.aspx?id=32&index=1&adminindex=3&IsEdit=0&IsDeleted=<%#%20IsDelete%20%>
怎么办呢?求高手帮助!