473,320 Members | 1,845 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,320 software developers and data experts.

usercontrol refresh

What's the best way to refresh a usercontrol using a parameter? My
usercontrol is just a DataList that retrieves data from SQL in association
with a public propterty.

I click on a LinkButton in my main page (ASPX), but it still refreshes the
entire page... I only want the UserControl to blink and come back with new
data.

What's the direction I should be looking at? Even if I do it via
JavaScript, how would I refresh the UserControl using JavaScript?

TIA,
-roko

Nov 17 '05 #1
4 6656
My hunch is that this is not possible. Here's why:
1 - JavaScript cannot trigger anything on the server. UC
are run at the server. Therefore JS alone could not
trigger anything for a UC to refresh.

2 - UC ultimately get generated into regular HTML that is
merged with the rest of your page, just look at the view
source HTML from your browser. To re-generate the UC
requires re-generating the entire page.

In terms of solutions, would caching help out? Perhaps
putting the UC in a sub-frame so that it still has its own
page that refreshes?

HTH,
Tim Stall

-----Original Message-----
What's the best way to refresh a usercontrol using a parameter? Myusercontrol is just a DataList that retrieves data from SQL in associationwith a public propterty.

I click on a LinkButton in my main page (ASPX), but it still refreshes theentire page... I only want the UserControl to blink and come back with newdata.

What's the direction I should be looking at? Even if I do it viaJavaScript, how would I refresh the UserControl using JavaScript?
TIA,
-roko

.

Nov 17 '05 #2
My hunch is that this is not possible. Here's why:
1 - JavaScript cannot trigger anything on the server. UC
are run at the server. Therefore JS alone could not
trigger anything for a UC to refresh.

2 - UC ultimately get generated into regular HTML that is
merged with the rest of your page, just look at the view
source HTML from your browser. To re-generate the UC
requires re-generating the entire page.

In terms of solutions, would caching help out? Perhaps
putting the UC in a sub-frame so that it still has its own
page that refreshes?

HTH,
Tim Stall

-----Original Message-----
What's the best way to refresh a usercontrol using a parameter? Myusercontrol is just a DataList that retrieves data from SQL in associationwith a public propterty.

I click on a LinkButton in my main page (ASPX), but it still refreshes theentire page... I only want the UserControl to blink and come back with newdata.

What's the direction I should be looking at? Even if I do it viaJavaScript, how would I refresh the UserControl using JavaScript?
TIA,
-roko

.

Nov 17 '05 #3
As a quick fix, what I did was load all those UCs that I need (3 images with
links vertically on the right side), enclosed them all within their own div
tags. So for 4 user controls, I have them all enclosed in 4 div tags. I
used javascript to show/hide these div tags, i.e.
document.getElementById("uc1").style.display = 'block'); or
document.getElementById("uc1").style.display = 'none');

I found this method thanks to this link:
http://www.webmatrixproject.net/Foru...1&PostID=21175

As it is done, three images shows up in the UC (as there's only enough room
for it), but if I was to do some pagination in that datalist of images, I
think I will be stuck, but otherwise, I'm OK for the time being...

Still not a be-all, end-all solution, but worth working towards... :-)

-roko

"Tim S." <ti******@hotmail.com> wrote in message
news:00****************************@phx.gbl...
My hunch is that this is not possible. Here's why:
1 - JavaScript cannot trigger anything on the server. UC
are run at the server. Therefore JS alone could not
trigger anything for a UC to refresh.

2 - UC ultimately get generated into regular HTML that is
merged with the rest of your page, just look at the view
source HTML from your browser. To re-generate the UC
requires re-generating the entire page.

In terms of solutions, would caching help out? Perhaps
putting the UC in a sub-frame so that it still has its own
page that refreshes?

HTH,
Tim Stall

-----Original Message-----
What's the best way to refresh a usercontrol using a

parameter? My
usercontrol is just a DataList that retrieves data from

SQL in association
with a public propterty.

I click on a LinkButton in my main page (ASPX), but it

still refreshes the
entire page... I only want the UserControl to blink and

come back with new
data.

What's the direction I should be looking at? Even if I

do it via
JavaScript, how would I refresh the UserControl using

JavaScript?

TIA,
-roko

.

Nov 17 '05 #4
As a quick fix, what I did was load all those UCs that I need (3 images with
links vertically on the right side), enclosed them all within their own div
tags. So for 4 user controls, I have them all enclosed in 4 div tags. I
used javascript to show/hide these div tags, i.e.
document.getElementById("uc1").style.display = 'block'); or
document.getElementById("uc1").style.display = 'none');

I found this method thanks to this link:
http://www.webmatrixproject.net/Foru...1&PostID=21175

As it is done, three images shows up in the UC (as there's only enough room
for it), but if I was to do some pagination in that datalist of images, I
think I will be stuck, but otherwise, I'm OK for the time being...

Still not a be-all, end-all solution, but worth working towards... :-)

-roko

"Tim S." <ti******@hotmail.com> wrote in message
news:00****************************@phx.gbl...
My hunch is that this is not possible. Here's why:
1 - JavaScript cannot trigger anything on the server. UC
are run at the server. Therefore JS alone could not
trigger anything for a UC to refresh.

2 - UC ultimately get generated into regular HTML that is
merged with the rest of your page, just look at the view
source HTML from your browser. To re-generate the UC
requires re-generating the entire page.

In terms of solutions, would caching help out? Perhaps
putting the UC in a sub-frame so that it still has its own
page that refreshes?

HTH,
Tim Stall

-----Original Message-----
What's the best way to refresh a usercontrol using a

parameter? My
usercontrol is just a DataList that retrieves data from

SQL in association
with a public propterty.

I click on a LinkButton in my main page (ASPX), but it

still refreshes the
entire page... I only want the UserControl to blink and

come back with new
data.

What's the direction I should be looking at? Even if I

do it via
JavaScript, how would I refresh the UserControl using

JavaScript?

TIA,
-roko

.

Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: The Mess | last post by:
I recently made a UserControl consisting of buttons in a frame. The problem is that random strange markings appear sometimes under the buttons. They can be 'wiped off' with another window, and...
2
by: Jose Michael Meo R. Barrido | last post by:
I made a custom runded rectangle usercontrol. I used a function i found on the internet. the function works fine(see "GetRoundRect" below). I use the fullowing code to make my usercontrol...
0
by: lc | last post by:
I use a series of UserControl that get dynamically created and (all) docked (fill) on one form panel. Problem is that I have to call UserControl.BringToFront() more than once to get it to show....
2
by: Jaikumar | last post by:
Hi, 1) I have created one windows application, In the main form ( form1) i have added one usercontrol (usercontrol1), In that user control i am drawing one image. 2) In the UserControl1 i am...
8
by: Tinus | last post by:
Hello all, I've create a custom control (UserControl) and have a custom Item Collection. The control is a custom calendar which is draw using the Graphics Rectangle etc. functions. It is drawn...
0
by: Rob Koch | last post by:
What's the best way to refresh a usercontrol using a parameter? My usercontrol is just a DataList that retrieves data from SQL in association with a public propterty. I click on a LinkButton in...
2
by: Lau Lei Cheong | last post by:
Hello, I'm writing a usercontrol that contains a property named "disabled". It is set to false by default but there is also another button in the usercontrol that'll set it to true. On the...
1
by: Executor | last post by:
Hi you all, I have created a usercontrol with a filledEllipses on a filledRectangle, using this Paint event: private void myControl_Paint(object sender, System.Windows.Forms.PaintEventArgs e)...
2
by: cmrchs | last post by:
Hi, I have a web servercontrol with a property public Color TextColor { get { return txtValue.ForeColor; }
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
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...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.