I have a classic ObjectDataSource and a ListView in my page. The List view just displays some data and when switched to edit template it allows the user to change the values. I want the user to edit just some values -- so I bind just these ones in the edit template.
The problem is that the other values suddenly turn to nulls or 0. I tried to bind all of the values at once and it works fine, but I cannot understand why the old/original values just disappear. Is there any way how to bind the old values?
I am getting int values from the stored procedure. But when i bind this datasource with the gridview i am seeing the values being converted into float. i am using Text='<% # Bind("Quantity") %' I wanna that to be displayed as int, with out zero'seg: let the value be 233, when i bind that its getting displayed as 233.00
I have a repeater control populated with data binding expressions like in the expression below...
[Code]....
I want to be able to redirect a user to default link if the LinkURL value is empty, that is for each data item, there will be a check if the LinkURL field contains a value. If not, a default value will be supplied.
I have a grid which is binding to a objectdatasource and when it is in edit mode, i am displaying a form template and wanted to bind all the values. I have one field called ApprovedCode. In the edit mode, i am displaying all the codes drop down list box and making a bind on the selectedvalue and i dont know how to handle when it is empty. When it is empty i wanted to display "Select..."
I followed this forum post but i am getting error
[URL]
This is my code
[Code]....
This is the error message that i am receiving
"ddlApprCode' has a selectedvalue which is invalid because it does not exist in the list of items
In login control of asp.net there is a remember me checkbox. What is the functionality of this checkbox? What it does basically? Is there any way to put space between checkbox and its associated label?
I saw Windows Live login control has an extra checkbox Remember my password? How can we achieve this feature in our custom login control? I have read many tutorials but I can not able to solve my queries.
I have a question on Scott's article about binding scalar values to data controls: [URL]
On the seconde example (the one using templates), how would I access the scalar value in the controls OnItemDataBound event? e.Item.DataItem seems to be null....
i have a login, and wanted to know how i could use the remember me function, (so each time the user visits the site, even though they are not logged in, it would auto log them in) but without using the actual remember me checkbox. Is there any extra code i need to write, and if so, what?
I want to dynamically bind dataset values into datagrid's header datafield.
Is it possible? To be more clear, when you click on datagrid's (Collection) from properties window, you get selected columns created from Bound column. So in those columns I want to dynamically display dataset's table values in those columns.
i.e like ds.Tables[0].Rows[0][0].
Is it possible to do it in Datagrid ItemDataBound function like,
e.Item.Cells[1].Text = ds.Tables[0].Rows[0][0]
or something like this? I know the above code is wrong and wont work since I tried it out and while building it throwed error saying, Cannot implicitly convert type 'object' to 'string'.
im having a login control in my website with a remember me option. i check the remember me but it does not remember me. here is a part of my web.config. i browsed over the other answers on this forum but nothing :( I also have the cookies allowed
Scenario: I am creating a custom gridview control which has a custom CheckBoxTemplateField column (deriving from TemplateField class). This template field column has custom Checkboxheadertemplate (implementing ITemplate) and CheckboxItemTemplate (also implementing ITemplate). In InstantiateIn method of both templates (header as well as Item template), I am adding a checkbox control which has Autopostback = true.
My requirement is: I want to mark all the values in the binding column of datasource if checkbox in headertemplate is checked. I dont want to mark only rows visible on grid. I WANT TO MARK ALL ROWS IN DATASOURCE. I want to do this in _CheckedChanged event of checkbox in header template.
Problem I am facing: When I check/uncheck the checkbox in header, it postbacks. so in OnCheckedChanged event, gridview's datasource is null. Secondly, in any event of gridview, I could access only those rows of datasource for which corresponding rows are visible in gridview through Gridviewrow.DataItem property. But I want to set it for all rows in datasource.
What's the difference between binding for example a column called ("Name") in both cases ? and is there's any performance difference ?1- Assigning the data in the mark-up
2- defining a control object for every control inside the repeater ItemTemplate and find it and then assign the data in the column "Name" to ite.Item.FindControl("Name_Lbl")
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 am trying to bind datetimes from a database to a Calendar in a TemplateField in a GridView using C# (following the tutorial at [URL]). The datetime is nullable in the database and this apparently kills the Calendar (one entry is null). How do you modify the SelectedDate and VisibleDate to check for null values? Do you have to create a custom binding? If so, how?
Currently, I am working with ASP.NET MVC1 and am still learning about Model Binding and how values from a View are passed back to the Controller / Model. Specifically, I want take an existing Model, create a Table and populate the Rows of the Table, allow the user to edit some fields and pass it back. In my example, I have a Class called "Ingredient" which has 4 public accessories: Name, Barcode, Amount, and Unit. [Code]....
Or is this not possible? (Basically, I'm trying to re-create a datagrid where certain fields are editable and certain are not...)
I have a /Register [GET] Action in the controller that pre-poluates a view-model with a string and an integer and returns: return View(myModel);I can see the string being populated in the textarea and the id being populated in a hidden input. Yet when the form gets POSTed, the string value is null and the int value is 0. I verified that both values are posted to the server but the model received in the POST action is missing those values.
i have a GridView that has 100 rows, when i go to row 50 and select edit the gris refereshes and it goes to the top of the page so i have to scroll down in order to inset new data, How can i make the Grid to remember /return to the row that is being edited / updated?
Quick question here. I'm sure it's possilbe, just can't get it to work.
I've got a gridview. In have a gridview. The gridview is bound to a list of my custom class. The class exposes a link to an image as well as the image's height and width. I have a Image Control in the gridview. I've bound the Image Url to the correct property. Now, I'd like to bind the height and width properties as well. But everytime I do that I get the following error:
Cannot create an object of type 'System.Web.UI.WebControls.Unit' from its string representation '"<%#Bind("GetImageHeight()")%' for the 'Height' property.
I am new to c# and i have problem in using login control. I made a simple login page and it works fine but i dont know how to use the remember me next time option.
I am using the TextBoxWatermark extender ASP.NET AJAX extender this works great, but i still want to have the comfort for my users, that the textbox remembers their entries e.g.:
Login=> TextBox with UserName
- if two people are using the same computer, they don't want to type UserName each time again instead click in the box and choose their UserName or start typing and their UserName is than suggested.
It seems to be a standard funktion that a TextBox remembers the entries you did. Unforantly when using the watermark extender on a textbox it simply does not work anymore.
Is there a way to enable this ā€˛feature" again?
When looking at the example of the TextBoxWatermark ASP.NET AJAX extender: [URL] it is not working their as well.