ASP.NET代码片段
设置下拉框的初始值:
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem Text="小学" Value="1"></asp:ListItem>
<asp:ListItem Text="中学" Value="2"></asp:ListItem>
<asp:ListItem Text="大学" Value="3"></asp:ListItem>
</asp:DropDownList>
string init = "2";
for (int i = 0; i < DropDownList1.Items.Count; i++)
{
if (DropDownList1.Items[i].Value.ToString() == init)
{
DropDownList1.Items[i].Selected = true;
}
}
DropDownList1.Items.Insert(0,new ListItem("选择类别",0));
<asp:GridView ID="GridView1" ShowFooter="false" BorderColor="Black" OnRowDataBound="GridView1_RowDataBound" runat="server" AutoGenerateColumns="False" Font-Size="12px" Width="549px" AllowPaging="True" >
<Columns>
<asp:BoundField DataField="ID" HeaderText="编号" />
<asp:BoundField DataField="EmpBirthday" HeaderText="生日" DataFormatString="{0:yyyy-MM-dd}" HtmlEncode="False" />
&nbs
相关文档:
JavaScript实现:
<mce:script type ="text/javascript" ><!--
function readWord()
{
var div1=document .getElementById ("div1");
var WordApp,WordDoc,Str;
WordApp =new ActiveXObject ("Word.application");
WordDoc =WordApp.Documents.Open("F:\\工作日志.doc");
......
由于项目需要一个论坛,本来有CS的,在.net下很出名的国外开源论坛。但为了适应国内的风气,最后选用在国内如日中天的Discuz!NT。
将Discuz与asp.net开发的网站整合,有很多人已经完成了。
但在网上没有找到较详细的描述。方法倒是有很多种。
在项目中注册新用户时,也同时调用论坛的用户注册,这样就同步注册了。至于删 ......
当我输入一个关键字想按回车键就可以搜索,但由于页面上还有其他的Button,所以默认本不是我的搜索按钮,在网上搜了些解决方案,最多的是如下这种方式:
在asp.net中,如何回车触发指定按钮的事件?
假设:
<asp:TextBox id="tbInput" runat="server" Width="240px"></asp:TextBox>
<asp:Button ......
Membership
提供常规成员资格功能。
创建一个新用户。
删除一个用户。
用新信息来更新用户。
返回用户列表。
通过名称或电子邮件来查找用户。
验证(身份验证)用户。
获取联机用户的人数。
通过用户名或电子邮件地址来搜索用户。
MembershipUser
提供有关特定用户的信息。
获取密码和密码问题。
更改密码 ......
<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"\@宋体" ......