Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. WebCustomControl

WebCustomControl

Scheduled Pinned Locked Moved ASP.NET
toolsquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Hemant Mane
    wrote on last edited by
    #1

    Hi, I have create a webcostom control for TextBox and add one property "Xyz". [Bindable(true)] [Category("Appearance")] [DefaultValue("")] [Localizable(true)] public string Xyz { get { String s = (String)ViewState["Xyz"]; return ((s == null) ? String.Empty : s); } set { ViewState["Xyz"] = value; } } and i have set the value for Xyz from client script like function setvalue() { form1.txt.Xyz = "Some Text"; } on postback i want the value which is set from clientscript but the value is not set. Is there another way to set the value from clientscript and get it at serverside?

    A 1 Reply Last reply
    0
    • H Hemant Mane

      Hi, I have create a webcostom control for TextBox and add one property "Xyz". [Bindable(true)] [Category("Appearance")] [DefaultValue("")] [Localizable(true)] public string Xyz { get { String s = (String)ViewState["Xyz"]; return ((s == null) ? String.Empty : s); } set { ViewState["Xyz"] = value; } } and i have set the value for Xyz from client script like function setvalue() { form1.txt.Xyz = "Some Text"; } on postback i want the value which is set from clientscript but the value is not set. Is there another way to set the value from clientscript and get it at serverside?

      A Offline
      A Offline
      Amit Kumar Chikara
      wrote on last edited by
      #2

      You don't have to add one more property 'Xyz' for that. You can use Text property of the textbox. Like on the client side you can set the value like this. function setvalue() { form1.TextBox1.value = "Some Text"; } and On the server side, you can get this value like this: string strGetValue = this.TextBox1.Text;

      Amit Kumar HDISM, PGDCA, MCP, MCAD, MCSD

      H 1 Reply Last reply
      0
      • A Amit Kumar Chikara

        You don't have to add one more property 'Xyz' for that. You can use Text property of the textbox. Like on the client side you can set the value like this. function setvalue() { form1.TextBox1.value = "Some Text"; } and On the server side, you can get this value like this: string strGetValue = this.TextBox1.Text;

        Amit Kumar HDISM, PGDCA, MCP, MCAD, MCSD

        H Offline
        H Offline
        Hemant Mane
        wrote on last edited by
        #3

        Hi Amit, thanx for reply. I know i can use the text property but for some reseason there is another property which i want to set from clientside and get it in serverside. its like i am adding custome attribute to a control and setting the values. its not related to the text but i am setting another value. I am doing some operation in client side after that i am setting one value for xyz and accessing that value from serverside. do you know any other way to do it? Hemant Mane.

        A 1 Reply Last reply
        0
        • H Hemant Mane

          Hi Amit, thanx for reply. I know i can use the text property but for some reseason there is another property which i want to set from clientside and get it in serverside. its like i am adding custome attribute to a control and setting the values. its not related to the text but i am setting another value. I am doing some operation in client side after that i am setting one value for xyz and accessing that value from serverside. do you know any other way to do it? Hemant Mane.

          A Offline
          A Offline
          Amit Kumar Chikara
          wrote on last edited by
          #4

          Hi Hemant, You can use Hidden Field also to set some value on client side and can access these values on server side easily. Since I don't know what exactly you want to do, I am unable to tell you the exact solution. The other way to proceed is you can mail me directly or can chat with me right now. my Chat IDs are : amit_chikara2002@hotmail.com and amit_chikara2002@yahoo.com

          Regards, Amit Kumar HDISM, PGDCA, MCP, MCAD, MCSD amit_chikara2002@hotmail.com

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups