[RESOLVED] Get Div tag innerhtml which is changed on client side
In Aspx
Code:
<div id="Text1" runat=server ></div>
$('#<%= Text1.ClientID %>').html('someText');
In VB
Code:
Protected Sub BtnInboxReply_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnInboxReply.Click
Response.Write(Text1.InnerHtml.Length)
End Sub
I can't get Text1.InnerHtml or Text1.InnerText on server side. When it's changed in client side.
Can someone help me to get text1's text on button click?
Re: Get Div tag innerhtml which is changed on client side
I dont understand your problem. How can someone change the text within a div client side?
Try telling us what you are trying to do in more general terms and someone may help you
Re: Get Div tag innerhtml which is changed on client side
Hey,
Changing the DIV's innerHtml on the client side, is quite simple, in fact, the code that is listed shows exactly how to do that.
The problem here is that even though the DIV has been set to "runat=server", the client side change hasn't made it into the ViewState of the page, and as a result, isn't available on the Post Back to the server.
Does this client side change have to be visible to the end user? You could use a hidden input field on the client, which would allow you to pass the value back to the server.
Gary
Re: Get Div tag innerhtml which is changed on client side
well Well well. Again you garry. Thank you so much. Recently your becoming my idol. :)
HiddenField solved the issue.
Re: Get Div tag innerhtml which is changed on client side
Quote:
Originally Posted by
n3xus
well Well well. Again you garry. Thank you so much. Recently your becoming my idol. :)
HiddenField solved the issue.
Ha ha, I am not sure what to say :blush: