Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / April 2008

Tip: Looking for answers? Try searching our database.

CompilationError

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
CreativeMind - 30 Apr 2008 16:21 GMT
hi,
can anyone guide me plz.
i m adding attribute of runat=server from codebehind file
    <asp:imagebutton id="imgCompletionDate" CssClass="clImageButton"
ImageAlign="absMiddle"    BorderStyle="None" ImageUrl="..images
\img1000024.gif" CausesValidation="False"    Height="20"></
asp:imagebutton></TD>
in code behindfile method
imgCompletionDate.Attributes.Add("runat","'server'");

, but it gives error CS1040: Preprocessor directives must appear as
the first non-whitespace character on a line and shows
the line which binds data at runtime. that is
<TD align="left" valign="top" class="GridCell" height="25px">
<%#DataBinder.Eval(Container, "DataItem.DocumentTitle")%>
</TD>
thx
bruce barker - 30 Apr 2008 20:38 GMT
run can not add the runat=server from the codebehind. it makes no sense. the
point of the attribute is to parse the html into a standalone control, and
add to the controls collection. to apply the attribute server side imples
that it has already happened.

also you databind expression is invalid because it can only be applied to
server control properties.

-- bruce (sqlwork.com)

> hi,
> can anyone guide me plz.
[quoted text clipped - 13 lines]
> </TD>
> thx

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.