Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. file upload in gv in asp.net

file upload in gv in asp.net

Scheduled Pinned Locked Moved ASP.NET
csharpjavascriptasp-netsysadmintools
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    diyaa_08
    wrote on last edited by
    #1

    sallam 2 all; tat is my code <asp:Button ID="btnCaseDetailsAttach" runat="server" Text="Attach" CssClass="ButtonBlackCss" OnClientClick="return triggerFileUpload();" onclick="btnCaseDetailsAttach_Click" /> <asp:Button ID="btnCaseDetailsDetachFile" runat="server" Text="Detach File" CssClass="ButtonBlackCss" onclick="btnCaseDetailsAttach_Click"/> <asp:HiddenField id="pathpicker" runat="server" /> <input type="file" id="File1" style="visibility:hidden;" onchange="LoadPath();" /> <asp:Label ID="lblSendMail" runat="server"></asp:Label> <asp:GridView ID="gvCaseDetailsWebFileName" runat="server" CssClass="hor-minimalist-c" Enabled="false"> </asp:GridView> <script type="text/javascript"language="javascript"> function triggerFileUpload() { document.getElementById("File1").click(); } function LoadPath() { var a=document.getElementById("File1").value; alert(a); document.getElementById("<%=pathpicker.ClientID%>").value=a; alert(document.getElementById("<%=pathpicker.ClientID%>").value); return true; } </script> on attach btn gvCaseDetailsWebFileName.DataSource = null; gvCaseDetailsWebFileName.Visible = false; string value = pathpicker.Value; objCaseGeneration.FilePath(value.ToString()); gvCaseDetailsWebFileName.DataSource = objCaseGeneration.dsMissingDateOfServices.Tables["CaseGeneration"]; gvCaseDetailsWebFileName.DataBind(); gvCaseDetailsWebFileName.Visible = true; tis code only browses files bt not works and not places file name in gridview n tis browses in internet xplorer not in mozilla y?

    L A 2 Replies Last reply
    0
    • D diyaa_08

      sallam 2 all; tat is my code <asp:Button ID="btnCaseDetailsAttach" runat="server" Text="Attach" CssClass="ButtonBlackCss" OnClientClick="return triggerFileUpload();" onclick="btnCaseDetailsAttach_Click" /> <asp:Button ID="btnCaseDetailsDetachFile" runat="server" Text="Detach File" CssClass="ButtonBlackCss" onclick="btnCaseDetailsAttach_Click"/> <asp:HiddenField id="pathpicker" runat="server" /> <input type="file" id="File1" style="visibility:hidden;" onchange="LoadPath();" /> <asp:Label ID="lblSendMail" runat="server"></asp:Label> <asp:GridView ID="gvCaseDetailsWebFileName" runat="server" CssClass="hor-minimalist-c" Enabled="false"> </asp:GridView> <script type="text/javascript"language="javascript"> function triggerFileUpload() { document.getElementById("File1").click(); } function LoadPath() { var a=document.getElementById("File1").value; alert(a); document.getElementById("<%=pathpicker.ClientID%>").value=a; alert(document.getElementById("<%=pathpicker.ClientID%>").value); return true; } </script> on attach btn gvCaseDetailsWebFileName.DataSource = null; gvCaseDetailsWebFileName.Visible = false; string value = pathpicker.Value; objCaseGeneration.FilePath(value.ToString()); gvCaseDetailsWebFileName.DataSource = objCaseGeneration.dsMissingDateOfServices.Tables["CaseGeneration"]; gvCaseDetailsWebFileName.DataBind(); gvCaseDetailsWebFileName.Visible = true; tis code only browses files bt not works and not places file name in gridview n tis browses in internet xplorer not in mozilla y?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      I think there is some problem in your javascript, that is why it is not showing browse in internet explorer not in mozilla. You need to check the error console of mozilla to track what is the problem Just go to Tools>Error Console in mozilla or press Ctrl+Shift+J. And the grid is also not binding because of the same problem. HTH

      Jinal Desai - LIVE Experience is mother of sage....

      D 1 Reply Last reply
      0
      • L Lost User

        I think there is some problem in your javascript, that is why it is not showing browse in internet explorer not in mozilla. You need to check the error console of mozilla to track what is the problem Just go to Tools>Error Console in mozilla or press Ctrl+Shift+J. And the grid is also not binding because of the same problem. HTH

        Jinal Desai - LIVE Experience is mother of sage....

        D Offline
        D Offline
        diyaa_08
        wrote on last edited by
        #3

        te error is on tis line of code document.getElementById bt what should be tere i hav no idea

        R 1 Reply Last reply
        0
        • D diyaa_08

          te error is on tis line of code document.getElementById bt what should be tere i hav no idea

          R Offline
          R Offline
          raju melveetilpurayil
          wrote on last edited by
          #4

          inputFile.click() not support for Mozilla. Check this Link[^]

          Raju.M

          1 Reply Last reply
          0
          • D diyaa_08

            sallam 2 all; tat is my code <asp:Button ID="btnCaseDetailsAttach" runat="server" Text="Attach" CssClass="ButtonBlackCss" OnClientClick="return triggerFileUpload();" onclick="btnCaseDetailsAttach_Click" /> <asp:Button ID="btnCaseDetailsDetachFile" runat="server" Text="Detach File" CssClass="ButtonBlackCss" onclick="btnCaseDetailsAttach_Click"/> <asp:HiddenField id="pathpicker" runat="server" /> <input type="file" id="File1" style="visibility:hidden;" onchange="LoadPath();" /> <asp:Label ID="lblSendMail" runat="server"></asp:Label> <asp:GridView ID="gvCaseDetailsWebFileName" runat="server" CssClass="hor-minimalist-c" Enabled="false"> </asp:GridView> <script type="text/javascript"language="javascript"> function triggerFileUpload() { document.getElementById("File1").click(); } function LoadPath() { var a=document.getElementById("File1").value; alert(a); document.getElementById("<%=pathpicker.ClientID%>").value=a; alert(document.getElementById("<%=pathpicker.ClientID%>").value); return true; } </script> on attach btn gvCaseDetailsWebFileName.DataSource = null; gvCaseDetailsWebFileName.Visible = false; string value = pathpicker.Value; objCaseGeneration.FilePath(value.ToString()); gvCaseDetailsWebFileName.DataSource = objCaseGeneration.dsMissingDateOfServices.Tables["CaseGeneration"]; gvCaseDetailsWebFileName.DataBind(); gvCaseDetailsWebFileName.Visible = true; tis code only browses files bt not works and not places file name in gridview n tis browses in internet xplorer not in mozilla y?

            A Offline
            A Offline
            Ankur m
            wrote on last edited by
            #5

            Use PRE tags (Code Block) to format your code. It would be more readable. And you can surely expect more answers. :thumbsup:

            ..Go Green..

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups