LelloLello
asked on
My asp:label doesn't show my text ID.
My If statement is working fine... I'd like to show the following label in my .ascx code. Could you please adjust my code
protected System.Web.UI.WebControls. Label searchInstructions;
protected void Page_Load(object sender, EventArgs e)
{
// Set Go Button
_ibtGo.ImageUrl = "/common/images/misc/butto n_go_grey- e.gif";
// english Category
searchInstructions.Text = "Artist Name:";
if (Sitecore.Context.Language .ToString( ) == "fr")
{
_ibtGo.ImageUrl = "/common/images/misc/butto n_go_grey- f.gif";
// french Categorie
searchInstructions.Text = "Nom de l'artiste:";
}
}
================
This is my output
-------------------------
<TR>
<TD colSpan="2">
<P><BR>
<asp:Label id="searchInstructions" for="TextBox" runat="server">Label</asp: Label></P>
</TD>
</TR>
<tr>
<td width="10%"><asp:TextBox ID="_txtSearch" runat="server" CssClass="main"></asp:Text Box></td>
<td width="90%" valign="bottom"><asp:Image Button ID="_ibtGo" runat="server" OnClick="_ibtGo_OnClick" /></td>
</tr>
protected System.Web.UI.WebControls.
protected void Page_Load(object sender, EventArgs e)
{
// Set Go Button
_ibtGo.ImageUrl = "/common/images/misc/butto
// english Category
searchInstructions.Text = "Artist Name:";
if (Sitecore.Context.Language
{
_ibtGo.ImageUrl = "/common/images/misc/butto
// french Categorie
searchInstructions.Text = "Nom de l'artiste:";
}
}
================
This is my output
-------------------------
<TR>
<TD colSpan="2">
<P><BR>
<asp:Label id="searchInstructions" for="TextBox" runat="server">Label</asp:
</TD>
</TR>
<tr>
<td width="10%"><asp:TextBox ID="_txtSearch" runat="server" CssClass="main"></asp:Text
<td width="90%" valign="bottom"><asp:Image
</tr>
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I'm not sure if this is how it is or if it was just during the posting, but the first issue I see is that your code-behind file is called "ContentSearchableListOfWo rks.asc.cs " - missing an "x". It should be "ContentSearchableListOfWo rks.ascx.c s"
Next, is this .Net 1.1? If it is .Net 2.0+, then you shouldn't be declaring all your controls in the code-behind and since you are using partial classes, I believe you are on 2.0+. This leads me to believe that the missing "x" is probably the problem.
Next, is this .Net 1.1? If it is .Net 2.0+, then you shouldn't be declaring all your controls in the code-behind and since you are using partial classes, I believe you are on 2.0+. This leads me to believe that the missing "x" is probably the problem.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
strickdd / NauticalNonsense:
it is a type error but it's good in my message. could you please advice why
// english Category
searchInstructions.Text = "Artist Name:";
is not showing the value of my label
<asp:Label id="searchInstructions" for="TextBox" runat="server"></asp:Label ></P>
Everythins is displaying so the code is correct but why is not showing the value of my label??
NauticalNonsense: Explain how can u do that i my code.
it is a type error but it's good in my message. could you please advice why
// english Category
searchInstructions.Text = "Artist Name:";
is not showing the value of my label
<asp:Label id="searchInstructions" for="TextBox" runat="server"></asp:Label
Everythins is displaying so the code is correct but why is not showing the value of my label??
NauticalNonsense: Explain how can u do that i my code.
ASKER
Hello Strick,
That the missing "x" is probably the problem. Any idea why is not working?
That the missing "x" is probably the problem. Any idea why is not working?
ASKER
Here is the code, please advice where I should put it. I'm new in C#.
ContentSearchableListOfWorks.ascx ContentSearchableListOfWorks.asc.cs
Thankyou.