This is a migrated thread and some comments may be shown as answers.

File Download Control Issue in Edit Popup

4 Answers 74 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
John John
Top achievements
Rank 1
John John asked on 13 May 2011, 06:14 PM
Hi
I am using file download control in my Edit Popup as given below;
<input type="file" id="file1" runat="server" name="file1" />

But when i try to  get the value from the control i am getting null value though i selected the desired file i want to download.
string fileName = (e.Item.FindControl("file1") as HtmlInputFile).PostedFile.FileName;

I am also not able to empty validation with traditional asp.net required field validator. But in normal form it works fine as desired.
So please let me know how to get and validate the value from filedownload control as soon as possible

-thanks

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 16 May 2011, 07:15 AM
Hello John,

I am not quite sure about the event that you are trying to access the control. If you want to access the control in edit mode access the control like this.
C#:
protected void RadGrid1_ItemDataBound1(object sender, GridItemEventArgs e)
  {
    if (e.Item is GridEditFormItem && e.Item.IsInEditMode)
    {
        GridEditFormItem edititem = (GridEditFormItem)e.Item;
        string fileName = (e.Item.FindControl("file1") ;
  }

Thanks,
Shinu.
0
John John
Top achievements
Rank 1
answered on 16 May 2011, 10:03 AM
Hi Shinu,

I already used the same way (ItemDataBound Event)  to get the value from that control. Though I could easily find the control through FindControl method, but i am not able to get the value from the variable, it shows null value..

Please kindly look into this strange issue

-Thanks
0
John John
Top achievements
Rank 1
answered on 16 May 2011, 01:29 PM
Hi,

I am looking for suggestions from you. I would be more happy if i am domonstrated with an small running exmaple.
I am using EditPopup customized the formtemplate with the input fields like textboxes,labels,buttons)
I am also looking for functioning required fileld validator for the same control

-Thanx
0
John John
Top achievements
Rank 1
answered on 17 May 2011, 01:17 PM
Hi,
I am awaiting for suggestions at the earliest

-Thanks

Tags
ComboBox
Asked by
John John
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
John John
Top achievements
Rank 1
Share this question
or