Solved

implement file upload control as gmail in asp.net

Posted on 2011-03-12
8
764 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
 
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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now