Say I have a table which as two fields Category and Subcategory. There are multiple sub categories under a particular category. when displaying in grid it shows all subcategories along with the category which is the same is this case.
How can I display records so that the category is displayed only once and all subcategories are displayed.
I have the SelectIndexChanged event wired to my CheckListBox but it does not fire when the last item is unchecked. Is that a bug or do I have to set some property that would alow the event to be fired.
I have a webform that gives the user the option to submit 5 referrals. Currently I only have 1 checklistbox that gives the user a choice to select products of interest for all the referrals. I would like to add a checklistbox under each referral input field in case there are different product interest for each referral? So when the referral gets a confirmation email it contains the product of interest that is specific to that referral.
i my website i am using Repeater control which further contain checkboxlist control. Now my problem is that i have successfully bind "Parameter Type" in repeater control but when i am binding checkbox values, it does't appears in display
<asp:Repeater ID="Repeater1" runat="server"> <ItemTemplate> <h4> <%#Container.DataItem%></h4> <asp:CheckBoxList ID="chkParList" runat="server" RepeatDirection="Horizontal" DataTextField = > </asp:CheckBoxList> <br /><br /> </ItemTemplate> <SeparatorTemplate> <hr /> </SeparatorTemplate> </asp:Repeater> In *.cs file following are my code IMonitoringDataInfo objMonitoringDataInfo = new ChannelFactory<IMonitoringDataInfo>("MonitoringDataInfo").CreateChannel(); Collection<ParameterDetailDTO> clParameterDetailDTO = objMonitoringDataInfo.GetAllParameters(idList, out errorCode); var parameters = (from resx in clParameterDetailDTO select resx.ParameterType).Distinct(); Repeater1.DataSource = parameters.ToList(); Repeater1.DataBind(); counter = Repeater1.Items.Count; while (i < counter - 1) { foreach (var parType in parameters) { var items = from resx in clParameterDetailDTO where resx.ParameterType.ToLower().Contains(parType.ToLower()) select new { resx.ParameterName, resx.ParameterID }; ((CheckBoxList)(Repeater1.Items[i].FindControl("chkParList"))).DataSource = items; ((CheckBoxList)(Repeater1.Items[i].FindControl("chkParList"))).DataTextField = "ParameterName"; ((CheckBoxList)(Repeater1.Items[i].FindControl("chkParList"))).DataValueField = "ParameterID"; ((CheckBoxList)(Repeater1.Items[i].FindControl("chkParList"))).DataBind(); } i++; }
i have a checklistbox that is databound during Page_Init in an
If (!Page.IsPostBack)
block. the user can then check off certain values, and click an asp.net button which posts back the form and renders a crystal report on the same page.
i need to be able to determine which items were checked in the control so that they can be used as parameters in the crystal report. rendering must be done during Page_Init.
the checklistbox object is on the page during design time; only the items are dynamic.
i tried using the Request.Form object during Page_Init to obtain the checkboxlist's items but either i didn't code it correctly or it can't be done that way...
can the checkboxlist items' values be obtained during Page_Init, and if so, how?
I am trying to build a custom composite control, which allows me to add custom content to each child control. It's a similar concept to what you have with a GridView and TemplateColumn. The markup used to place the control on the page would end up being something like this:
[Code]....
I have the code below, which allows me to put that markup on the page without throwing any errors, and it renders all the correct HTML, except it doesn't render the contents of the ColumnTemplate. I have replaced the Render() code with a comment because it's quite long winded and doesn't add anything important here:
[Code]....
I have tried to follow examples on MSDN and other forums but I can't make this work. I think I'm missing the code to render the contents of the template, but I don't know how to hook that up.
What I'm trying to do is rather basic, but I might have my facts mixed up. I have a details page that has a custom class as it's Model. The custom class uses 2 custom objects with yet another custom object a property of one of the 2. The details page outputs a fair amount of information, but allows the user to post a comment. When the user clicks the post button, the page gets posted to a Details action that looks something like this:
[AcceptVerbs(HttpVerbs.Post)] public ActionResult Details(VideoDetailModel vidAndComment) { ....} [Code]....
The only fields on the form that is posted are CommentText and VideoId. Here is what the VideoDetailModel looks like.
public class VideoDetailModel { public VideoDetailModel() { [Code].... I suppose if I added more form fields for the properties I need, they would get posted, but I only need 1 form entry field for the CommentText. If I could get the same Model objects value that were sent to the page to post with the page, it looks like the solution is rather simple. I think using the RenderPartial in the middle of a form is problematic somehow to how the form gets written in html. I can't really put my finger on why things went bonkers, but if I do my RenderPartials before my form and then begin my form with the text entry field and the hidden VideoId, the default ModelBinder works just fine. I was beginning the form, writing the hidden VideoId, rendering several partial views, create my CommentText field, and then closed the form out. The CommentText field would get bound just fine. The hidden VideoId would not. Maybe I missed a rule somewhere about using RenderPartial.
For completeness, the partial view I was rendering took a Comment object and just wrote out it's CommentText data. Several of these objects would exist for a single Video object. All of this data was in a custom type and passed into the View (the main view) as it's Model. This partial view did not have a form and did not have any data entry fields.
I want to create a custom control where I define several specifically named DIV sections. The code-behind logic of the custom control will perform operations on these named DIV sections. The page where the custom control is hosted needs to be able to add named controls to the DIV sections and perform operations on these named controls added to the DIV sections.
Let me explain a little further. In the custom control, I want to have code behind logic that fires the following Page Event and uses a condition to make one or another specifically named DIV section visible or not:
< _ ToolboxData("<{0}:BaseDetails runat=""server""></{0}:BaseDetails>") _ > _ Public Class BaseDetails
[code]...
how can I create a custom control which is able to generate the named DIV sections "DetailsNameDiv1" and "DetailsNameDiv2" where my custom control can check a condition and make one or the other visible. Also, I need to be able to add controls to these named DIV sections when I host the custom control and the control that I add to the named DIV section needs to let me set values of these controls from the code behind logic of the page (or usercontrol) where the custom control is being hosted (in my example, I am adding TextBox controls that I want to set the Text property from a SQL Data Reader).
I'm creating a custom ASP.Net GridView and I want to be able to alter the __EVENTARGUMENT value but I can't figure out how to capture the returned value on the server side.
I'm creating the ability to have a collapsible representation, so the first level is the standard GridView and I will insert additional rows via JavaScript if they expand the first level row.
My problem is how to create a link on the selecond level rows that posts back with custom data.
I've been trying to get a custom validator component working that ensures at least one checkbox from a checkboxlist has been checked. I've been used some code I found on dotnetjunkies.com but the client-side validation didn't work. I've been attempting to modify it to get the client-side javascript validation to work with no luck. Basically, I compile the below code into a DLL and add it to my bin folder.
I have created a really simple custom control to render panels into a page. The code is below. When I use my control and add any webcontrol to it, after each page postback the contents of these child controls vanishes.
I must have missed something really simple but run the example to reproduce this. Can anyone please enlighten me as to why the controls are being 'emptied' of their contents, and how I stop this occuring?
I'm building an n-tier application, with the web client and the class library separate. I'm also using the factory pattern of development, using interfaces to act as containers for different objects they are associated with. The problem I'm expreriencing is that I declared a public interface class in the class library and I can create an instance of it in in my aspx pages but whenever I declare it in my custom control code-side, i get an error, like so:
Error 20 The type or namespace name 'IContentMaker' could not be found (are you missing a using directive or an assembly reference?)
notge that I have inherited the class library namespace using the 'using' keyword just in case you are wondering. My code is like so:
using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using TQO_Classes ; //importing the class library project public partial class PageContentMgr : System.Web.UI.UserControl { private IContentMaker _data; //this line throws the error, it works fine on aspx pages
I have an ASP.net web application project written in VB. Am trying to test a cobbed-together "MyTreeview" control put together from C# code that's been converted.
I think this will come "close" to what I'm trying to do - just get a treenode to have a CSS tag and render properly.
I have an App_LocalResources directory and a file called CustomTreeNode.vb. Inside that file is the following code:
I have a Custom Server Control with a Collapsible Panel Extender. I want to be able to keep the Collapsable state (open or closed) when doing a Post Back.
Iam developing a custom checkbox control deriving from the 'compositecontrol' which i need to use it for a composite control purpose.
public class TngCheckBox : CompositeControl {
i have written the required properties which are working fine except the "checked" property. here is my code for 'checked' property. i tried both the below ways (commented one and not commneted) . the problem is the 'checked' value is not setting the value at the get set part of the property.its assigning the value at the design time , but when i check and uncheck its not updating the property value.which is resulting me wrong .
Iam developing a custom checkbox control deriving from the 'compositecontrol' which i need to use it for a composite control purpose.
public class TngCheckBox : CompositeControl {
i have written the required properties which are working fine except the "checked" property. here is my code for 'checked' property. i tried both the below ways (commented one and not commneted) . the problem is the 'checked' value is not setting the value at the get set part of the property.its assigning the value at the design time , but when i check and uncheck its not updating the property value.which is resulting me wrong .