retrieving attribute of textbox using page.request

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ton

    retrieving attribute of textbox using page.request

    Hi,

    I'm using Ajax (AjaxPro) this works fine. (In vb.net)

    To get update several controls I connect the server and these controls are
    updated.
    When saving these values I use aa=page.request ("TextboxID" ) which gives me
    the modified Text property

    in case of a combobox i get with this method the selectedkey value. Great !!
    Now my problem:

    I also use in a certain textbox a attribute "key" which is set in my
    javascript. I know it is there, but I have no idea how to get it.
    I know there is a workaround via using a hidden textfield, but that is not
    the solution I want to have.

    please help

    Thanks


    Ton


  • Hans Kesting

    #2
    Re: retrieving attribute of textbox using page.request

    on 19-8-2008, ton supposed :
    Hi,
    >
    I'm using Ajax (AjaxPro) this works fine. (In vb.net)
    >
    To get update several controls I connect the server and these controls are
    updated.
    When saving these values I use aa=page.request ("TextboxID" ) which gives me
    the modified Text property
    >
    in case of a combobox i get with this method the selectedkey value. Great !!
    Now my problem:
    >
    I also use in a certain textbox a attribute "key" which is set in my
    javascript. I know it is there, but I have no idea how to get it.
    I know there is a workaround via using a hidden textfield, but that is not
    the solution I want to have.
    >
    please help
    >
    Thanks
    >
    >
    Ton
    That's about the only option you have (unless you want to write to
    cookies from javascript).

    For the browser an aspx page is just a plain html form. A POST will
    only send the values of the various input controls, not any other
    attributes that you may have set.

    Why don't you want a hidden input?


    Hans Kesting


    Comment

    • Mark Rae [MVP]

      #3
      Re: retrieving attribute of textbox using page.request

      "ton" <ton@nospam.nlw rote in message
      news:b6302$48aa b7cd$541ef063$2 8812@cache2.til bu1.nb.home.nl. ..
      When saving these values I use aa=page.request ("TextboxID" ) which gives
      me the modified Text property
      This is very much ASP Classic syntax. Webcontrols like asp:TextBox are
      persisted across a postback via ViewState. You should consider using aa =
      TextBoxID.Text instead...
      I know there is a workaround via using a hidden textfield, but that is not
      the solution I want to have.
      Why not? Hidden fields were created precisely for this sort of
      functionality.. .


      --
      Mark Rae
      ASP.NET MVP


      Comment

      • ton

        #4
        Re: retrieving attribute of textbox using page.request

        ok I'm convinced
        "Mark Rae [MVP]" <mark@markNOSPA Mrae.netschreef in bericht
        news:OvkHzggAJH A.3756@TK2MSFTN GP03.phx.gbl...
        "ton" <ton@nospam.nlw rote in message
        news:b6302$48aa b7cd$541ef063$2 8812@cache2.til bu1.nb.home.nl. ..
        >
        >When saving these values I use aa=page.request ("TextboxID" ) which gives
        >me the modified Text property
        >
        This is very much ASP Classic syntax. Webcontrols like asp:TextBox are
        persisted across a postback via ViewState. You should consider using aa =
        TextBoxID.Text instead...
        >
        >I know there is a workaround via using a hidden textfield, but that is
        >not the solution I want to have.
        >
        Why not? Hidden fields were created precisely for this sort of
        functionality.. .
        >
        >
        --
        Mark Rae
        ASP.NET MVP
        http://www.markrae.net

        Comment

        • ton

          #5
          Re: retrieving attribute of textbox using page.request

          ok I'm convinced
          "Hans Kesting" <news.hansdk@sp amgourmet.comsc hreef in bericht
          news:%23V2baYgA JHA.4256@TK2MSF TNGP05.phx.gbl. ..
          on 19-8-2008, ton supposed :
          >Hi,
          >>
          >I'm using Ajax (AjaxPro) this works fine. (In vb.net)
          >>
          >To get update several controls I connect the server and these controls
          >are updated.
          >When saving these values I use aa=page.request ("TextboxID" ) which gives
          >me the modified Text property
          >>
          >in case of a combobox i get with this method the selectedkey value. Great
          >!!
          >Now my problem:
          >>
          >I also use in a certain textbox a attribute "key" which is set in my
          >javascript. I know it is there, but I have no idea how to get it.
          >I know there is a workaround via using a hidden textfield, but that is
          >not the solution I want to have.
          >>
          >please help
          >>
          >Thanks
          >>
          >>
          >Ton
          >
          That's about the only option you have (unless you want to write to cookies
          from javascript).
          >
          For the browser an aspx page is just a plain html form. A POST will only
          send the values of the various input controls, not any other attributes
          that you may have set.
          >
          Why don't you want a hidden input?
          >
          >
          Hans Kesting
          >
          >

          Comment

          Working...