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 ) ?
textarea does not added directly to aspx page. it is is dynamically added through jquery so????
in 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;
Try
Request.Form["txtImagename1"]
No need of runat="server"
Also, add name="txtImagename1"
<textarea id="txtImagename1" name="txtImagename1" rows="1" cols="50"></textarea>
Add name
attribute to the Dynamic control :
<textarea id="txtImagename1" name="txtImagename1" runat="server" rows="1" cols="50">
</textarea>
from your codebehind :
Request.Form["txtImagename1"]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With