I'm getting an error message: Object reference not set to an instance of an object.
Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error: [Code]....
I am trying to bind my dataset to a datalist. I know I can use a databind methed but Im also trying to do something else like modifying the dataset. What I want basically done is, if the user is not signed in, it will populate my datalist which is mostly checkboxes with texts. But when the user is signed in, i want his history of his checkboxes that was save onto the database.
The problem is that i have a search page. Access Database holding the information. I have a Access Datasource on the page with a Datalist to show the data. I need to find a way on setting it up to says "Sorry no results found" when the is no results. i am unsure on how to do this though.
Am building a Form for out intranet that runs on ASP.NET and C#, it is to be a survey from a SQL database. I have the connections setup can pull informations/Questions from the database. I am having a problem with setting up radio buttons within a datalist, ive never done this and i know they require unque names.
It is to be 4 radio buttons per question where only one can be select, i know how to group just not via a datalist with unique names
I am trying to place a datalist inside datalist. I managed to place a datalist inside gridview but not datalist inside datalist.
Below is the code I am using to bind the datalist into the master gridview, I am trying to change this code in such way it will be right for datalist inside datalist but so far I did not succeed.
i have a datalist . that is contains 7 columns in repeat layout .when i have more from 7 columns , datalist style is normal .but when i have smaller than 7 columns ! data list style is not normal,
because there are some empty columns without specific schema.
How i can make a datalist > when i have 1 columns in my datalist my first layout width be 100% ;
have a gridview with a bunch of checkboxes. I would like to restrict the selection based on a value I get back from the database. I am able to do this on the serverside but it is very cluncky. Is there a way I could do that using javascript and ajax or just a more elegant way to approach this. The gridview is in a usercontrolMy code right now -
[Code]....
My selectioncount code is as follows - Protected Sub selectionCount(ByVal sender As Object, ByVal e As EventArgs)
I am running into a problem getting a value from my Grid View based on the selected checkbox. I have a grid view that is populated by database based on search criteria. However once that Grid View is populated, I would like to be able to select multiple ID's from that view. My coding experience isnt the greatest as I am still fairly new to all of this.
I am trying to implement a gridview with some checkboxes to allow users to select the rows that they would like to insert into a file selected from a dropdown list. am working on being able to select the rows from the grid but not having much success. I can get it to recognise each selected row but when I place them in a dataset it only stores the last checked gridrow. It's probably something simple that I'm missing y code is
I have a usercontrol include file that has a panel on which I have programatically added checkboxes that equate to the results of a selection via a sql select stmt.
I am now trying to find the results of the checkboxes (ie checked/unchecked) using findcontrol as per
[Code]....
the commented out code is a different attempt
Is this the correct method(s) or should I do something different
I have a listview with paging.Every paging has 10 rows with with a username, an email and a checkbox.
I need to be able to check a couple of checkboxes, in different "pagings", press a button and send an email every to ever user that has been checked.
Trouble is I don't really know how to remember the selected checkboxes between each paging-press.
Deos anyone have a similar solution or a few tips on how to do this? I'd prefer to solv this without jQuery, but ordinare javascript or a C# solution works fine.
I've got a typed dataset that populates programmatically based upon dropdown selections from the user, and then is bound to a datagrid. One of the cols is a bit type (indicating whether or not that record is "active"). I would like that datagrid col to be exposed to the user as a bunch of checkboxes, which the user could turn on and off as needed, and then update the entire recordset according upon clicking Submit.
Is converting a dg column into checkboxes a straightforward thing to do?
I use if(! Page.postback) to fill those two repeaters I want to get the data related to checked checkboxes when using the below code it get only the data of the first checked box how to make it brign all the data
private void Btn_Confirm_Click(object sender, System.EventArgs e) { //CheckBox checkedButton = null; foreach (RepeaterItem item in ParentRepeater.Items) { CheckBox control=(CheckBox)item.FindControl("CheckBox1"); if (control.Checked) { //checkedButton = control; foreach(DataRow r in GetInnerData(control.Text).Rows ) // GetInnerData is used to pring datarelated to the selected check box { if(r["DESCRIPTION"].ToString() == control.Text) { Response.Write(r["DESCRIPTION"].ToString() + r["Date" ].ToString() + r[ "Trx" ].ToString() + r[ "GL" ].ToString() + r["Amount" ].ToString() +" "); } } control.Dispose(); //checkedButton.Dispose(); break; } } } }
I´m developing a database driven asp.net 4.0 application and are currently stuck with the following issue.
I need to dynamically add checkboxes using code behind. These checkboxes represent activities that the user may chose from by ticking the ones that they are interested in. I do not know the number or which activities that should be presented until runtime so hard coding checkboxes is not an option.
On the client side I need to keep track of which checkboxes/activities the user have chosen as I need to calculate the cost for these without doing a postback. I would like to use javascript to find out what activities that are chosen and also calculate the total cost using javascript.
To implement this I tried to use Page.ClientScript.RegisterExpandoAttribute (server side) and javascript (client side, but I do not manage as ticking any of the checkboxes will not fire a client side event. I´m also using Telerik RadPanelBar controler.
I´ve been stuck with this for some time now and have a nice deadline coming up :) I would be most thankfull if anyone could point me in the correct direction as I feel a bit clueless. Perhaps there is a much easier way of solving this? Perhaps my code is all wrong?
I hav a prob of checkboxes' checks not being registered...as explained below :
I have a gridview which is being populated using datasets.
[Code]....
I have added a column of checkboxes it using a TemplateField
[Code]....
And I am using a button to count the number of checked checkboxes.
[Code]....
I am viewing the value of session variable under at check.aspx
The Problem is that no matter how many checkboxes I check they are always counted as 0. The 'check' just doesnt get regsitered in the gridview.
After quite certain testing, a few things are clear
The checkboxes are being discovered by the counting loop fine.If I mark a cell as checked in the dataset before binding, then that check does get registered and thus is counted. Any thing I am missing ? Do i have to update something ?
I have a treeview on an ASP site that I populate from a DB using a Stored Proc that delivers XML. I am using an XML datasource that is loaded from the SP programmatically in the dadtasource's onload handler (if there is a way to load it from an SP declaratively, let me know). The treeview has its 'ShowCheckboxes' property set to "Leaf" (see code below) so that any leaf node can be checked.
The problem is this - I have a 'Checked' attribute in the leaf nodes of the XML (see below) that I would like to have databound to the treeview (I have databound the Name and ID attributes successfully) and I can't seem to find a way to do this. I also tried programmatically, but the treenode's dataitem property seems to have the value 'Nothing' even after the tree is databound.
How do I bind the 'Checked' attribute to the treeview's checkboxes? (Prefereably declaratively)
Example of XML here:
[Code]....
Note that nodes have Name and ID attributes, and Leaf nodes have Chacked attribute.
Im trying to input the value in the table into the checkboxes but i keep getting an error that states: "Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index"When i do a quick on this part of the code :"DirectCast(GridView1.Rows(i).FindControl("DescriptionA1"), Label).Text", i get "Run-time exception thrown". This is my first time trying something like that, i have search for solutions but now im more confused than ever.
I am writing a search application for a large dataset of images of algae.
The search is in two steps: first some general search criteria is filled out. Next a list of species that fit the general criteria shows up and the user checks which species they would like to see. Finally a list of images comes up that both fit the general search criteria and belong one of the species that the user had checked. I'm trying to decide the best way to do this, I thought about two potential ways...
One way: I can add all the checked species to a WHERE clause in the SQL statement that gives me my image search results. I dont like this though... its possible the user selects 100+ species and this would make for a very very long WHERE clause.
Another way: I could leave my SQL statement so it only takes into account the general search criteria. Then when I go to display the results, maybe I could choose not to display a record if it does not belong to a species that was checked by the user.
Here is my code through which i can generate dynamically 2 checkbox group Â
DataTable dt = new DataTable(); DataList1.DataSource = dt; DataList1.DataBind(); DataList2.DataSource = dt; DataList2.DataBind(); Â Design Page Â
[code]....
 There is two checkbox group which have same datasource, so in both case same checkbox are showing and also same event is firing for both. Here is the event code Â
protected void CheckBox_CheckedChanged(object sender, EventArgs e) { string OpService = ((CheckBox)sender).Text; } Â Now what i want to do is, while check one checkbox from the 1st checkbox group the same checkbox should be selected from the second checkbox group automatically, also if i deselect one checkbox that should be deselect from both checkbox group.