SelectedValue in DropDownList without Viewstate
In a webpage we have 5 dropdownlist in each dropdownlist hundreds of records were available, So when we request the page it will take approx 30 sec’s to load all the dropdownlist. This page is used to launch crystal report. When we select a value in the dropdowlist and pass the value as parameter to the crystal report. Which take 2 mins to load a report. The time taken is huge, We need to optimize this process.
First I investigated the server by running the sql profiler to trace the longest query but I couldn’t find one, all the queries executed in seconds. Then I guessed it should be problem in the client request, so I downloaded a HTTP Debugger to trace the request and response. Then I found that while requesting the report 330 kb data was posted from client to server. (Pretty High!!!)
When I checked the source of the webpage I found 330 kb of Viewstate data, so this was postbacked when the report was requested. To avoid the viewstate data I disabled the viewstate for dropdownlist’s but unable to get the selectedvalue. I thought changing the dropdownlist server control to selection box(html) which little difficult process, Later I googled and googled until get succeeded. I found answer how to get the selectedvalue of the dropdownlist without viewstate in blog.
Using request.form(dropdownlist_name.uniqueid) will give us the selectedvalue of the dropdownlist without viewstate (disabled). After implementing this the reports are launched less than 10 secs which is a tremendous performance difference.
2 comments:
kalakura da mapla......
Super
Post a Comment