Postback failing in 1 control

  • Thread starter Thread starter CJ Taylor
  • Start date Start date
C

CJ Taylor

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
 
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.
 
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
 
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.
 
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).
 
Back
Top