Results 1 to 5 of 5

Thread: [RESOLVED] Get Div tag innerhtml which is changed on client side

  1. #1

    Thread Starter
    Lively Member n3xus's Avatar
    Join Date
    Feb 2007
    Location
    c:\Programme files\
    Posts
    98

    Resolved [RESOLVED] Get Div tag innerhtml which is changed on client side

    In Aspx
    Code:
    <div id="Text1" runat=server ></div>
    $('#<&#37;= 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?

  2. #2
    Fanatic Member davebat's Avatar
    Join Date
    Dec 2002
    Posts
    727

    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

  3. #3
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    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

  4. #4

    Thread Starter
    Lively Member n3xus's Avatar
    Join Date
    Feb 2007
    Location
    c:\Programme files\
    Posts
    98

    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.

  5. #5
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Get Div tag innerhtml which is changed on client side

    Quote Originally Posted by n3xus View Post
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width