[RESOLVED] Page loading automatically; javascript files and image files get passed in url automatically (unwanted)

Hello,

I have this strange issue and dont know just what is happening.

I am building an application in Asp.Net 4.0 (implemented routing  feature introduced with this version) and Entity  framework 4.

There are quite a few issues and as I am clueless as to what is going wrong I may not describing my problem completely; so kindly let me know if you need any further information about the issue or application:

  • In the debeugging mode, when I inspect the code behind (.cs file) , after the page_load and the datapager pre_render events are fired instead of displaying the page, it reloads the page and returns and stops to at the break point that I had set at the page_load event.
  • On the same page I am trying to retrieve some values from the RouteData collection(routing feature which is equivalent to Request.Querysting). It works fine when the page loads for the first time; but when the page gets reloaded automatically the RouteData retrieves and returns javascript file name instead of the actual value from the url. Then when the page gets reloaded again it retrieves image name, as a result further codes where the actual url value was to be used return null and then the whole applications goes in caos.

Please help as I am just unsure where to being for hunting for the problem.

I hard coded the values on the page and tried to run it independently; it worked.

Then when I again did it the usual way by using Routing it stopped. So I guess the issue is with Routing.

Hope this much info helps inidentifying the issue.

After having googled all over.. I think the datapager control may be  causing the issue as I guess it is not fully compatible with the Routing feature introduced with asp.net 4.0.

But again to my surprise.. I commented out the datapager control and checked again.. phew.. the problem still persists..

Its been over 2 days i m stuck with the problem... grrhh.. pulling my hair!!

finally... figured it out...

datapager has poor support for routing..

will have to switch back to some other control.. probably datalist.. instead of the Listview..

Come on Microsoft.. test the control and then release it or atleast attach a note, warning about its limitations.. It will save us developers lot of meaningful man hours |-(

 

Datapager uses Post method by default.

To use the Get method we have use its QuerystringField property.

It is this property that I guess has issues with the Routing.

1 thoughts on "[RESOLVED] Page loading automatically; javascript files and image files get passed in url automatically (unwanted)"

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>