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
相关文档:
1、由dataset生成
public void CreateExcel(DataSet ds,string typeid,string FileName)
{
HttpResponse resp;
resp = Page.Response;
resp.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
resp.AppendHeader("Content-Dis ......
由于项目需要一个论坛,本来有CS的,在.net下很出名的国外开源论坛。但为了适应国内的风气,最后选用在国内如日中天的Discuz!NT。
将Discuz与asp.net开发的网站整合,有很多人已经完成了。
但在网上没有找到较详细的描述。方法倒是有很多种。
在项目中注册新用户时,也同时调用论坛的用户注册,这样就同步注册了。至于删 ......
1. 打开新的窗口并传送参数:
传送参数:
response.write("<script>window.open('*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"')</script>")
接收参数:
string a = Request.QueryString("id");
string b = Request.QueryString("id1");
2.为按钮添加对话框
Button1.Attributes. ......
首先我很遗憾的告诉大家,因为微软的偷懒,目前UpdatePanel还不支持文件上传。变相的解决办法就是UpdatePanel中设置PostBackTrigger:
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:FileUpload ID="FileUpload1" runat="serv ......
<!--
/* 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:"\@宋体" ......