Click here to Skip to main content
15,881,173 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Retrieving the connection string from web.confi Pin
MHASSANF7-Feb-10 1:09
MHASSANF7-Feb-10 1:09 
GeneralRe: Retrieving the connection string from web.confi Pin
vempatiprasad9-Feb-10 18:19
vempatiprasad9-Feb-10 18:19 
AnswerRe: Retrieving the connection string from web.confi Pin
Palash Biswas7-Feb-10 17:10
Palash Biswas7-Feb-10 17:10 
GeneralRe: Retrieving the connection string from web.confi Pin
Not Active7-Feb-10 18:27
mentorNot Active7-Feb-10 18:27 
GeneralRe: Retrieving the connection string from web.confi Pin
vempatiprasad10-Feb-10 7:42
vempatiprasad10-Feb-10 7:42 
AnswerRe: Retrieving the connection string from web.confi Pin
Krunal Berawala7-Feb-10 19:03
Krunal Berawala7-Feb-10 19:03 
GeneralRe: Retrieving the connection string from web.confi Pin
Not Active7-Feb-10 19:24
mentorNot Active7-Feb-10 19:24 
QuestionLinkButton and User Control Error Pin
AndyASPVB6-Feb-10 9:04
AndyASPVB6-Feb-10 9:04 
Hi
I have a user control, which consists of a gridview and link button. The problem being, the link button won't work! Can someone please have a look and show me why and how to solve it please!

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
System.Collections.Generic.List<UserControlProof.Model.Customer> model = new System.Collections.Generic.List<UserControlProof.Model.Customer>();
model.Add(new UserControlProof.Model.Customer() { Name = "Customer1", address = "Addr1" });
model.Add(new UserControlProof.Model.Customer() { Name = "Customer2", address = "Addr1" });
model.Add(new UserControlProof.Model.Customer() { Name = "Customer3", address = "Addr2" });
model.Add(new UserControlProof.Model.Customer() { Name = "Customer4", address = "Addr3" });




var Addr = (from m in model select m.address).Distinct();
foreach (string addr in Addr)
{
UserControlProof.Controls.CollapseableRecordset cr = (UserControlProof.Controls.CollapseableRecordset)LoadControl("Controls//CollapseableRecordset.ascx");
cr.ID = cr.UniqueID;
form1.Controls.Add(cr);
cr.DisplayName = Addr;
var filterredAddress = from m in model where m.address == addr select m;
cr.DataSource = filterredAddress;
cr.Count = filterredAddress.Count();

if (cr.Count == 1)
{
cr.ViewCustomers = true;
}
cr.DataBind();

form1.Controls.Add(new Literal() { Text = "<br />" });
}
}

protected override void OnInit(EventArgs e)
{
base.OnInit(e);

}
}


public partial class CollapseableRecordset : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{

if (!IsPostBack)
{
GridView1.Columns.Clear();

BoundField f1 = new BoundField();
f1.DataField = "Customer";
f1.ShowHeader = false;
GridView1.Columns.Add(f1);


//private string displayName;
public string DisplayName
{
get
{
EnsureChildControls();
return LabelName.Text;
//return displayName;
}
set
{
EnsureChildControls();
LabelName.Text = value;
//displayName = value;
}
}

//private int count;
public int Count
{
get
{
EnsureChildControls();
return int.Parse(LabelCount.Text);
//return count;
}
set
{
EnsureChildControls();
LabelCount.Text = value.ToString();
//count = value;
}
}

//private bool ViewCustomers;
public bool ViewCustomers
{
get
{
EnsureChildControls();
return Link1.Visible;
}
set
{
EnsureChildControls();
Link1.Visible = value;
}
}

public object DataSource
{
get
{
EnsureChildControls();
return GridView1.DataSource;
}
set
{
EnsureChildControls();
GridView1.DataSource = value;
}
}


protected void Link1_Click(object sender, EventArgs e)
{
Label1.Visible = true;
}
}}

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="CollapseableRecordset.ascx.cs" Inherits="UserControlProof.Controls.CollapseableRecordset" %>
<%@ Register Assembly="Microsoft.Practices.Web.UI.WebControls" Namespace="Microsoft.Practices.Web.UI.WebControls"
TagPrefix="pp" %>
<asp:Label ID="LabelName" runat="server" Text="Name"></asp:Label>
&nbsp;<asp:Label ID="LabelCount" runat="server" Text="Count"></asp:Label>
<asp:Panel ID="Panel1" runat="server">
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
ShowHeader="False">
</asp:GridView>
<br />
<asp:Label ID="Label1" runat="server" Text="Label" Visible="false"></asp:Label>

</asp:Panel>
<asp:LinkButton ID="Link1" runat="server" Text="View All"></asp:LinkButton>


public class Customer
{
public string Name { get; set; }
public string address { get; set; }
}
Questiondebugger does not get attached to a site Pin
sanjubaba6-Feb-10 2:54
sanjubaba6-Feb-10 2:54 
AnswerRe: debugger does not get attached to a site Pin
Abhijit Jana6-Feb-10 3:33
professionalAbhijit Jana6-Feb-10 3:33 
AnswerRe: debugger does not get attached to a site Pin
Abhishek Sur6-Feb-10 8:32
professionalAbhishek Sur6-Feb-10 8:32 
GeneralRe: debugger does not get attached to a site Pin
Hesham Amin7-Feb-10 10:05
Hesham Amin7-Feb-10 10:05 
GeneralRe: debugger does not get attached to a site Pin
Abhishek Sur7-Feb-10 10:13
professionalAbhishek Sur7-Feb-10 10:13 
QuestionCan't see localhost web application on custom web browser Pin
Yosh_5-Feb-10 23:47
professionalYosh_5-Feb-10 23:47 
Questionhow do i create website Pin
hi_everybody5-Feb-10 22:35
hi_everybody5-Feb-10 22:35 
AnswerRe: how do i create website Pin
Abhijit Jana5-Feb-10 22:37
professionalAbhijit Jana5-Feb-10 22:37 
AnswerRe: how do i create website Pin
sashidhar5-Feb-10 23:06
sashidhar5-Feb-10 23:06 
GeneralRe: how do i create website Pin
Abhijit Jana5-Feb-10 23:11
professionalAbhijit Jana5-Feb-10 23:11 
GeneralRe: how do i create website Pin
sashidhar5-Feb-10 23:13
sashidhar5-Feb-10 23:13 
QuestionTwice Login Pin
i gr85-Feb-10 21:31
i gr85-Feb-10 21:31 
AnswerRe: Twice Login Pin
Abhijit Jana5-Feb-10 21:46
professionalAbhijit Jana5-Feb-10 21:46 
GeneralRe: Twice Login Pin
i gr85-Feb-10 22:00
i gr85-Feb-10 22:00 
GeneralRe: Twice Login Pin
Abhijit Jana5-Feb-10 22:33
professionalAbhijit Jana5-Feb-10 22:33 
GeneralRe: Twice Login Pin
i gr87-Feb-10 21:12
i gr87-Feb-10 21:12 
GeneralRe: Twice Login Pin
Abhijit Jana7-Feb-10 22:56
professionalAbhijit Jana7-Feb-10 22:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.