User Control

Reply Forum
Forum postphi11ip @ 2009-04-16 19:32:44
ReplyReply to
Hello everyone...

I'm trying this tutorial, and i'm new in programming asp .net and csharp, i have a problem with the loading of the user control, i'm working in the same page i didn't create a new one ,i register it like this :

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register TagPrefix = "My" TagName = "UserInfoBoxControl" src ="~/UserInfoBoxControl.ascx"%>

after the page declaration, like it says the tutorial, i'm right? and actually it works!

but when i add the instance of the user control it doesn't do anything, i add the instance like this:

<form id="form1" runat="server">
<div>
<asp:Label runat="server" id="HelloWordLabel"></asp:Label>
<br />
<asp:TextBox ID="TextInput" runat="server" ></asp:TextBox>
<br />
<asp:Button ID="GreetButton" runat="server" Text="Say Hello" OnClick="GreetButton_Click" />
<br />
<asp:DropDownList ID="GreetList" runat="server" AutoPostBack ="true" OnSelectedIndexChanged = "GreetList_SelectedIndexChanged">
<asp:ListItem Value = "No One">No One</asp:ListItem>
<asp:ListItem Value = "World">World</asp:ListItem>
<asp:ListItem Value = "Universe">Universe</asp:ListItem>
</asp:DropDownList>
<My:UserInfoBoxControl runat = "server" id= "MyUserInfoBoxControl" />
</div>
</form>

And it didn't shows any error in the code, the problem is when i'm loading the page, it didn't show anything, it says that maybe i'm not coneccted to the internet or there is a problem with my web site or the url it's wrong...

can anyone please tell me what it's wrong?...
please,please...

10x, in adv




Forum postWebmaster @ 2009-04-24 08:09:44
ReplyReply to
But does it work without the UserControl? Because to me, it seems like a more general problem, not really related to the UserControl, unless I'm missing something :)











© net-tutorials.com 2006 - 2012

MailContact net-tutorials.com