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

Why Soo Slow ?

Jay
ASP.NET 2.0.

One line of code (checkbox onclick) in a databound grid really slows down
the page load...

<asp:TemplateColumn>
<ItemTemplate>
<asp:CheckBox ID="chkEmp" onClick=<%# "HighlightRow(this, """ +
Eval("empname") + """)"%> runat="server" autopostback="False"/>
</ItemTemplate>
</asp:TemplateColumn>

If I remove the """ + Eval("employee_name") + """ part from the line
everything works great. Any ideas? Even the HighlightRow javascript
function is simple...

<script language="javascript">
<!--
function HighlightRow(chkB, empname)
{
xState=chkB.checked;
if(xState)
{
chkB.parentElement.parentElement.style.backgroundC olor='yellow';
}
else
{
chkB.parentElement.parentElement.style.backgroundC olor='whitesmoke';
}
}
-->
</script>

You may notice that the empname var is not eve used (yet) in the javascript.

Anyways, why would this take soo long for the page to load with the onclick
in place?

Thanks.
Dec 6 '05 #1
2 1397
Becuase each row of the grid the code is evaluated - this can be slow.

You may be better to use a different method.

Check with an ASP.NET newsgroup for ASP.NET Gurus

--

Cheers

Chris Crowe [IIS MVP 1997 -> 2006]
http://blog.crowe.co.nz
------------------------------------------------
"Jay" <msnews.microsoft.com> wrote in message
news:%2*****************@TK2MSFTNGP11.phx.gbl...
ASP.NET 2.0.

One line of code (checkbox onclick) in a databound grid really slows down
the page load...

<asp:TemplateColumn>
<ItemTemplate>
<asp:CheckBox ID="chkEmp" onClick=<%# "HighlightRow(this, """ +
Eval("empname") + """)"%> runat="server" autopostback="False"/>
</ItemTemplate>
</asp:TemplateColumn>

If I remove the """ + Eval("employee_name") + """ part from the line
everything works great. Any ideas? Even the HighlightRow javascript
function is simple...

<script language="javascript">
<!--
function HighlightRow(chkB, empname)
{
xState=chkB.checked;
if(xState)
{
chkB.parentElement.parentElement.style.backgroundC olor='yellow';
}
else
{
chkB.parentElement.parentElement.style.backgroundC olor='whitesmoke';
}
}
-->
</script>

You may notice that the empname var is not eve used (yet) in the
javascript.

Anyways, why would this take soo long for the page to load with the
onclick in place?

Thanks.

Dec 6 '05 #2
Sorry I thought I was in an IIS Newsgroup.

--

Cheers

Chris Crowe [IIS MVP 1997 -> 2006]
http://blog.crowe.co.nz
------------------------------------------------
"Chris Crowe [MVP 1997 -> 2006]" <II********@iisfaq.homeip.net> wrote in
message news:eV***************@TK2MSFTNGP12.phx.gbl...
Becuase each row of the grid the code is evaluated - this can be slow.

You may be better to use a different method.

Check with an ASP.NET newsgroup for ASP.NET Gurus

--

Cheers

Chris Crowe [IIS MVP 1997 -> 2006]
http://blog.crowe.co.nz
------------------------------------------------
"Jay" <msnews.microsoft.com> wrote in message
news:%2*****************@TK2MSFTNGP11.phx.gbl...
ASP.NET 2.0.

One line of code (checkbox onclick) in a databound grid really slows down
the page load...

<asp:TemplateColumn>
<ItemTemplate>
<asp:CheckBox ID="chkEmp" onClick=<%# "HighlightRow(this, """ +
Eval("empname") + """)"%> runat="server" autopostback="False"/>
</ItemTemplate>
</asp:TemplateColumn>

If I remove the """ + Eval("employee_name") + """ part from the line
everything works great. Any ideas? Even the HighlightRow javascript
function is simple...

<script language="javascript">
<!--
function HighlightRow(chkB, empname)
{
xState=chkB.checked;
if(xState)
{
chkB.parentElement.parentElement.style.backgroundC olor='yellow';
}
else
{
chkB.parentElement.parentElement.style.backgroundC olor='whitesmoke';
}
}
-->
</script>

You may notice that the empname var is not eve used (yet) in the
javascript.

Anyways, why would this take soo long for the page to load with the
onclick in place?

Thanks.


Dec 6 '05 #3

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

Similar topics

5
by: yawnmoth | last post by:
using the gethostbyname function seems to noticeably slow down pages. some of the comments in php.net's gethostbyname entry suggest using a version that caches the result, but those versions also...
8
by: Neil | last post by:
I have a very puzzling situation with a database. It's an Access 2000 mdb with a SQL 7 back end, with forms bound using ODBC linked tables. At our remote location (accessed via a T1 line) the time...
2
by: David | last post by:
Hi, We have an internal network of 3 users. Myself & one other currently have individual copies of the front-end MS Access forms and via our individual ODBC links we have used the: File > Get...
3
by: Jennyfer J Barco | last post by:
In my application I have a datagrid. The code calls a Stored procedure and brings like 200 records. I created a dataset and then a dataview to bind the results of the query to my grid using ...
50
by: diffuser78 | last post by:
I have just started to learn python. Some said that its slow. Can somebody pin point the issue. Thans
0
by: Pratchaya | last post by:
In my.cnf i add these lines ####### log-bin log-slow-queries = /var/log/mysqld-slow.log long_query_time=1 #######
2
by: mezise | last post by:
Posted by Pratchaya: ------------------------------------------------------ MySQL Slow Log ERROR In my.cnf i add these lines ####### log-bin log-slow-queries = /var/log/mysqld-slow.log
13
by: eighthman11 | last post by:
using Access 2003 and sql server version 8.0 Hey everyone. Created a text box where the user types in an Inventory number and it takes them to that inventory number on the contimuous form. The...
3
by: John | last post by:
Hi I have replaced an ms access app with its vb.net version at a client site. Now the clients keeps complaining about how slow the app response is. The complains they have are for example when...
10
by: penworthamnaynesh | last post by:
Does php slow your website down? This is what i would like to know.The reason is because my site is writtent 50% in html and 50% in php and is very slow at loading. And i cant tell wether php is...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.