Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > WebUserControl and JavaScript

Reply
Thread Tools

WebUserControl and JavaScript

 
 
Arun
Guest
Posts: n/a
 
      07-13-2004
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
 
Reply With Quote
 
 
 
 
Cowboy \(Gregory A. Beamer\) [MVP]
Guest
Posts: n/a
 
      07-13-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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



 
Reply With Quote
 
 
 
 
Arun
Guest
Posts: n/a
 
      07-14-2004
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]" <(E-Mail Removed)> wrote in message news:<uOx#(E-Mail Removed)>...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
databinding and webusercontrol =?Utf-8?B?cm9kY2hhcg==?= ASP .Net 2 10-25-2006 06:42 PM
WebUserControl and design time support Christian H ASP .Net 0 09-30-2005 12:56 PM
ResourceManager in WebUserControl and WebForm DagoFlores ASP .Net 0 05-18-2005 11:19 PM
Problems with properties on WebUserControl and Repeater Michael Groeger ASP .Net 2 05-09-2005 12:45 PM
Open Window with Javascript from WebUserControl and return values Jorge Ponte ASP .Net Building Controls 3 01-17-2005 03:44 PM



Advertisments