I have 2 dropdownlist(ddlCategoryFooter and ddlItemCodeFooter)inside my gridview. I want to set ddlItemCodeFooter 's datasource to my getItemList(decimal categoryID) method. The selecteditem of ddlCategoryFooter will serve as the paramter which will be passed to my getItemList Method. Basically,ddlItemCodeFooter is dependent on ddlCategoryFooter's selectedItem.
I know it can be done in code behind approach but i prefer to place it in my asp page.
I've got a listview on a control. Each row comprises a checkbox and another listview.
The outer listview is bound to a property on the control (via a method call, can't set a property as a SelectMethod on an ObjectDataSource it would appear) which is lazy loaded suchly:
The reason for the use of viewstate is this:
When an one of the checkboxes on one of the outer list view rows is checked or unchecked I want to modify the object that the ODS represents (for example I'll add a couple of Charge objects to the relevant Product object) and then rebind.
The problem I'm getting is that after every postback (specifically after checking or unchecking one of the rows' checkbox) my viewstate is empty. Thiss means that any changes I make to my viewstate'd object is lost.
Now, I've worked out (after much googling and reading, amongst many others, Scott Mitchel's excellent bit on ViewState) that during initial databinding IsTrackingViewState is set to false. That means, I think, that assigning the return from GetWebServiceProductLineChargeDetails() to the ViewState item in my Property Get during the initial databind won't work.
Mind you, even when the IsTrackingViewState is true and I call the Property Get, come the next postback, the viewstate is empty.
how I keep the object referenced by the ObjectDataSource in ViewState between postbacks and update it and get those changes to stay in ViewState?
I want to pass the Array ( object) or Structure data type value to the store procedure through ibatis .net. I can do same by commandtext using SQLDBType.Structure. I am using Table value function in sql server 2008 and .Net 2010.
I am storing a custom "Organisation" object as a session variable. One of the properties of the Organisation object is "OrganisationID" (integer). I have a DataSource that requires a parameter value to run, and I want to use a SessionParameter to populate this. In a previous version, I stored the OrganisationID directly as a session variable. In that case, I could easily access it like this:
However, how do I now access the OrganisationID property of an "Organisation" type session variable (called "Organisation")? I have tried this, which does not seem to work: <asp:SessionParameter Name="OrganisationID" SessionField="Organisation.OrganisationID" Type="Int32" />
I would like to use the gridview paging feature and have built a gridview with a user control. The data source has lots of columns, so to make it easier I want to return a LIST<MyObject> and just pass <Myobject> into the user control rather than all the data elements. Not sure how I access the object of the data source to bind to the control. Assume it would be during ondatarowbound.
Also, my guess is there is a better way to do this than gridview. I'd take either solution that allows me to have easy paging and pass the complete object into the user control
I just like to know how to pass a parameter to the datasource of my dllItemCodeFooter and dllItemCodeEdit Drowndownlist which calls my getItemCodeList(decimal categoryID) method in the code behind. The value of the parameter will be seletectedValue of the first dropdownlist(ddlCategoryFooter or ddlCategoryEdit).I know it could be done in code behind, but i prefer to bind my datasource in asp page. I want to achieve something like this
I'm using Visual Studio 2008 Query Builder and am trying to pass a value to a parameter that uses the IN OPERATOR.Here is my sql from qb:
SELECT COURSE_TITLE, INSTR_NAME, ADMIN_UNIT FROM vwHRIC_EC_ContractSummary WHERE (ADMIN_UNIT IN (@ADMIN_UNIT))
The trouble I am having is that if the parameter @ADMIN_UNIT contains more than one value such as (8X, CV) that the query doesn't return any data. If I run the same query with only one value such as (8X) it works fine.I have tried different formats like (8X, CV), ('8X', 'CV'), (8X; CV) but none have worked.I ran this same query in SQL Server Management Studio and and it returns data no problem but can't get it to work in Query Builder for my aspx application.Does anyone have any experience with this problem and how did you correct it?
I am trying to pass a URL parameter to a web page that contains a Gridview to make that query dynamic
The URL is http://localhost:3036/people2.aspx?ArvDate=01/03/2011
I would like to add that parameter to the Select statement below (bolded)
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:sqlConnection %>" SelectCommand="SELECT NumPeople, Date1,Time1,Venue FROM People_Count WHERE Date1=XXXXXXXXXX and c
I already have this code to capture from the URL
Dim strPar As String strPar = Request.QueryString.Item("ArvDate") If strPar = "" Then strPar = DateTime.Now.ToString("d") [code]....
I just don't know the syntax to get it in that SQL Select statement
I have a listview that has a hiddenField in the ItemTemplate. I want to pass this hidden control as control parameter when inserting a new record.but i get the errorCould not find control 'hiddenFieldID' in ControlParameter 'ID'.I also tried to access it in the ItemCommand event of the list view but it returns null.
if i write anywhere in datalist then it worlks , but not in this DefaultValue parameter , coz whenever that datalist item get bound one by one row then DefaultValue may get change and depend on that Default value my Quantity section also get changenx
I am trying to select a value, automatically, out of ddlCounsellorNameb by selecting a value in ddlCounsellorID. I've been getting a databinding error whenever the first dropdownlist posts back. How do I do about this without getting an error?