Solved

implement file upload control as gmail in asp.net

Posted on 2011-03-12
8
773 Views
Last Modified: 2013-11-11
HI
I have  2 user controls
uc1.ascx--contains  Textbox, submit, Cancel buttons
uc2.ascx--contains Textbox,file Upload control, Submit,Cancel buttons

I have to uc1.ascx into default.aspx
in default.aspx When i click 'Submit' button it should open uc2.ascx as Popup using JQuery dialog

In the Popup first time 'Submit' button should be disabled as the user enters text into the textbox
the button is enabled.
using FileUpload control attaches files once attached the attached file name, a Remove button should appear below the fileUpload Control. Where 'Remove' is to remove the file.
If user clicks on the name of file name it should open in a separate window.

Here user can attach only 10 files.  Try to use JQuery dialog,usercontrol or any other way
0
Comment
Question by:praveen7k
  • 3
  • 3
  • 2
8 Comments
 
LVL 10

Expert Comment

by:gavsmith
ID: 35115815
Could you post your code for default.aspx?
0
 

Author Comment

by:praveen7k
ID: 35116201
there is some other code....in that page

there is a dropdown list, 2 link buttons to transfer to other pages
0
 

Author Comment

by:praveen7k
ID: 35116773
anyway open a popup from a user control and add the functionality as explained above
0
Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

 
LVL 10

Accepted Solution

by:
gavsmith earned 500 total points
ID: 35121154
It might be possible but I think you will struggle with the control names. UC1 will not know what UC2 is called unless UC2 is part of UC1 (which may well make the UC pointless). Or you could place the code in Default.aspx if you make the UC's buttons public so default.aspx could access them like the following:

$("#<%= uc2.container.ClientID %>").dialog({autoOpen:false});
$("#<%= uc1.button1.CientID %>").click(funcion() { 
      $("#<%= uc2.submitButton.ClientID %>")").attr('disabled', 'disabled');
      $("#<%= uc2.container.ClientID %>").dialog("open");
});

Open in new window


Something similar to that anyway... container would have to be a div wrapping everything in UC2 which has runat="server" tag.
0
 

Author Comment

by:praveen7k
ID: 35122855
Thanks, could you explain me in detail
and which is the best way to acheive this
0
 
LVL 10

Expert Comment

by:gavsmith
ID: 35127058
Explanation:

In jQuery you need to use client ID selectors to reference your elements.

.NET often renames your server controls when being rendered i.e if you are using masterpages your text box called textBox1, when rendered, has a client ID of 'ContentPlaceHolder1_textBox1'. It would also give it a name of 'ctl00$ContentPlaceHolder1$textBox1'.

Because of this to reference a server contol in script you are best to use the ClientID property of the server control, this must be done 'server side'.

You could create the script in code behind and use the RegisterClientScript method or do what I suggested above.

Best way to acheive this:

I can't really suggest a 'best way' as I don't know your full project design i.e. you might use your UC's in multiple other places for all I know, so getting your UC to register a clientscript may beak lots of other pages.
0
 
LVL 5

Expert Comment

by:vivekpv10
ID: 35127284
0
 
LVL 5

Expert Comment

by:vivekpv10
ID: 35127298
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VB.NET 2008 Winforms Signing 13 33
ASP.NET Content Page 3 35
Need help converting bitmap to image in VB.Net 8 32
How to filter by key press ? 6 25
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question