468,530 Members | 1,570 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,530 developers. It's quick & easy.

WebUserControl and JavaScript

I am new to ASP.NET I need some help for this scenario

The scenario is like this

I have a template Page which loads a WebUserControl (uct1.ascx) inside
a PlaceHolder (PH1)

Now this Web User Control (uct1.ascx) has a table with 2 rows
First row has a 5 text boxes 2 Combobox and 6 buttons (all Server
Controls)
Second row just has a placeholder (PH2)

When the user clicks on each button a respective webusercontrol is
loaded into the placeholder (PH2)

Now my question is
When I click on each button it refreshes the whole page. Which means
it is going to the server for each and every click,

Can I avoid this, if so how

I tried this option by loading all the user control @ once and making
it visible true/false @ runtime through java script

But Javascript doesn't seems to work fine with Web User Control as it
is not getting the document.all.XXXX says it is null

I would appretiate if some one advice me the best way to go

Thanks
Arun
Nov 18 '05 #1
2 1912
Going to the server is not a problem, per se, as long as you remember you
have to "reload" dynamic items with each trip. For dynamic clicks, you will
have to store the information somewhere. ViewState is one option that works,
as long as you are not sending too much info (as it travels back and forth
between client and server). Cache is another option, as is Session (although
I would not use Session for this). If the amount of data warrants, you can
also throw the information into a persistent store, like a database.

You are going to have to maintain a bit of state in your code, knowing where
someone is in the process.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************
Think Outside the Box!
************************************************
"Arun" <ar*******@yahoo.com> wrote in message
news:a9**************************@posting.google.c om...
I am new to ASP.NET I need some help for this scenario

The scenario is like this

I have a template Page which loads a WebUserControl (uct1.ascx) inside
a PlaceHolder (PH1)

Now this Web User Control (uct1.ascx) has a table with 2 rows
First row has a 5 text boxes 2 Combobox and 6 buttons (all Server
Controls)
Second row just has a placeholder (PH2)

When the user clicks on each button a respective webusercontrol is
loaded into the placeholder (PH2)

Now my question is
When I click on each button it refreshes the whole page. Which means
it is going to the server for each and every click,

Can I avoid this, if so how

I tried this option by loading all the user control @ once and making
it visible true/false @ runtime through java script

But Javascript doesn't seems to work fine with Web User Control as it
is not getting the document.all.XXXX says it is null

I would appretiate if some one advice me the best way to go

Thanks
Arun

Nov 18 '05 #2
Thanks ,
It works fine with cache,
Is their a way i can do this using Javascript @client site.
so once i get the data from the server i have to only enable/disable
the webusercontrols on the button click.
(Using the javascript, i am unable to get the webcontrols ClientID, i
can get the clientID for controls inside it. Just out of curiosity, is
it possible to do this way.)

Thanks
Arun

"Cowboy \(Gregory A. Beamer\) [MVP]" <No************@comcast.netNoSpamM> wrote in message news:<uO**************@tk2msftngp13.phx.gbl>...
Going to the server is not a problem, per se, as long as you remember you
have to "reload" dynamic items with each trip. For dynamic clicks, you will
have to store the information somewhere. ViewState is one option that works,
as long as you are not sending too much info (as it travels back and forth
between client and server). Cache is another option, as is Session (although
I would not use Session for this). If the amount of data warrants, you can
also throw the information into a persistent store, like a database.

You are going to have to maintain a bit of state in your code, knowing where
someone is in the process.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************
Think Outside the Box!
************************************************
"Arun" <ar*******@yahoo.com> wrote in message
news:a9**************************@posting.google.c om...
I am new to ASP.NET I need some help for this scenario

The scenario is like this

I have a template Page which loads a WebUserControl (uct1.ascx) inside
a PlaceHolder (PH1)

Now this Web User Control (uct1.ascx) has a table with 2 rows
First row has a 5 text boxes 2 Combobox and 6 buttons (all Server
Controls)
Second row just has a placeholder (PH2)

When the user clicks on each button a respective webusercontrol is
loaded into the placeholder (PH2)

Now my question is
When I click on each button it refreshes the whole page. Which means
it is going to the server for each and every click,

Can I avoid this, if so how

I tried this option by loading all the user control @ once and making
it visible true/false @ runtime through java script

But Javascript doesn't seems to work fine with Web User Control as it
is not getting the document.all.XXXX says it is null

I would appretiate if some one advice me the best way to go

Thanks
Arun

Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Mike Levin | last post: by
1 post views Thread by DichkoSoft | last post: by
reply views Thread by Christian H | last post: by
2 posts views Thread by Oren | last post: by
2 posts views Thread by Oren | last post: by
reply views Thread by Giovanni | last post: by
reply views Thread by Klaus Jensen | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.