Click here to Skip to main content
15,884,176 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
i am creating one form for image upload drag and drop through jquery.

when i dragged one image to aspx form, that time that image
preview and title ( textarea ) and desc ( textarea ) created to aspx page.

after entered the title and desc,
it is saved to database when i click save button.

i couldn't get the textarea control in c# (code behind ) ?

------------------------------------------------------------------------------------------
jquery textarea added

'
' +
'<textarea id="txtImagename1" runat="server" rows="1" cols="50"></textarea>' +
'
' +
------------------------------------------------------------------------------------------

code behind


HtmlTextArea txtImageupload = (HtmlTextArea)(frm.FindControl("txtImagename1"));

string imagename = txtImageupload.Value;
Posted
Comments
Prasad Khandekar 30-Apr-13 6:06am    
If you are adding a textarea on client side using Jqury then in code behind you won't get it's reference as it will not exists. Client side addition does not triggers the server side control addition‡. Retrieve the value using Request.

Regards,

1 solution

XML
Request.Form["txtImagename1"]
No need of runat="server"

Also, add name="txtImagename1"

<textarea id="txtImagename1" name="txtImagename1" rows="1" cols="50"></textarea>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900