Professional Web Applications Themes

Postback failing in 1 control - ASP.NET General

Hey all, I have a ASP.NET application running on Rainbow Portal, (the forums ahve been kinda useless). Anyways, I have a single control that for some reason whenever I hit the calculate button in it (a simple link button) it will go to the event procedure, call the proper method and then when I try to access a field in the web control it comes up with nothing. Like the field is suddenly gone. For example, txt_Markup is a text field, its a server control, but when I postback, there is no value. So I checked the variables posted from ...

  1. #1

    Default Postback failing in 1 control

    Hey all,

    I have a ASP.NET application running on Rainbow Portal, (the forums ahve
    been kinda useless).

    Anyways, I have a single control that for some reason whenever I hit the
    calculate button in it (a simple link button) it will go to the event
    procedure, call the proper method and then when I try to access a field in
    the web control it comes up with nothing. Like the field is suddenly gone.

    For example, txt_Markup is a text field, its a server control, but when I
    postback, there is no value. So I checked the variables posted from the
    form, not there either.

    This is only happening in a single form... wondering if someone could lead
    me in the right direction on where to look.

    Thanks,
    CJ


    CJ Guest

  2. #2

    Default Re: Postback failing in 1 control

    Can you explain what you mean by "there is no value" - how are you
    determining this? Also, what do you mean by a "field in the web control?"
    Define what you mean by "field" and "web control".

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    http://www.takempis.com
    The more I learn, the less I know.

    "CJ Taylor" <com> wrote in message
    news:phx.gbl... 
    gone. 


    Kevin Guest

  3. #3

    Default Re: Postback failing in 1 control

    Alright I drop a textbox object into the web control. (User Web Control,
    inherited from Rainbow.PortalModuleControl or something).

    So this should maintain viewstate. that being, if I enter a value into the
    textbox control, it should maintain viewstate on a postback (given I'm doing
    no databinding).

    However, when the postback event occurs, I should be able to reference it
    with "this.txt_Markup.text" to get the text value from the postback as I do
    with all my other forms.

    Nope.

    So if I enter text in this box, and hit my link button, which fires an event
    called lnk_Calculate.Click which is handled by lnk_Calculate_Click, it works
    until I try to retreive that value. And with that, it comes up with
    nothing. so if I do a response.write(this.txt_Markup.Text), it shows
    nothing.

    Hope that helps.

    CJ
    "Kevin Spencer" <com> wrote in message
    news:phx.gbl... [/ref]
    in 
    > gone. [/ref]
    I [/ref]
    lead 
    >
    >[/ref]


    CJ Guest

  4. #4

    Default Re: Postback failing in 1 control

    It's still kind of hard to follow you, but it sounds like when you say you
    "drop a textbox object into the web control" you mean that you are adding a
    textbox to the control's Controls Collection. If that's the case, you would
    have to find the control using the parent Control's FindControl() method.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    http://www.takempis.com
    The more I learn, the less I know.

    "CJ Taylor" <com> wrote in message
    news:phx.gbl... 
    the 
    doing 
    do 
    event 
    works [/ref]
    control?" [/ref][/ref]
    ahve [/ref][/ref]
    the [/ref][/ref]
    field 
    > > gone. [/ref][/ref]
    when [/ref][/ref]
    the [/ref]
    > lead 
    > >
    > >[/ref]
    >
    >[/ref]


    Kevin Guest

  5. #5

    Default Re: Postback failing in 1 control

    Sorta...

    Think about when you drop a textbox control into a web page... you create an
    reference in the codebehind...

    you can access the reference on postbacks/pageloads by calling it by its
    referenced name and pull the value out... well, for some reason, on every
    post back, whether or not htere is a value, it always comes up blank (or
    String.empty thatis).


    "Kevin Spencer" <com> wrote in message
    news:#utGQx#phx.gbl... 

    would 
    > the 
    > doing [/ref]
    it 
    > do 
    > event 
    > works [/ref]
    > control?" [/ref]
    > ahve [/ref]
    > the [/ref][/ref]
    event [/ref]
    > field [/ref][/ref]
    suddenly [/ref]
    > when [/ref]
    > the [/ref][/ref]
    could 
    > >
    > >[/ref]
    >
    >[/ref]


    CJ Guest

Similar Threads

  1. control id and name for postback mechanism
    By Martin in forum ASP.NET Building Controls
    Replies: 1
    Last Post: August 20th, 08:55 AM
  2. why does my control retain its value after postback
    By TS in forum ASP.NET Building Controls
    Replies: 1
    Last Post: August 3rd, 02:26 AM
  3. help with postback-less calendar control.
    By Ramakant in forum ASP.NET Building Controls
    Replies: 4
    Last Post: May 19th, 06:50 AM
  4. Did my control caused the postback
    By Teemu Keiski in forum ASP.NET Building Controls
    Replies: 6
    Last Post: September 4th, 10:06 PM
  5. Which control had focus before postback?
    By Marco Liedekerken in forum ASP.NET General
    Replies: 2
    Last Post: July 1st, 04:43 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139