Postback failing in 1 control

Discussion in 'ASP .Net' started by CJ Taylor, Aug 26, 2003.

  1. CJ Taylor

    CJ Taylor Guest

    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 Taylor, Aug 26, 2003
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    > 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
    >
    >
     
    Kevin Spencer, Aug 26, 2003
    #2
    1. Advertising

  3. CJ Taylor

    CJ Taylor Guest

    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" <> wrote in message
    news:...
    > 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" <> wrote in message
    > news:...
    > > 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 Taylor, Aug 26, 2003
    #3
  4. 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" <> wrote in message
    news:...
    > 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" <> wrote in message
    > news:...
    > > 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" <> wrote in message
    > > news:...
    > > > 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
    > > >
    > > >

    > >
    > >

    >
    >
     
    Kevin Spencer, Aug 26, 2003
    #4
  5. CJ Taylor

    CJ Taylor Guest

    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" <> wrote in message
    news:#utGQx#...
    > 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" <> wrote in message
    > news:...
    > > 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" <> wrote in message
    > > news:...
    > > > 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" <> wrote in message
    > > > news:...
    > > > > 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 Taylor, Aug 27, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Psych971
    Replies:
    5
    Views:
    4,620
    bruce barker
    Dec 17, 2004
  2. =?Utf-8?B?Q2hhZA==?=

    Postback not being set to True on first postback

    =?Utf-8?B?Q2hhZA==?=, Apr 4, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    502
    =?Utf-8?B?Q2hhZA==?=
    Apr 4, 2005
  3. gce
    Replies:
    2
    Views:
    1,715
  4. Mantorok
    Replies:
    2
    Views:
    1,380
    Mantorok
    Jun 22, 2006
  5. gnewsgroup
    Replies:
    1
    Views:
    390
    gnewsgroup
    Feb 13, 2008
Loading...

Share This Page