Hi, I have a code that sort of works. The event flow is as follows:
In a user control of type "FilterControl" user selects certain values
from 3 related dropdown lists. (two of them have auto postback set to
true as I need to refresh the 2nd and 3rd list. Then clicks on Submit
button which fires a custom event "FilterSubmitted". Yes this a custom
control, as I will be using it in many places.
I have a GridView control on the page that displays the search results.
The problem is that when the 1st filter is selected, the postback
causes the page to refresh together with the GridView, which I would
like to keep unchanged until the Submit button of the FilterControl.
All stopping of the events in DataBound related evens using flags had
the same behaviour.
I have tried to remove the code from aspx to the code behind, where I
hit the following error
"Value cannot be null.\r\nParameter name: propName".
My understanding is that this is related to the Data Access Security
aspect.
As per MSDN - the "User" value is set correctly for the page.
I have no clue as to what to do next.
Is there any other way to stop the page from being refreshed?
How could I use client side refresh of the filter, such that the post
back only occurs on Submit button?
Any guidance would be greatly appreciated.
Thanks
bsaran
Below is the Stack Trace for consideration:
System.ArgumentNullException was unhandled by user code
Message="Value cannot be null.\r\nParameter name: propName"
Source="System.Web"
ParamName="propName"
StackTrace:
at System.Web.UI.DataBinder.GetPropertyValue(Object container,
String propName)
at
System.Web.UI.WebControls.GridView.CreateChildCont rols(IEnumerable
dataSource, Boolean dataBinding)
at
System.Web.UI.WebControls.CompositeDataBoundContro l.PerformDataBinding(IEnumerable
data)
at
System.Web.UI.WebControls.GridView.PerformDataBind ing(IEnumerable data)
at
System.Web.UI.WebControls.DataBoundControl.OnDataS ourceViewSelectCallback(IEnumerable
data)
at System.Web.UI.DataSourceView.Select(DataSourceSele ctArguments
arguments, DataSourceViewSelectCallback callback)
at System.Web.UI.WebControls.DataBoundControl.Perform Select()
at System.Web.UI.WebControls.BaseDataBoundControl.Dat aBind()
at System.Web.UI.WebControls.GridView.DataBind()
at Pricing_PriceRebate.Filter_Submitted(Object sender,
FilterSubmitEventArgs e) in
c:\Dev\Projects\GainShare.root\GainShare\GainShare \Pricing\PricingInput.aspx.cs:line
122
at
UserControls_FilterControl.OnFilterSubmit(FilterSu bmitEventArgs e) in
c:\Dev\Projects\GainShare.root\GainShare\GainShare \UserControls\FilterControl.ascx.cs:line
49
at UserControls_FilterControl.btnSubmit_Click(Object sender,
EventArgs e) in
c:\Dev\Projects\GainShare.root\GainShare\GainShare \UserControls\FilterControl.ascx.cs:line
118
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEven t(String
eventArgument)
at
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String
eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection
postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)