|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
need help in web user controli've developed web user control using C#.net here is the code <%@ Control Language="c#" AutoEventWireup="false" Codebehind="TeachingStaff.ascx.cs" Inherits="SchoolAdmin.TeachingStaff" TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%> <% strFtype= Session["Ftype"].ToString(); %> <TR> <TD style="WIDTH: 29px; HEIGHT: 2px"><IMG height="20" alt="" src="Images\students.png" width="20"></TD> <TD style="WIDTH: 264px; HEIGHT: 2px"> <asp:HyperLink id="hplStaffDeatils" runat="server" NavigateUrl="SA_StaffEdit.aspx" Font-Size="X-Small" Font-Bold="True" Font-Names="Verdana"> StaffDetails</asp:HyperLink></TD> </TR> <%If (strFtype="Non Teaching") Then%> <TR> <TD style="WIDTH: 29px; HEIGHT: 1px" vAlign="top"><IMG height="20" alt="" src="Images\teaching.jpg" width="20"></TD> <TD style="WIDTH: 264px; HEIGHT: 1px" vAlign="top"> <asp:HyperLink id="hplTeachingDetails" runat="server" Font-Names="Verdana" Font-Bold="True" Font-Size="X-Small" NavigateUrl="SA_TeachingDetails.aspx">Teaching Details</asp:HyperLink></TD> </TR> <%End If%> <TR> <TD style="WIDTH: 29px; HEIGHT: 2px" vAlign="top"><IMG height="20" alt="" src="images\Exit.png" width="20"></TD> <TD style="WIDTH: 264px; HEIGHT: 2px" vAlign="top" align="left"> <asp:HyperLink id="hplLogOut" runat="server" Font-Names="Verdana" Font-Bold="True" Font-Size="X-Small" NavigateUrl="default.aspx">LogOut</asp:HyperLink></TD> </TR> when running the application i'm getting error in this line <%If (strFtype="Teaching") Then%> and the error is CS1002: ; expected what i want is if strFtype="Non Teaching" then i have to make teaching details hyperrlink as invisible. for this i've written code like that. i wnat to make that control in visible in html view only not in page load event of that user control. so can anybody tell me how to do that one? thanks in advance yoshitha The line is written in VB when you're using C#. You cannot mix and match.
Overall, however, you need to get away from the old ASP embedded model and use the ASP.NET model instead. -- Show quoteHide quoteChristopher A. Reed "The oxen are slow, but the earth is patient." "yoshitha" <gudivada_***@yahoo.co.in> wrote in message news:%23EhPx6zIGHA.3696@TK2MSFTNGP15.phx.gbl... > hi > i've developed web user control using C#.net > > here is the code > > > <%@ Control Language="c#" AutoEventWireup="false" > Codebehind="TeachingStaff.ascx.cs" > > Inherits="SchoolAdmin.TeachingStaff" > TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%> > > <% > strFtype= Session["Ftype"].ToString(); > %> > > > <TR> > <TD style="WIDTH: 29px; HEIGHT: 2px"><IMG height="20" alt="" > src="Images\students.png" > > width="20"></TD> > <TD style="WIDTH: 264px; HEIGHT: 2px"> > <asp:HyperLink id="hplStaffDeatils" runat="server" > NavigateUrl="SA_StaffEdit.aspx" > > Font-Size="X-Small" > Font-Bold="True" Font-Names="Verdana"> StaffDetails</asp:HyperLink></TD> > > </TR> > > <%If (strFtype="Non Teaching") Then%> > > <TR> > <TD style="WIDTH: 29px; HEIGHT: 1px" vAlign="top"><IMG height="20" alt="" > > src="Images\teaching.jpg" width="20"></TD> > <TD style="WIDTH: 264px; HEIGHT: 1px" vAlign="top"> > <asp:HyperLink id="hplTeachingDetails" runat="server" > Font-Names="Verdana" > > Font-Bold="True" Font-Size="X-Small" > NavigateUrl="SA_TeachingDetails.aspx">Teaching > Details</asp:HyperLink></TD> > </TR> > > <%End If%> > > <TR> > <TD style="WIDTH: 29px; HEIGHT: 2px" vAlign="top"><IMG height="20" alt="" > > src="images\Exit.png" width="20"></TD> > <TD style="WIDTH: 264px; HEIGHT: 2px" vAlign="top" align="left"> > <asp:HyperLink id="hplLogOut" runat="server" Font-Names="Verdana" > Font-Bold="True" > > Font-Size="X-Small" > NavigateUrl="default.aspx">LogOut</asp:HyperLink></TD> > </TR> > > > when running the application i'm getting error in this line > > <%If (strFtype="Teaching") Then%> > > and the error is CS1002: ; expected > > what i want is if strFtype="Non Teaching" then i have to make teaching > details hyperrlink as > > invisible. > > for this i've written code like that. > > i wnat to make that control in visible in html view only not in page load > event of that user > > control. > > > > so can anybody tell me how to do that one? > > thanks in advance > yoshitha > > > > > > > > > > > > |
|||||||||||||||||||||||