Home All Groups Group Topic Archive Search About
Author
27 Jan 2006 12:39 PM
yoshitha
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">&nbsp;
  <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">&nbsp;
  <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">&nbsp;
  <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

Author
27 Jan 2006 1:35 PM
Christopher Reed
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.
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."

Show quoteHide quote
"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">&nbsp;
>  <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">&nbsp;
>  <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">&nbsp;
>  <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
>
>
>
>
>
>
>
>
>
>
>
>
Are all your drivers up to date? click for free checkup

Author
2 Feb 2006 2:32 PM
NS
Please spend  some Time learning CodeBehind techniques.
U 'ld never want to code that way .

Bookmark and Share

Post Thread options