??xml version="1.0" encoding="utf-8" standalone="yes"?>三级网站视频在在线播放,久久五月精品,国产欧美日韩影院http://www.aygfsteel.com/yank/category/23820.htmljavaH击?/description>zh-cnThu, 23 Aug 2007 09:10:20 GMTThu, 23 Aug 2007 09:10:20 GMT60l构和类[struct and class]http://www.aygfsteel.com/yank/archive/2007/08/23/138808.html停留的风停留的风Thu, 23 Aug 2007 05:24:00 GMThttp://www.aygfsteel.com/yank/archive/2007/08/23/138808.htmlhttp://www.aygfsteel.com/yank/comments/138808.htmlhttp://www.aygfsteel.com/yank/archive/2007/08/23/138808.html#Feedback0http://www.aygfsteel.com/yank/comments/commentRss/138808.htmlhttp://www.aygfsteel.com/yank/services/trackbacks/138808.html阅读全文

停留的风 2007-08-23 13:24 发表评论
]]>
l构函数http://www.aygfsteel.com/yank/archive/2007/08/20/138213.html停留的风停留的风Mon, 20 Aug 2007 11:49:00 GMThttp://www.aygfsteel.com/yank/archive/2007/08/20/138213.htmlhttp://www.aygfsteel.com/yank/comments/138213.htmlhttp://www.aygfsteel.com/yank/archive/2007/08/20/138213.html#Feedback0http://www.aygfsteel.com/yank/comments/commentRss/138213.htmlhttp://www.aygfsteel.com/yank/services/trackbacks/138213.htmlnamespace structHs
{     
    struct customerName
        {
            public string firstName, secondName;

            public string Name()
            {
                return firstName + " " + secondName;
            }
        }
    class Program
    {
        static void Main(string[] args)
        {
            customerName myName;
            myName.firstName = "Jim";
            myName.secondName = "Smith";
            Console.WriteLine(myName.Name());
            Console.ReadKey();
        }
    }
}



停留的风 2007-08-20 19:49 发表评论
]]>
在GridView中针寚w标单ȝ某一独立单元D行编?/title><link>http://www.aygfsteel.com/yank/archive/2007/07/13/130119.html</link><dc:creator>停留的风</dc:creator><author>停留的风</author><pubDate>Fri, 13 Jul 2007 08:35:00 GMT</pubDate><guid>http://www.aygfsteel.com/yank/archive/2007/07/13/130119.html</guid><wfw:comment>http://www.aygfsteel.com/yank/comments/130119.html</wfw:comment><comments>http://www.aygfsteel.com/yank/archive/2007/07/13/130119.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/yank/comments/commentRss/130119.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/yank/services/trackbacks/130119.html</trackback:ping><description><![CDATA[原文地址Q?br><a target=_blank><font color=#0000ff><u>http://www.codeproject.com/useritems/EditGridviewCells.asp</u></font></a><br><a target=_blank><u><font color=#0000ff>[原文源码下蝲]</font></u></a><br><a target=_blank><u><font color=#0000ff>[译者改后源码下载]</font></u></a><br>[译]在GridView中针寚w标单ȝ某一独立单元D行编?br>原文发布日期Q?007.04.07<br>作者:<a target=_blank><u><font color=#0000ff>Declan Bright</font></u></a><br>译Q?a target=_blank><u><font color=#0000ff>webabcd</font></u></a><br><strong>介绍</strong><br>ASP.NET的GridView控g允许你通过讄它的EditIndex属性来~辑数据行,此时整个数据行都处于~辑模式?nbsp;如果你在EditItemTemplate的一些列中用了DropDownList控gQ那么你也许不希望整个数据行都处于编辑模式?nbsp;因ؓQ如果每一个DropDownList控g都有很多选项的话Q那么一ơ加载所有DropDownList控g的所有选项׃D面执行~慢?nbsp;<br>另外Q如果你的数据行的编辑模式需要占用更多的I间的话Q那么针Ҏ一个独立的单元D行编辑要优于针对整个数据行进行编辑?nbsp;q里Q我示范如何实现这L功能Q又如何d理事仉证(event validationQ?nbsp;<br><strong>背景</strong><br>本文Z我之前写的一文章:<a target=_blank><u><font color=#0000ff>GridView和DataList响应单击数据行和双击数据行事?/font></u></a>。如果你不知道如何让GridView响应单击数据行事Ӟ那么你可以在阅读本文之前先看看这文章?nbsp;<br><br><strong>~辑某一个独立的GridView单元根{?/strong><br><img onmouseover="this.style.cursor='hand';" style="CURSOR: hand" onclick=window.open(this.src); height=435 alt=按此在新H口打开囄 src="http://www.517sou.net/attachments/month_0704/xum1_EditGridviewCells1.jpg" width=495 onload=javascript:DrawImage(this); border=0><br>我所演示的这个GridView有一个不可见的asp:ButtonField控gQ它处于GridView的第一列,名ؓ“SingleClick”?nbsp;它用于给GridView的数据行增加单击事g?nbsp;<br> <div id="wmqeeuq" class=code_main><Columns>                <br>    <asp:ButtonField Text="SingleClick" CommandName="SingleClick" Visible="False" /><br></Columns></div> <br>其它每一列的ItemTemplate中有一个可见的Label控g和一个不可见的TextBox或DropDownList控g?nbsp;Z方便Q我们称Label为显C控ӞTextBox或DropDownList为编辑控件?br> <div id="wmqeeuq" class=code_main>    <asp:TemplateField HeaderText="Task"><br>        <ItemTemplate><br>            <asp:Label ID="DescriptionLabel" runat="server" Text='<%# Eval("Description") %>'></asp:Label><br>            <asp:TextBox ID="Description" runat="server" Text='<%# Eval("Description") %>' Width="175px" visible="false"></asp:TextBox><br>        </ItemTemplate><br>    </asp:TemplateField></div> <br>q里的办法就是用昄控g来显C数据,当单元格所包含的显C控件被单击的时候,则把昄控g的Visible属性设|ؓfalseq且把编辑控件的Visible属性设|ؓtrue?nbsp;q里不用使用EditItemTemplat?nbsp;<br><br>在RowDataBound事g内@环ؓ每一数据行的每一单元格增加单M件?nbsp;使用单元格在数据行中的烦引作Z件参敎ͼq样在单元格触发了单M件后我们可以知道到底是哪个单元D单击了?nbsp;<br> <div id="wmqeeuq" class=code_main>    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)<br>    {<br>        if (e.Row.RowType == DataControlRowType.DataRow)<br>        {<br>            // 从第一个单元格内获得LinkButton控g<br>            LinkButton _singleClickButton = (LinkButton)e.Row.Cells[0].Controls[0];<br>            // q回一个字W串Q表C对包含目标控g?nbsp;ID 和事件参数的回发函数?nbsp;JavaScript 调用<br>            string _jsSingle = ClientScript.GetPostBackClientHyperlink(_singleClickButton, "");<br><br>            // l每一个可~辑的单元格增加事g<br>            for (int columnIndex = _firstEditCellIndex; columnIndex < e.Row.Cells.Count; columnIndex++)<br>            {<br>                // 增加列烦引作Z件参?br>                string js = _jsSingle.Insert(_jsSingle.Length - 2, columnIndex.ToString());<br>                // l单元格增加onclick事g<br>                e.Row.Cells[columnIndex].Attributes["onclick"] = js;<br>                // l单元格增加鼠标l过时指针样?br>                e.Row.Cells[columnIndex].Attributes["style"] += "cursor:pointer;cursor:hand;"; <br>            }     <br>        }<br>    }</div> <br>在RowCommand事g内读出命令参数和事g参数?nbsp;q会告诉我们被选中的行和列的烦引?nbsp;<br>     <div id="wmqeeuq" class=code_main>int _rowIndex = int.Parse(e.CommandArgument.ToString());      <br>    int _columnIndex = int.Parse(Request.Form["__EVENTARGUMENT"]);</div> <br>因ؓ知道了被选中的行和列的烦引,所以可以通过把显C控件的Visible讄为falseQ编辑控件的Visible讄为true来把某个独立的单元格讄为编辑模式?nbsp;然后通过清除单元格的属性来删除被选中单元格的单击事g?nbsp;<br> <div id="wmqeeuq" class=code_main>    // 获得被选中单元格的昄控gq设|其不可?br>    Control _displayControl = _gridView.Rows[_rowIndex].Cells[_columnIndex].Controls[1]; <br>    _displayControl.Visible = false;<br>    // 获得被选中单元格的~辑控gq设|其可见<br>    Control _editControl = _gridView.Rows[_rowIndex].Cells[_columnIndex].Controls[3];<br>    _editControl.Visible = true;<br>    // 清除被选中单元格属性以删除click事g<br>    _gridView.Rows[_rowIndex].Cells[_columnIndex].Attributes.Clear();</div> <br>下面有一些代码用于回发服务器后设|焦点到~辑控gQ如果编辑控件是DropDownList的话Q那么它的SelectedValue要设|ؓ昄控g的|如果~辑控g是TextBox的话Q那么ؓ了做好编辑的准备p使它的文本被选中?nbsp;<br> <div id="wmqeeuq" class=code_main>    // 讄焦点到被选中的编辑控?br>    ClientScript.RegisterStartupScript(GetType(), "SetFocus", <br>        "<script>document.getElementById('" + _editControl.ClientID + "').focus();</script>");<br>    // 如果~辑控g是DropDownList的话<br>    // SelectedValue讄为显C控件的?br>    if (_editControl is DropDownList && _displayControl is Label)<br>    {<br>        ((DropDownList)_editControl).SelectedValue = ((Label)_displayControl).Text;<br>    }                 <br>    // 如果~辑控g是TextBox的话则选中文本框内文本<br>    if (_editControl is TextBox)<br>    {<br>       ((TextBox)_editControl).Attributes.Add("onfocus", "this.select()");<br>    }</div> <br>在这个Demo中,我把事g被触发的历史记录也写C里?nbsp;<br><br>如果GridView处于~辑模式的话Q那么要在RowUpdating事g里去查找被选中行的每一个单元格?nbsp;如果发现单元格处于编辑模式的话,那么p?#8220;更新”代码?nbsp;在这个Demo中,数据保存在DataTable里,而这个DataTable则储存在session中?nbsp;<br> <div id="wmqeeuq" class=code_main>    // 循环每一列以扑ֈ处于~辑模式下的单元?br>    for (int i = 1; i < _gridView.Columns.Count; i++)<br>    {<br>        // 获得单元格的~辑控g<br>        Control _editControl = _gridView.Rows[e.RowIndex].Cells[i].Controls[3];<br>        if (_editControl.Visible)<br>        {<br>           . update the data<br>        }<br>    }</div> <br>Z保RowUpdating事g在编辑单元格后被Ȁ发,要在Page_Load中来触发q个事g?nbsp;~辑了TextBox后,通过按回车键或者单d一单元格来佉K面做回发处理Q下面的q段代码是用于保M数据的改变都会被更新?br> <div id="wmqeeuq" class=code_main>    if (this.GridView1.SelectedIndex > -1)<br>    {<br>        this.GridView1.UpdateRow(this.GridView1.SelectedIndex, false);<br>    } </div>   <br><br><strong>Z验证而注册回发和回调数据</strong><br>在RowDataBound中创建的自定义事件必要在页中注册?nbsp;通过重写RenderҎ来调用ClientScriptManager.RegisterForEventValidation?nbsp;通过GridViewRow.UniqueIDq回行的唯一IDQ按U的唯一ID通过在行的唯一ID后附?#8220;$ct100”而生成?nbsp;<br> <div id="wmqeeuq" class=code_main>    protected override void Render(HtmlTextWriter writer)<br>    {<br>        foreach (GridViewRow r in GridView1.Rows)<br>        {<br>            if (r.RowType == DataControlRowType.DataRow)<br>            {<br>                for (int columnIndex = _firstEditCellIndex; columnIndex < r.Cells.Count; columnIndex++)<br>                {<br>                    Page.ClientScript.RegisterForEventValidation(r.UniqueID + "$ctl00", columnIndex.ToString());<br>                }<br>            }<br>        }<br>      <br>        base.Render(writer);<br>    }</div> <br>q将防止M“回发或回调参数无?#8221;的错误?br><br><strong>q个Demo中的其它CZ</strong><br>使用SQL数据源控件编辑某一独立的GridView单元?br>用SqlDataSouce控g实现q个技术需要对GridView的RowUpdating事g做一些修攏V?nbsp;当更新GridView的行的时候,SqlDataSource控g一般要把|valuesQ从EditItemTemplate转移到NewValues集合里?nbsp;因ؓ我们没有使用EditItemTemplateQ所以这U情况下|valuesQ不会自动地转移到NewValues集合里?nbsp;<br>    e.NewValues.Add(key, value);<br>我在App_Data文g夹下使用了一个简单的SQL Server Express数据库?nbsp;Q要使用你自q数据库的话,你可以修改web.config里的q接字符Ԍ<br><br><br>使用对象数据源控件编辑某一独立的GridView单元?br>本示例用了App_Code文g夹内的两个类Q?br>    ·Task.cs – d对象<br>    ·TaskDataAccess.cs – 理d对象<br><br>Aspx늚后置代码与SQL Data SourceCZ是一L?nbsp;ObjectDataSource通过TaskDataAccess.csc里的GetTasks和UpdateTaskҎ来管理数据?nbsp;<br><br><strong>有着电子数据表样式的GridView</strong><br>q里有一个与电子数据表的样式很像的GridView?nbsp;Q虽然它看v来像一个电子数据表Q但是ƈ不是真的有像电子数据表一L功能Q它仍然是一个GridView。) <br><br>q里虽然有一些单d改变单元格样式的附加代码Q但是主要的代码q是与上面所q是相同的?br><img onmouseover="this.style.cursor='hand';" style="CURSOR: hand" onclick=window.open(this.src); height=432 alt=按此在新H口打开囄 src="http://www.517sou.net/attachments/month_0704/qnft_EditGridviewCells2.jpg" width=490 onload=javascript:DrawImage(this); border=0><br>用SQL数据源控件实现有着电子数据表样式的GridView<br>本示例与上面的基本相同,但是它修改了GridView的RowUpdating事g以其允许用SqlDataSource控g来工作?br><br><strong>参?/strong><br>    ·<a target=_blank><u><font color=#0000ff>GridView和DataList响应单击数据行和双击数据行事?/font></u></a><br>    ·<a target=_blank><u><font color=#0000ff>ASP.NET 2.0数据教程</font></u></a><br><br><strong>l论</strong><br>如果你想在GridView中一ơ只针对一个单元格q行~辑Q那么这个方法将会对你有所帮助?br><br>译者注Q事仉证(EventValidationQ。出于安全目的,此功能验证回发或回调事g的参数是否来源于最初呈现这些事件的服务器控件。如果数据有效ƈ且是预期的,则用ClientScriptManager.RegisterForEventValidationҎ来注册回发或回调数据以进行验证?br><img src="http://www.517sou.net/images/download.gif" align=absMiddle> <a target=_blank><u><font color=#0000ff>点击下蝲此文?/font></u></a> <img src ="http://www.aygfsteel.com/yank/aggbug/130119.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/yank/" target="_blank">停留的风</a> 2007-07-13 16:35 <a href="http://www.aygfsteel.com/yank/archive/2007/07/13/130119.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <a href="http://www.aygfsteel.com/" title="狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频">狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频</a> </div> </footer> վ֩ģ壺 <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">̫ԭ</a>| <a href="http://" target="_blank">ֽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Ѩ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Ͱ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ٳ</a>| <a href="http://" target="_blank">ƽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ɫ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ν</a>| <a href="http://" target="_blank">߮</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ˮ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">»</a>| <a href="http://" target="_blank">Dz</a>| <a href="http://" target="_blank">ְ</a>| <a href="http://" target="_blank">ˮ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">˳</a>| <a href="http://" target="_blank">Ԫ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ʡ</a>| <a href="http://" target="_blank">̨</a>| <a href="http://" target="_blank">ղ</a>| <a href="http://" target="_blank">Ԫ</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>