标签: button

将Button绑定到GridView

这是一个非常简单的问题,我只是不确定如何做到这一点.我想将一个Button或者ImageButton绑定到ASP.NET/C#中的GridView.目前,GridView有两列,并绑定到一个包含两列的DataTable.我想在GridView中添加第三列,其中包括Button.

我知道GridView有ButtonField,但我不太清楚如何使用它来做我想做的事情.我想动态生成这些按钮并将它们添加到GridView.

以下是我的GridView现在的样子:

<asp:GridView 
    ID="GridView1"
    Runat="server">
    <Columns>
        <asp:HyperLinkField 
            HeaderText="Display Name"
            DataNavigateUrlFields="DISPNAME"
            DataNavigateUrlFormatString="ViewItem.aspx"
            DataTextField="DISPNAME">
            <ItemStyle Width="70%" />
        </asp:HyperLinkField>
        <asp:BoundField
            DataField="TypeDisp"
            HeaderText="Type">
            <ItemStyle Width="20%" />
        </asp:BoundField>
    </Columns>
 </asp:GridView>
Run Code Online (Sandbox Code Playgroud)

c# asp.net gridview button

2
推荐指数
1
解决办法
3154
查看次数

什么是简单的JQuery按钮?

使用简单的JQuery命令,它会将常规按钮变成令人敬畏的东西.

javascript css jquery templates button

2
推荐指数
1
解决办法
418
查看次数

列表视图和按钮的自定义对话框始终为全屏

我想创建一个自定义对话框,其中包含列表视图下方的列表视图和按钮.按钮应位于列表视图下方,但始终可见(layout_alignParentBottom ="true").

我已经创建了一个非常好用的xml,但仅限于长列表.如果列表很短,则按钮仍位于屏幕底部,并且对话框标题的高度将拉伸以生成对话框填充屏幕.附图显示了我今天得到的结果.

简而言之.我想要一个普通的对话框,如果nececcary只填充屏幕.

我出于某种原因无法发布xml.但是我使用了relativelayout,按钮对齐父母底部,小面板布置在按钮上方,listview布置在此面板上方.所有布局都是布局:height = wrap_content.

感谢任何帮助./马格努斯

替代文字

android listview dialog button android-alertdialog

2
推荐指数
1
解决办法
5655
查看次数

如何禁用所有按钮

我有一个方法可以禁用窗口上的所有butttons.但我似乎无法获得Button类型以匹配Resource集合

我正在使用带有ac#代码隐藏的Expression Blend 3

void DisableButtons()
    {
        for(int i = 0; i>= this.Resources.Count -1; i ++)
        {
            if (this.Resources[i].GetType() == typeof(Button))
            {
                Button btn = (Button)this.Resources[i];
                btn.IsEnabled = false;
            }
        }

    }
Run Code Online (Sandbox Code Playgroud)

更新

谢谢你的回答!确定循环正在运行,但我的代码不正确. this.Resources 好像不包括我的按钮!这可能是一个混合的东西?

是的.我最终手动完成了.因为我很仓促,并没有一个简单的简单解决方案.感谢所有的输入!

c# button expression-blend

2
推荐指数
1
解决办法
7141
查看次数

Flex 4:有一种简单的方法来扩展Spark按钮吗?

我通过执行File> New> MXML外观并基于spark.components.button创建了一个有点自定义的Spark按钮.问题是我需要在按钮组件中添加一个额外的文本字段并动态更改该文本...但当然,在Spark按钮上无法识别该属性.

有没有一种简单的方法将此字段添加到我的自定义按钮皮肤及其属性,以便可以解决?如果没有,是否有一种简单的方法来完成我所做的并只是扩展Spark按钮?我似乎无法找到任何显示如何在没有在ActionScript中编写所有内容的示例.

apache-flex button extend flex-spark

2
推荐指数
1
解决办法
2037
查看次数

window.showModalDialog和回发按钮

我有两页A.aspx和B.aspx

页面A.aspx通过javascript函数window.showModalDialog("B.aspx")打开B.aspx作为模态弹出窗口;

Page B.aspx <asp:Button>在服务器代码中有两个文本框(登录,密码),控件和按钮单击事件.

问题是,当我点击提交按钮时,它会在新的第三个窗口中打开B.aspx页面

怎么可能不在提交按钮上打开新窗口.谢谢!

javascript asp.net postback button showmodaldialog

2
推荐指数
1
解决办法
7129
查看次数

c#backgroundworker不能使用我想要的代码

我的代码在引人注目的时候没有出现任何错误,只是在试图运行时得到一个.它说ThreadStateException没有被我在多个地方搜索过的用户代码所取消,我的所有代码看起来都像我知道问题是什么一样.这是不起作用的代码

 private void button1_Click(object sender, EventArgs e)
 {
      backgroundWorker1.RunWorkerAsync();
 }

 private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
 {
      FolderBrowserDialog dlg2 = new FolderBrowserDialog();
      if (dlg2.ShowDialog() == DialogResult.OK)
      //do whatever with dlg.SelectedPath
      {
           DirectoryInfo source = new DirectoryInfo(dlg.SelectedPath);
           DirectoryInfo target = new DirectoryInfo(dlg2.SelectedPath);

           DirectoryInfo dir = new DirectoryInfo(dlg.SelectedPath);
           FileInfo[] fis = dir.GetFiles("*", SearchOption.AllDirectories);
           foreach (FileInfo fi in fis)
           {
                if (fi.LastWriteTime.Date == DateTime.Today.Date)
                {
                    File.Copy(fi.FullName, target.FullName +"\\"+ fi.Name, true);
                }
           }

      }
 }
Run Code Online (Sandbox Code Playgroud)

任何帮助将不胜感激

c# copy button backgroundworker

2
推荐指数
1
解决办法
1071
查看次数

如何将背景图像设置为动态创建的按钮控件?

我正在开发windows phone 7应用程序.我是窗口手机7应用程序的新手.我在我的应用程序中有Listbox,我正在动态创建按钮控件并将它们添加到列表框控件中.现在我想为每个动态创建的按钮控件设置背景图像.我使用以下代码动态设置按钮控件的背景颜色

Button AlphabetButton = new Button();
                AlphabetButton.Background = new SolidColorBrush(Colors.Red);
Run Code Online (Sandbox Code Playgroud)

以这种方式而不是背景颜色我想为动态创建的按钮控件设置背景图像.这该怎么做 ?能否请您提供我可以解决上述问题的任何代码或链接.如果我做错了什么,请指导我.

silverlight dynamic button background-image windows-phone-7

2
推荐指数
1
解决办法
7871
查看次数

为什么facebook使用了提交按钮,而不仅仅是类似按钮的链接?

在此输入图像描述

我一直想知道为什么facebook使用像按钮提交而不只是简单的链接来执行操作,下面就像按钮代码一样.

<form rel="async" class="live_184361748268334 commentable_item autoexpand_mode" method="post" action="/ajax/ufi/modify.php" data-live="{&quot;seq&quot;:0}" onsubmit="return Event.__inlineSubmit(this,event)">
  <input name="charset_test" value="€,´,€,´,?,?,?" type="hidden">
  <input autocomplete="off" name="post_form_id" value="1ef694751d74ce24382cfa6181f1adfe" type="hidden">
  <input name="fb_dtsg" value="_19R5" autocomplete="off" type="hidden">
  <input autocomplete="off" name="feedback_params" value="{&quot;actor&quot;:&quot;514782389&quot;,&quot;target_fbid&quot;:&quot;184361748268334&quot;,&quot;target_profile_id&quot;:&quot;514782389&quot;,&quot;type_id&quot;:&quot;17&quot;,&quot;source&quot;:&quot;1&quot;,&quot;assoc_obj_id&quot;:&quot;&quot;,&quot;source_app_id&quot;:&quot;2309869772&quot;,&quot;extra_story_params&quot;:[],&quot;content_timestamp&quot;:&quot;1298066944&quot;,&quot;check_hash&quot;:&quot;e76c88ca6e20b4a0&quot;}" type="hidden">
  <div class="UIImageBlock clearfix"><i class="UIImageBlock_Image UIImageBlock_ICON_Image img sp_4b2fk0 sx_b64365"></i>
    <div class="UIImageBlock_Content UIImageBlock_ICON_Content"><span class="uiStreamSource"><a href="/aleem.sheikh/posts/184361748268334"><abbr title="Saturday, February 19, 2011 at 3:09am" data-date="Fri, 18 Feb 2011 14:09:04 -0800" class="timestamp">4 hours ago</abbr></a></span><span class="UIActionLinks UIActionLinks_bottom" data-ft="{&quot;type&quot;:&quot;action&quot;}"> ·
        <button class="like_link stat_elem as_link" title="Like this item" type="submit" name="like" onclick="fc_click(this, false); return true;"><span class="default_message">Like</span><span class="saving_message">Unlike</span></button>
        ·
        <label class="uiLinkButton …
Run Code Online (Sandbox Code Playgroud)

html forms ajax button hyperlink

2
推荐指数
1
解决办法
3306
查看次数

2行按钮值

我想做一个像这样的按钮.

按钮示例

如您所见,有2行和行的字体大小不同.这可能是使用CSS + HTML(也许是JS)?我不想使用图像作为按钮.

(字体表面无关紧要)

谢谢 ;)

html css button

2
推荐指数
2
解决办法
6858
查看次数