How to use ascx.file ?

Posted by Pornima under ASP.NET on 4/15/2012 | Points: 10 | Views : 5651 | Status : [Member] | Replies : 5
Can any one help me how to use ascx file in asp.net?I have one aap.net application ,in which CSCCmb.ascx this resource file used.I want to use same resource in my new application.What should be steps .So that i can use all features in that particular file.




Responses

Posted by: Hariinakoti on: 4/15/2012 [Member] Starter | Points: 25

Up
0
Down
Check Below link
http://msdn.microsoft.com/en-us/library/26db8ysc(v=vs.85).aspx


Thanks & Regards
Hari

Pornima, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hariinakoti on: 4/15/2012 [Member] Starter | Points: 25

Up
0
Down
Check Below links

http://www.codeproject.com/KB/user-controls/myusercontrol.aspx
http://asp.net-tutorials.com/user-controls/using/

Thanks & Regards
Hari

Pornima, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hariinakoti on: 4/15/2012 [Member] Starter | Points: 25

Up
0
Down
Eg:
User Control for creating Tab

Add New Web User Control to Your Project
then Add some link button and set the properties and events

eg:

ascx code

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Menu.ascx.cs"
Inherits="ProjectName.UserControl.ComplaintCaptureMenu" %>

<div class="uc-menulinks-container">
<asp:LinkButton ID="lnkHome" runat="server" CssClass="uc-menulinks" OnClick="lnkHome_Click"
CausesValidation="False">Home</asp:LinkButton>
<asp:LinkButton ID="lbnServices" runat="server" Visible="true" CssClass="uc-menulinks" OnClick="lbnServices_Click"
CausesValidation="False" Text="Services Detail" ></asp:LinkButton>

<asp:LinkButton ID="lbnLog" runat="server" Visible="true" CssClass="uc-menulinks" OnClick="lbnLog_Click"
CausesValidation="False" Text="Log Details" ></asp:LinkButton>

</div>


ascx.cs

protected void lnkComplaint_Click(object sender, EventArgs e)
{
Response.Redirect("~/Home.aspx");
}
like that......


In Content page

First register the user control

eg:

<%@ Register Src="~/UserControl/Menu.ascx" TagName="mpMenu" TagPrefix="uc2" %>

then the control using innerpage

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

<uc2:mpMenu runat="server" ID="mpMenu1" />

</asp:Content>

Thanks & Regards
Hari

Pornima, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sabarimahesh on: 4/16/2012 [Member] Bronze | Points: 25

Up
0
Down


http://pcsupport.about.com/od/fileextensions/f/ascxfile.htm

Life is a Race
Thanks & Regards
By
Sabari Mahesh P M

Pornima, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sabarimahesh on: 4/16/2012 [Member] Bronze | Points: 25

Up
0
Down
http://wiki.asp.net/page.aspx/379/ascx/

Life is a Race
Thanks & Regards
By
Sabari Mahesh P M

Pornima, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response