Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

implement file upload control as gmail in asp.net

Posted on 2011-03-12
8
Medium Priority
?
792 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 10

Accepted Solution

by:
gavsmith earned 2000 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

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

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.…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

636 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