zoukankan      html  css  js  c++  java
  • 技術問題

    如何取得GridView中的HyperLinkField 的Text 

     HyperLink href = (HyperLink)row.Cells[0].Controls[0];
                string text = href.Text;

    怎样在UpdatePanel里使用FileUpload控件
    HTML:
        <div>
            
    <atlas:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true">
            
    </atlas:ScriptManager>
            
    <atlas:UpdatePanel ID="UpdatePanel1" runat="server">
                
    <ContentTemplate>
                    
    <asp:FileUpload ID="FileUpload1" runat="server" /><asp:Button ID="cmdButton1" runat="server"
                        Text
    ="Upload" /><asp:Label ID="Label1" runat="server" Text=""></asp:Label>
                
    </ContentTemplate>
            
    </atlas:UpdatePanel>
       
            
    <asp:Button ID="cmdButton2" OnClick="cmdButton2_click"  runat="server" Text="Full post back" /> 
            
    </div>

    CODE BEHIND:
        Protected Sub Page_Load(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.Load

            
    Me.cmdButton1.Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(Me.cmdButton2, ""))

        
    End Sub


        
    Protected Sub cmdButton2_Click(ByVal sender As ObjectByVal e As System.EventArgs)
            
    If Me.FileUpload1.HasFile Then
                System.Threading.Thread.Sleep(
    1000)
                
    Me.Label1.Text = Me.FileUpload1.FileName
            
    End If
        
    End Sub

  • 相关阅读:
    Windows10下Opencv4+CMake+MinGW64+VSC安装教程
    相机标定问题-实践操作流程
    eNSP仿真学习,网络入门!
    SFTP服务的使用!!
    树莓派B+使用入门&RPI库安装&wringPi库安装
    Python基本语法初试
    基于51单片机+DAC0832的信号发生器
    各种标志位的含义
    根文件系统ramdisk.image.gz && uramdisk.image.gz
    Linux中/etc/inittab文件
  • 原文地址:https://www.cnblogs.com/jacker1979/p/1090053.html
Copyright © 2011-2022 走看看