I am trying to get a value from a repeater's datasource. Here is my code:
Protected Sub Repeater1_ItemDataBound(ByVal sender As Object,
View Complete Post
View Complete Post
i want to bind my gridview with a dataset with concept of caching (to minimize the database server trips). plz give me a best example to get and bind data to gridview (command line) . grid paging is also enabled so example code should be capable to rebind data at Gridview page change.
I have a button on a page with a Repeater and an ObjectDataSource. To give credit where credit is due, the Repeater's paging functionality is courtesy of ScottGu. (However, I'm using ASP.NET 4.0 and SQL Server 2008, as opposed to ASP.NET 2.0 and SQL Server 2005.)
Anyway, in the button's click event, I need to access the Text property of a Label that's inside the Repeater because it's used as an input parameter in a stored procedure. I'm getting a NullReferenceException when trying to access the Label's Text property. I have researched this error and have tried a few different solutions (involving FindControl and the Repeater's ItemDataBound event), but I haven't been able to get it to work. Any suggestions, in VB or C#, would be greatly appreciated. The code is below.
<asp:Repeater ID="rptText" runat="server" DataSourceID="tbsDataSource"> <HeaderTemplate> <table width="100%" cellspacing="1"> </HeaderTemplate> <ItemTemplate> <%-- some rows removed for brevity --%> <tr> <td><asp:Label
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:
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
<asp:SessionParameter Name="OrganisationID" SessionField="OrganisationID" Type="Int32" />
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 have a data bound repeater with varying (but limited) number of rendered rows, depending on records retrieved.
There are several text boxes in the repeater for each row. If I wanted to change text formatting in a text box on lost focus, how do I know what the textbox is going to be named? I am guessing its going to look something like this: "ctl00_contentPlacer_rptPunches_ctl02_txtPunchIn1", but with unpredictable number of rows, don't know how to proceed.
I have a legacy Access database with which I would like to display filtered data in SharePoint. Specifically I would like to write an Access view query, and display the results of that query in a SharePoint page or list.
I cannot load the source table into SharePoint because it contains sensitive data. Is there a way to display this query view in SharePoint without having to move the entire database into SharePoint or convert the Access backend to SQL Server?
I have a pretty basic vb.net page. I added a sql datasource on my page and a couple tab panels in my tab container. Both panels need to access the sql datasoucre, but only the tab panel that has the sql datasource within it can actually get to that data. How can I make a sqldatasource on my .aspx page "accessible" to dropdown lists on two different tabs?