473,241 Members | 3,166 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,241 software developers and data experts.

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 2066
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Christian | last post by:
Hi, I try to change the position of a WebUserControl on my WEbform (layout is set to GridLayout) by changing the absolute position in the html-code but it does not work. When I change the...
0
by: Mike Levin | last post by:
Hello Group, I'm using VisualStudio.NET and put a DataGrid into a WebUserControl (an ascx file). For the DataGrid element, I have set AllowSorting="True" and OnSortCommand="Grid_Sort".
1
by: DichkoSoft | last post by:
Hi I create WebUserControl and very confused when use control For Example: ***************************** *wuc.ascx ***************************** <script id=clientEventHandlersJS...
0
by: Christian H | last post by:
Hello, I've just created a WebUserControl that consists of a few other controls such as DropDownList, TextBox and Button. Based on the information entered in the DropDownlist, and TextBox, the...
2
by: Oren | last post by:
Hello everyone... I have a simple WebUserControl with Button and TextBox on it. Webform1.aspx contains this WebUserControl. How can I create my own C'tor for this WebUserControl - I mean when I...
2
by: Oren | last post by:
Hi everyone, I have WebUserControl on a Webform. How can I sent dynamically to the WebUserControl from a Function/Property on the Webform ? <uc:myuc id="myid1" CurrentPage=<%#GetText()%>...
0
by: Giovanni | last post by:
Dear Friends, I have a decision to make and hope to get some insight: I have built several WebUserControls one of which is a WebUserControl that queries an SQL server database, retrieves a...
0
by: Klaus Jensen | last post by:
Hi In a repeater-control, in the <SeparatorTemplatei have placed a webusercontrol, I have made. That works great- However, I want to know be able to only display this WebUserControl a certain...
1
by: deeparengan | last post by:
hi in asp.net i have a webusercontrol that has three dropdownlist.In the first dropdownlist i loaded the data at design time and in second dropdownlist i load the some data at run time according to...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.