Hello everyone,
Ive tried searching for hours now and cannot find out why my code (aka, me.) is failing
Basically... I have a listview control which I'm passing a datatable of products (ID, Name, Description and Price columns), and im trying to make it so that when the "checkout" button is pressed, it parses through all the controls on...
I have two user controls A and B, where B depends on the existence of A in the same page.
I'm trying to implement some functionality like this:
<mine:A ID="IdOfTheAControl" runat="server" />
<mine:B BelongsTo="IdOfTheAControl" runat="server" />
I'm able to extract "IdOfTheAControl" but unable to get the actual control with that ID. I...
Does FindControl() work quick or not?
Have I to cache a result using a property like this or not if I search and use the same control a number of time?
private MyUserControl c;
private MyUserControl MyC {
get {
if(c == null) c = (MyUserControl)FindControl("c");
return c;
}
}
...
Hai guys,
I used find control to find a list item of an unoreder list inside a master page from content page using this,
Control home = this.Page.Master.FindControl("list").FindControl("home");
Now i have to change the id of the control home to "current" because to apply css for it....
...
I have a repeater which displays comments related to a post.
I want to add some functionality where when the user click on the link it goes from:
report this post
to
post has been flagged
how do I access the specific lnkButton? Obviously in ItemDataBound this is easily done, but in the click method I'm not sure how I would do it.
...
ASPX : Code
<asp:repeater id="repeater" runat="server">
<headerTemplate></headerTemplate>
<itemtemplate></itemtemplate>
<footerTemplate> <asp:literal id=findme runate=server> </footerTeplate>
</asp:repeater>
What i am looking for is source code to be able to find the control within the footer of a data repeater. Im...
HI
I have a DataGrid (yes would be nicer if it was a gridview but nothing i can do about that)
in the itemDataBound event i am adding a hidden field into the first cell of each row
I am setting its ID based on something, and then saving its clientID in a List for later attempts to get the value from it
but try as i might i cant find a...
On the base.master:
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Base.master.cs" Inherits="WebApplicationControlTest.Base" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<...
Hi All,
I use a WebServerControl "CheckBoxCounter", which has the following method. But the method is unable to find the CheckBoxList on the page. I'm searching for an answer for nearly a day now... can you help me... The WebServerControl is in a namespace "AWT.AID.Services", but there is no namespace for the ASPX page / code Behind,...
Hello All,
I currently have a dropdown inside an ascx control. I need to "find" it from within the code behind on another ascx that is on the same page. It's value is used as a param to an ObjectDataSource on ascx #2. I am currently using this ugly piece of code. It works but I realize if the conrtol order were to change or various othe...
Hi,
I am trying to access a LinkButton that is inside a PagerTemplate in a GridView.
However, I am getting a NullReferenceException and I don't know what I am doing wrong here.
I have tried the following...
((LinkButton)GridView1.BottomPagerRow.FindControl("lnkbtnPrevious"));
((LinkButton)GridView1.FindControl("lnkbtnPrevious"));
C...
Im new to C# and in VB i could do the following:
Protected Sub DataGrid1_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles DataGrid1.ItemCommand
If e.CommandName = "CommandName" Then
Dim label1 As Label = e.Item.FindControl("label1")
Response.Writ...
Why method FindControl() returns null on FormView until call DataBind().
After that it returns everything correctly?
What workaround are there?
Call DataBind() before first call of FindControl() ?
...
Existed MyControl1.Controls.OfType<RadioButton>() searches only thru initial collection and do not enters to children.
Is it possible to find all child controls of specific type using Enumerable.OfType<T>() or LINQ without writing own recursive method? Like this.
...
I have a number of pages
<%@ Page Language="C#" AutoEventWireup="True" CodeBehind="MyPage.aspx.cs" Inherits="MyPage " MasterPageFile="~/Site.master" %>
<asp:Content ContentPlaceHolderID="commonForm" runat="server">
<asp:Table runat="server">
<asp:TableRow>
<asp:TableCell ID="cellControl" />
</asp:TableRow>
</asp:Table>
</asp:C...
x.Parameters.AddWithValue("@areasexpertise1", FindControl("AreasExpertise1"))
It should find AreasExpertise1 and make a parameter, but does that get the selectedvalue too?
...
I am writing an ASP.NET custom control.
In my custom control code, I find a PlaceHolder control in the page like so:
this.myPlaceholder = Page.FindControl("placeholder1") as PlaceHolder;
Then, I render the placeholder as the output of the custom control:
protected override void Render(HtmlTextWriter output)
{
if (this.myPlacehol...
<%@ Register Src="~/Controls/PressFileDownload.ascx" TagName="pfd" TagPrefix="uc1" %>
<asp:Repeater id="Repeater1" runat="Server" OnItemDataBound="RPTLayer_OnItemDataBound">
<ItemTemplate>
<asp:Label ID="LBLHeader" Runat="server" Visible="false"></asp:Label>
<asp:Image ID="IMGThumb" Runat="server" Visible="false"></asp:Image>
...
I'm using this code to check if the standard toolbar is deactivated in the edit mode.
CommandBarControl oNewMenu = Application.CommandBars("Worksheet Menu Bar").FindControl(1, 18, 1, True, True)
If (IsNull(oNewMenu)) Then
MsgBox "Edit mode enabled"
End If
but the FindControl function raise an error. Is there any conflict in...
So all I want to do is simply find a user control I load based on a drop down selection. I have the user control added but now I'm trying to find the control so I can access a couple properties off of it and I can't find the control for the life of me. I'm actually doing all of this in the master page and there is no code in the default....