Solved

implement file upload control as gmail in asp.net

Posted on 2011-03-12
8
778 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
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
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 …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

732 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