SelectMethod In ObjectDatasource Getting Called Multiple Times With Multiple Datapagerfield?

Oct 7, 2010

so here is the setup. I am building a page that has a listview, a datapager, and 3 datapagerfield (2 x NextPreviousPagerField, 1 x NumericPagerField), and a objectdatasource to tide all of this together.

It was all working fine until I put a breakpoint into the SelectMethod specified in the objectdatsource control. It seems like that for each datapagerfield control, it is calling the selectmethod and selectcount method. Hence, whenever a user paged, it calls the database 6 times instead of 2 (I don't have caching turned on atm). If I remove one datapagerfield, it will remove 2 calls.

Now this is build in asp.net 3.5 SP1 in VS2008. When I copied the same code files to a asp.net 4.0 VS2010 solution, it duplicate call seems to be gone.

Is this a bug in asp.net 3.5 SP1?

View 1 Replies


Similar Messages:

MVC :: Initialize Method Called Multiple Times?

Jul 6, 2010

I'm overriding the Controller.Initialize method to set some stuff before each ActionResult is executed, however I'm finding that the method is being called multiple times for each request (anywhere between 2 - 10 times). I'm running in Cassini.

My hunch is that it is running for all static files (images, css etc) as well as the requested action - although I may be wrong? I thought maybe something was wrong in my web.config but it all looks right to me.

View 6 Replies

MVC :: Application_start Event Called Multiple Times In Application

Sep 15, 2010

In my MVC application ,I am updating my web.config at runtime through application_start event.So, ideally it should be done only when the application is started.BUT in MY mvc application the application_start event of global.asax is being called multiple
times , even when i have not restarted the application.

Its being repetadly called when i am calling different actions , so the webconfig is repetedly updating & making my application very very slow. what's the reason & how to handle this .

View 2 Replies

C# - Grid Data Bound To Stored Procedure Getting Called Multiple Times?

Mar 8, 2011

I have an application that uses an aps:GridView. The GridView is populated using a DataSource that calls a Stored Procedure. The DataSource passes parameters to the Stored Procedure based on some text fields. The page has been running slower than wanted, so I was doing some checking.

I ran SQL Profiler while loading the page, and saw the Stored Procedure was being called twice. I stepped through the code and found out that in the Page Load Complete event was where this was happening. In this event, I set the value of a parameter for the Stored Procedure, then did a DataBind on the GridView to pick up the data. As I was stepping through the code, I watched the SQL Profiler. When I got to the step of setting the parameter, the Stored Procedure had not yet been called. When I stepped through that and got to the DataBind command (before running that step), the SQL Profiler showed that the Stored Procedure had been called. Then I did the DataBind and the StoredProcedure was called again.

My question is, how do I get the parameters set, and get the GridView data bound, and only call the StoredProcedure once? If I comment out the DataBind step, the StoredProcedure never does get called (which seems really strange to me...).

View 1 Replies

C# - How To Use Global Variables In ObjectDataSource.SelectMethod

Sep 10, 2010

I'm using ListView + DataPager + ObjectDataSource mix.

In the implementation of my SelectMethod of an ObjectDataSource I'd like to access a global variable set in the PageLoad() event (the method will return just the proper number of items per page). Although the variable is initialized in PageLoad() it appears to be null in SelectMethod. How can I change that?

[Code]....

View 4 Replies

Accessing An Object That Implements SelectMethod For ObjectDataSource?

Nov 8, 2010

Is it possible to access an object that is used by ObjectDataSource to retrieve records? For example,

<asp:ObjectDataSource ID="MyDS" runat="server"
SelectMethod="getUsers"
TypeName="DataSources.UserDS"
SelectCountMethod = "getUserNum"/>... </asp:ObjectDataSource>

UserDS class has getUsers that returns DataTable and getUserNum that returns int, this part works as it's supposed. But I wonder if can access the instance of UserDS somehow (not underlying DataTable)?

View 1 Replies

DataSource Controls :: Specify Two Different Methods As SelectMethod Of ObjectDataSource At Two Different Events?

Apr 13, 2010

Can we specify two different methods as SelectMethod of ObjectDataSource at two different events?

I need my Objectdatasource to get filled with one method while at button click event I want to fill it with other overloaded method.

Both the methods have same name and return same data type but they have different input parameters.

View 6 Replies

DataSource Controls :: How To Pass An Object To The Selectmethod Of The Objectdatasource Control

Mar 31, 2011

how to pass an object to the selectmethod of the objectdatasource control?

View 2 Replies

DataSource Controls :: Pass Parameters To The Selectmethod Property Of The Objectdatasource Control

Mar 27, 2011

how to pass parameters to the selectmethod property of the objectdatasource control.

View 1 Replies

Web Forms :: How To Use Same Screen Multiple Times

Jun 27, 2010

In my project i need to collect customer bank details like bank Name ,Account type ,bank balance etc etc ... what would be the best way to design such that it allows us add multiple bank details to a single customer ?? and after we enter all the details all the banks details should appear in the same screen .

View 1 Replies

Using A Class Multiple Times On One Page?

Oct 28, 2010

I have a class in my App_Code folder called Order. On one of my pages I am trying to create two different orders using this class.

[Code]....

When I run the page each of the Response.Write statements ouputs a 2. But this is not correct. One should be 3 and the other should be 2. Does anyone know why this is not working?

I have a class in my App_Code folder called Order. On one of my pages I am trying to create two different orders using this class.

Private Order1 As Order
Private Order2 As Order
Sub Page_Load(ByVal Sender As Object, ByVal E As EventArgs) Handles Me.Load
Dim CartID As String = 4525543
Order1 = GetOrderFromDatabase(CartID)
Order2 = Order1
Order2.Shipping = 3
Order1.Shipping = 2
Response.Write(o.Shipping)
Response.Write(Order2.Shipping)
End Sub

When I run the page each of the Response.Write statements ouputs a 2. But this is not correct. One should be 3 and the other should be 2. Does anyone know why this is not working?

View 5 Replies

Ajax - Control Appears Multiple Times?

Oct 5, 2010

i have to two buttons in aspx page. i added ajax functionality to the page. but now thesee two button appears twice when i run the page.

View 1 Replies

Javascript - Click() Firing Multiple Times?

Aug 11, 2010

I am using a document.getElementById("val").click() to invoke a click event, but it keeps firing multiple times.

Here I add the eventHandler

try {
//add mousedown event handler to navigation buttons
addEventHandler(oPrevArrow, "mousedown", handlePrevDayClick);
addEventHandler(oNextArrow, "mousedown", handleNextDayClick);
addEventHandler(oLogout, "mousedown", handleLogoutClick);
}
catch (err) {
}

In the click event i am performing a "auto click"

function handleNextDayClick(e) {
e = e || window.event;
stopEvent(e);
document.getElementById("btn_nextday").click();
}

NB: the button that is auto-clicked calls a method in the ASP.NET Code-Behind

View 2 Replies

MVC :: Using A Partial View Multiple Times On A Page?

Feb 17, 2011

I have the JQuery tab control on my page and each tab will be using the same partial view with a filter set of the model. What is the best way to do this?

The only thing is the data needs to be filtered before it gets to each partial view.

I am currently putting the filtered model data in ViewData but I do not know how to reference that in the partial views.

[Code]....

In my partial view:

[Code]....

View 3 Replies

C# - Deploy .net Web Application Multiple Times On The Same Server?

Mar 16, 2010

I have a ASP.NET 3.5 web application and I would like to allow users to install this web application multiple times on the same server.

--------
WebApp1 - database1
WebApp2 - database2
WebApp3 - database3

View 2 Replies

Access A Database Table Multiple Times For Every Request?

Mar 16, 2011

A class in my ASP.NET website needs to access a database table multiple times for every request. The database table should rarely change, if ever. Maybe a couple times a month.

In the static constructor of the class, the table is fetched from the DB and cached in a static local variable. Whenever the class needs to access the table, then, it just uses the cached, static version.

My question concerns the lifespan of this cached, static version of the table.

I understand that it's fetched the first time the class is instantiated or a static method in the class is used. But how often does this occur on the web server? What if the table changes and we want to reset this static version of the table?

Basically, I'm wondering, is this table fetched once and then only refetched each time I restart IIS? What, with regard to the site and IIS, will trigger this static class to reset, causing the static table to be refetched?

View 3 Replies

AJAX :: Change Event Triggered Multiple Times?

Mar 31, 2011

[Code]....

When the popup opens, the following code is run:

.....
if (window.attachEvent) {
$("#rblQuickPick").change(function () {
//ClickQuickPick();
alert("something changed!");
});
.....

ClickQuickPick() is the code I will eventually run, but I put in the Alert for testing.

The issue is that when the popup extender opens, and I click an item, I get the alert once. If I click another choice I get the alert twice. If I click another choice I get the alert three times, etc.

What is triggering the event to repeat, and how do I stop it?

View 1 Replies

AJAX Binds Jquery Events Multiple Times?

Mar 29, 2010

I have a masterpage setup, with a pageLoad in the topmost masterpage, which calls pageLoad2 for nested masterpages which calls pageLoad3 for content pages.

In my content page I have a jquery click event and in my nested masterpage I have a web user control.

Whenever I use the user control in the nested masterpage, it rebinds the click event in the content page (undoubtedly because the pageLoad3 is called again), but this makes the click event fire twice on a single click. The problem gets worse the higher up masterpages you go (eg. fires 3 times if user control from topmost masterpage is called).

how to make sure it only binds the jquery events once?

View 2 Replies

AJAX :: InsertCommand - Adds The Record Multiple Times

Jun 22, 2010

I have a InsertCommand function i am using to insert the dropdownlist in my updatepanel. When the Add button is clicked. It adds the record multiple times. Am not sure why it does this. Here is my code.

Dim Bank_number
As
DropDownList = UpdatePanel1.FindControl("ddlbank")Dim
NoteAccountNumber As
DropDownList = UpdatePanel1.FindControl("ddlAccount")'
UpdatePanel1.ChangeMode(FormViewMode.Insert)
lblsee.Visible =
"true"
'now collect selected information on the drop down
RelationshipTest.InsertParameters(
RelationshipTest.InsertParameters(
"bank_number").DefaultValue
= ddlBank.SelectedValue.ToString"noteaccountnumber").DefaultValue
= ddlAccount.SelectedValue.ToString'Insert into db
RelationshipTest.Insert()

Also, i was woundering if any of you might know the logic behind clearing inserted data from the dropdownlist once its inserted. I am trying to make sure data is not entered mulitiple times. Unique Indexing comes to mind but thats only on the backend.

View 3 Replies

AJAX :: The Script 'Timer.js' Has Been Referenced Multiple Times?

Aug 16, 2010

I am having a problem with ajaxcontroltoolkit 3.5. I am getting the following error

"Microsoft JScript runtime error: Sys.InvalidOperationException: The script 'Timer.js' has been referenced multiple times. If referencing Microsoft AJAX scripts explicitly, set the MicrosoftAjaxMode property of the ScriptManager to Explicit."

I have migrated ajax web app from 2.0 to 3.5 and have changed ScriptManager to ToolkitScriptManager.

View 4 Replies

Prevent Unauthenticated Users To Vote Like Multiple Times

Jan 26, 2014

How can we prevent non ahuthenticated users from like and dislike multiple times?one way : save Ip address in a cookiebut theres's two problem1. I heard Ip address isn't unique and changes frequently2. cookie can be deleted by userI'd .

View 1 Replies

Crystal Reports :: Print Multiple N Times In A Loop?

Nov 28, 2012

i designed one crystal report for printing payslip for an employee

when i give the enployee id and month as input the payslip will be printed

how to print payslip for all employee at a time.

View 1 Replies

MVC :: How To Apply Custom Validator Multiple Times On A Single Property

Jan 21, 2011

i want to apply my custom validator multiple times on a single property. i am using mvc 3 unobtrusive js for validations.i have tried this solution
http://www.paraesthesia.com/archive/2010/03/02/the-importance-of-typeid-in-asp.net-mvc-dataannotations-validation-attributes.aspx , but not working for me.I am getting error like this : "Validation type names in unobtrusive client validation rules must be unique."

View 7 Replies

AJAX :: Exception While Using Slider Control Multiple Times In A Page?

Jul 19, 2010

I am using slider extender in an user control. I am adding that user control 2 times in a page. At that it gives me an error saying "Two components with the same id 'Slider1' can't be added to the application."

I am using Latest Version of AjaxToolkit and VS 2008 with .NET FWK 3.5.

View 1 Replies

C# - ScriptManager Adding Script Multiple Times To Page (duplicates)?

Dec 3, 2010

This is the exact same question as this unanswered one from May.

(edit) Note: this unanswered post exactly describes the behavior - extra scripts being added in the <head> by ScriptManager.RegisterClientScriptBlock in a usercontrol, in an UpdatePanel, is causing duplicates. C# .NET 4.0. The page is structured like this:

MasterPage
Page
UserControl1 (ascx) - loaded in code by Page
UpdatePanel
UserControl2 (ascx) - loaded in code by UserControl1


The first time the script is added as expected, in the body. The code, simply, in the UserControl2 OnInit:

ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "myscript", script, true);

I've also tried referencing "this" instead of page, which doesn't really make sense since I don't want the same script keys duplicated on the page if the usercontrol is loaded multiple times on a page, but it didn't work anyway.

After a partial postback, the script is added again - but curiously in the <head> of the page, not the body, and interestingly, lacking the normal //<![CDATA[...//]]> wrapper that asp.net usually adds.

Another script which is added by UserControl1 is duplicated exactly the same way after a partial postback.

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved