|
I’m building a fairly typical ASP.NET web app that has a data entry screen, a number of maintenance screens, and some reports. The data entry screen and the maintenance screens all work in the same way; they use ListView controls embedded in UpdatePanels.
So far so good – they’re solid and reliable. However, performance is an issue for the data entry screen, and I don’t think using a ListView is going to be good enough. Using Fiddler, I can see that every postback sends 30Kb of data down the line, which seems a little excessive to me.
I’ve experimented with a ‘fast’ data entry screen. This one just uses a plain ol’ table, no UpdatePanels. I handle the click event on the client side by calling a web service that updates the database. This has got me from 30Kb down to 12 bytes!
The thing is, I’d like to retain use of the ListView if possible, because I want consistency with my other screens, and I’d like to continue to use the DataPager control. To do this, I’m obviously going to need to override the __doPostBack functions that the ListView generates.
My question is, is this going to be more trouble than it’s worth? Before I waste days of my life on this, is there a much better way of going about it?
|
|
|
|
|
Well, the reason you see big chunk of data (30k) being sent is because of control viewstate[^]. You can turn off the ListView viewstate, but you will loose all the controls viewstate functionality. Do you need to remember the control state between postbacks?
|
|
|
|
|
I'm planning to avoid postbacks and ViewState altogether, and just call webmethods from the client. I know I can easily do this without using a ListView at all, but I'd like to try it with the ListView so that I can keep using the DataPager (which only works with ListView).
So my plan is to just use the ListView like a Repeater to build my table, override the __doPostBack so that it does what I want (i.e. call a webmethod rather than do a postback), and hopefully still be able to use the DataPager.
I guess I'm just asking whether anyone else has tried that approach, or can suggest a better one, before I commit loads of time to it.
|
|
|
|
|
I'm not sure what you gain by getting rid of postbacks/viewstates. If you want to mimic the look and feel, then design your ListView then see the client side generated code. I don't have .net3.5 (which ListView is supported), but, I think, it will get rendered as table. Get the table layout and structure and use straight table with some css to achieve similar look and feeling.
If you want to override postback, then prepare to write some client side code to supplement. I know you mentioned you want to call webservices. Do you need to support sorting, pagination ....
In any case see here[^] and here[^] for one way of overriding postback function
|
|
|
|
|
Thanks Yusuf. The ListView is template-based, so will generate whatever you put in the template, but yes, that's usually tables.
Thinking about it, I guess the only thing I gain by keeping the ListView is easy pagination (the DataPager control). Maybe the easiest thing will be to just abandon ListView and write my own pager.
Thanks again.
|
|
|
|
|
Hi There,
I want to how to take data into xml from database.If anybody knows some usefull links from where I can get information then please reply.
Thanks.
|
|
|
|
|
|
The treeview control has an attribute called ShowCheckBoxes which contains the values as"All,Leaf, Parent, Root and None". Because of this, I cannot add the checkboxes both for Parent and Child.
Is there anyway that I can add the checkboxes both for parent and child? Please help.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
|
yes lol
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
i am using crystal reports in asp.net. i have designed one tool bar as like crystal report.in that i have placed export button,print button..etc.
For print option I have used
dim cr as new ReportDocument
cr.PrintToPrinter(1, False, 1, 2)
The above is working when it is in debugg mode...the same print option is not working after publishing the website.
Can anyone help me????
Thanks in advance..
Regards...
Selva Shankar
modified on Monday, May 11, 2009 6:59 AM
|
|
|
|
|
SelvaShankar wrote: .the same print option is not working after publishing the website
What do you mean by not working? Getting some error?
|
|
|
|
|
no..the page is just refreshing....thats it
Thanks for your response...
Regards...
Selva Shankar
|
|
|
|
|
Hi all.
Am developing a web application. In that i placed a treeview.
Now My requirement is :
When i click on any node it should expand and already expanded nodes should be collapsed.
Please help me.
|
|
|
|
|
Hi,
You have to write code like this,
Protected Sub TvwPages_SelectedNodeChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TvwPages.SelectedNodeChanged
If TvwPages.SelectedNode.Text = "Screens" Then
If TvwPages.Nodes.Count > 1 Then
TvwPages.Nodes(1).Collapse() 'Collapse Reports
End If
TvwPages.Nodes(0).Expand() 'Expand Screens
ElseIf TvwPages.SelectedNode.Text = "Reports" Then
If TvwPages.Nodes.Count > 1 Then
TvwPages.Nodes(0).Collapse() 'Collapse Screens
End If
TvwPages.Nodes(1).Expand() 'Expand Reports
End If
End Sub
If you have more than one Tree View item,
Use this line ,( PUT in a For Loop) till List Count
TvwPages.Nodes(i).Collapse()
Ramesh Sambari
|
|
|
|
|
Hi
this is good for selecting child nodes. because "SelectedNodeChanged" event hires when child node is selected. But I want when Parent node is selected it should be expanded and if any expanded nodes are there they should be collapsed.
Plz help me
Its urgent
|
|
|
|
|
Hi,
Try Using this....
Protected Sub TvwPages_TreeNodeExpanded(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.TreeNodeEventArgs) Handles TvwPages.TreeNodeExpanded
If e.Node.Text = "Screens" And TvwPages.Nodes.Count > 1 Then
TvwPages.Nodes(1).Collapse()
End If
If e.Node.Text = "Reports" And TvwPages.Nodes.Count > 1 Then
TvwPages.Nodes(0).Collapse()
End If
End Sub
and..one thing...never say URGENT. It is completely irrelevent to others.
Ramesh Sambari
|
|
|
|
|
when user logged in i set its LoginBit and didnt allow same user to log in again but if user closes without signing out and he returns then how can i found that it is the same user who was actually using the session. he must not receive error that user is already signed in
|
|
|
|
|
Try any one,
1 - Handle session_end and rest the DB flag. session_end fires even user closes the browser(not immediately).
1 - Handle the window closing event using JS, do AJAX call to reset the DB flag.
2 - Run a DB job which will check the records frequently and resets the flag.
|
|
|
|
|
HI.
hi i devloping a web site , and i have two colums in data one is indate and other is outdate . the both column in varchar type and i have typecasting in date format . but when my update column is --- means not update in database . i got error . so for that i want to decode function . pls help me how i to decode in sql query.
|
|
|
|
|
sanju05 wrote: the both column in varchar type
Poor way of keeping dates. Why don't you make the column type as Date?
sanju05 wrote: but when my update column is --- means not update in database . i got error
What do you mean? What error are you getting?
|
|
|
|
|
HOW TO DECODE SQL QUERY IN ASP.NET .
|
|
|
|
|
sanju05 wrote: HOW TO DECODE SQL QUERY IN ASP.NET .
Read this[^]. Specially, point 6.
|
|
|
|
|
I have multiple reports . I want to change report and datasource
of reportviewer at runtime to show another report. I try this
but showing error. If anybody knows please help.
sachin
|
|
|
|
|
check the below link
really a good article for your problem..
http://www.aspfree.com/c/a/ASP.NET/Binding-Data-to-the-ReportViewer-Control-Dynamically-in-ASPNET-20
One person's data is another person's program.
--J.Walia
|
|
|
|