jquery - Pass additional information back through postback -
jquery - Pass additional information back through postback -
i having problem using jquery asp.net. have html img
, asp:button
, asp:fileupload
.
<img src="images/12345.png" data-id="12345" /> <asp:fileupload id="fup" runat="server" /> <asp:button id="btn" runat="server" />
i trying pass image id html img
. thought of how force info element commandargument
or something?
i can't have html image runat="server", because setting dynamically client-side.
plugins
i tried using plugins, nil working out way had planned:
this 1 takes multiple files, need limited one. don't need back upwards dragging or fancy. http://valums.com/ajax-upload/
uploadify uses flash, trying shy away that. http://www.uploadify.com/
this 1 uses ugly iframes , stuff, not looking nice. also, spelling mistakes on site little off-putting. http://www.phpletter.com/demo/ajaxfileupload-demo/
if has either way i'm asking or slick way upload new images (with additional parameters supported), appreciated.
solution answers, ended combining 2 , using asp:hiddenfield
running @ server:
markup:
<img id="img" src="images/12345.png" data-id="12345" /> <asp:hiddenfield id="hfdata" runat="server" /> <asp:fileupload id="fup" runat="server" /> <asp:button id="btn" runat="server" />
jquery:
$("#<%= hfdata.clientid %>").val($("#img").data("id"));
codebehind:
string pictureid = hfdata.value;
if understand correctly, can utilize <input type="hidden" name="data-id" value="12345" />
data-id
looking for.
jquery asp.net postback image-uploading
Comments
Post a Comment