Questions about aspx pages and frames

S

stevag

Hello,

1) I have an .html page that hosts 2 frames, each of which hosts a
different .aspx page with C#. What I would like to do is place a
RadioButtonList control with two options on the first frame . Based on
the option that the users chooses , I want to activate different
functionality on the other frame. For instance, if choice 1 is clicked
on frame1, I want to show label1 on frame2, whereas when option 2 is
clicked on frame1 I want to show label2 on frame2. I have tried making
the RadioButtonList on frame1 public, so that its properties are
recognised by the main Page class of frame2 and work with if structures,
but it didnt work. How could I possibly handle this?


2) I have a textbox and a button. I want to activate a series of
commands to execute, whenever the button is clicked. I want my
application to read the text value from the textbox and trigger the
above mentioned series of commands. I am using the TextBox.Text property
in the handler of Button_Click, but eventhough I write a value in the
box when app runs, there is no response when the button is hit. What
can be wrong?


3) Also , what do I have to be careful of concerning postback
behaviour when working with controls in an aspx page? In my application,
the activation of some events, such as pushing one button, activates
some other unexpected functionality of associated controls, such as
making a textbox not visible, eventhough I havent explicitly made it
invisible in the C# code. Any ideas?



Thank you very much in advance for the ideas and help.



stevag
 
W

Wessel Troost

1) I have an .html page that hosts 2 frames, each of which hosts a
different .aspx page with C#. What I would like to do is place a
RadioButtonList control with two options on the first frame . Based on
the option that the users chooses , I want to activate different
functionality on the other frame. For instance, if choice 1 is clicked
on frame1, I want to show label1 on frame2, whereas when option 2 is
clicked on frame1 I want to show label2 on frame2. I have tried making
the RadioButtonList on frame1 public, so that its properties are
recognised by the main Page class of frame2 and work with if structures,
but it didnt work. How could I possibly handle this?
The Page object lives only long enough to serve the request. There's no
guarantuee it will exist when the other frame is loaded. You'd have to
share information with the other Page using one of the many data stores
avaiable, for example, the Session object.

To force a refresh on the other page, you'd have to ressort to client-side
scripting.
2) I have a textbox and a button. I want to activate a series of
commands to execute, whenever the button is clicked. I want my
application to read the text value from the textbox and trigger the
above mentioned series of commands. I am using the TextBox.Text property
in the handler of Button_Click, but eventhough I write a value in the
box when app runs, there is no response when the button is hit. What
can be wrong?
Check these things:
- Is the viewstate enabled at the Page level?
- Is the viewstate enabled for the button?
- Is the button event wired to your handler?
3) Also , what do I have to be careful of concerning postback
behaviour when working with controls in an aspx page? In my application,
the activation of some events, such as pushing one button, activates
some other unexpected functionality of associated controls, such as
making a textbox not visible, eventhough I havent explicitly made it
invisible in the C# code. Any ideas?
That doesn't sound problematic. Perhaps you can explain in greater detail
what you are concerned about?

Greetings,
Wessel
 
S

stevag

Wessel said:
The Page object lives only long enough to serve the request. There's
no guarantuee it will exist when the other frame is loaded. You'd have
to share information with the other Page using one of the many data
stores avaiable, for example, the Session object.

To force a refresh on the other page, you'd have to ressort to
client-side scripting.

Check these things:
- Is the viewstate enabled at the Page level?
- Is the viewstate enabled for the button?
- Is the button event wired to your handler?

How do I enable viewstate property at Page and button level?
 
W

Wessel Troost

How do I enable viewstate property at Page and button level?If you are using Visual Studio:
- select the page by clicking on whitespace, or the button by clicking on
the button
- right-click and choose properties
- make sure EnableViewState is set to true

Greetings,
Wessel
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top