Changing web control content without page postback

Changing web control content without page postback

Post by Joao Ma » Sat, 15 Feb 2003 20:45:57



Hi there,

I'm a newbie to ASP.NET development, so forgive me if my question
seems basic. I was wondering if there's any way of changing the
content of a web control, say for example a panel or a datagrid, in
response to a client action WITHOUT doing a full page postback.

For example, imagine I have a button and a panel with some text in it.
When the user clicks the button, I want to go to the server to fetch
some data and fill in the panel with that data, but I don't want to
load the whole page, just the specific web control I want to change
(in this case, the panel).

Another classic example of this behaviour is the two combo box
example, where you load the second one based upon what the user
selects in the first one.

Is there any easy way to do this in ASP.NET or do I have to rely on
writing my own client-side javascript to do this ?

Any help, tips or information you can give me on this will be greatly
appreciated.

Cheers,

Joao Maia

 
 
 

Changing web control content without page postback

Post by Kim Bach Peterse » Sat, 15 Feb 2003 22:33:40


Quote:> For example, imagine I have a button and a panel with some text in it.
> When the user clicks the button, I want to go to the server to fetch
> some data and fill in the panel with that data, but I don't want to
> load the whole page, just the specific web control I want to change
> (in this case, the panel).

You have two options as I see it, postback is needed in any case:
1. Cache the usercontrols so that they are not updated on every postback.
2. Put the dynamic contents in an iFrame and only do postback to the page in
this frame.

Quote:> Is there any easy way to do this in ASP.NET or do I have to rely on
> writing my own client-side javascript to do this ?

It's quite easy to do in asp.net if your willing to do a postback as you can
make an event that loads the values of the second dropdownlist. If you don't
want the postpack, javascript is the way to go.

Kim :o)

 
 
 

Changing web control content without page postback

Post by Joaci » Mon, 17 Feb 2003 07:28:32


Hi,

I believe you could try ASP.NET Smart Navigation.
Seek it up and take a look. In the early days of web
applications we used to have some hidden iframes that did
this trick. After they got the onload event we copied the
content to the objects that wanted fresh data. Now they
have it built in. I have not tried it yet but I think it
would look nice.

Joacim

Quote:>-----Original Message-----
>Hi there,

>I'm a newbie to ASP.NET development, so forgive me if my
question
>seems basic. I was wondering if there's any way of
changing the
>content of a web control, say for example a panel or a
datagrid, in
>response to a client action WITHOUT doing a full page
postback.

>For example, imagine I have a button and a panel with
some text in it.
>When the user clicks the button, I want to go to the
server to fetch
>some data and fill in the panel with that data, but I
don't want to
>load the whole page, just the specific web control I
want to change
>(in this case, the panel).

>Another classic example of this behaviour is the two
combo box
>example, where you load the second one based upon what
the user
>selects in the first one.

>Is there any easy way to do this in ASP.NET or do I have
to rely on
>writing my own client-side javascript to do this ?

>Any help, tips or information you can give me on this
will be greatly
>appreciated.

>Cheers,

>Joao Maia
>.

 
 
 

1. Page behaviour changing without page changes

Hi,

here's the deal: i have a page with 2 combos. The first
one, when index changed, has an associated event that
loads the 2nd combo. The problem is that this page worked
fine, I just re-compiled (for a button change of place)
and then it doesn't work anymore. What could be wrong? is
it necessary to have AutoPostBack = true for event
handling? If yes, how to keep the selected item? Other
pages have the same style and work fine.

thanks in advance

2. Also, I'm looking for...

3. How to call a method on a page from another page + Refresh without loosing content

4. Connecting Palm VII to network other than Palm.net

5. Getting html pages to execute as aspx pages without changing the file extension...

6. Web Explorer 0.91 bug

7. load items on listbox whene dropdown selected index changed without postback

8. Speed test for modem

9. partial image change without postback

10. MasterPage / Content Page -> Programmatically force Content Page Fresh restart

11. Datagrid (non-paging) loses data contents on postback

12. Page.IsValid performs a postback for a toolbarbutton web control

13. PageParser.GetCompiledPageInstance and Pages without server-side content