Ok.. where to start...<BR><BR>I am trying to display a HTML table on a ASPX page only in certain circumatances only. <BR><BR>I had it working when I put the ASPX if statement in the void Page_Load but this is not what I want as it should not be at the top of the page. I want it to execute in the middle of the HTML page. I attempted to put the method in a script block up top and then call it from the point I want it but I get this error. <BR><BR>": CS1520: Class, struct, or interface method must have a return type" <BR><BR>Here is the code <BR><%@ Page language="C#" debug="true" Inherits="LoginFunc" src=http://aspmessageboard.com/archive/index.php/"CodeBehind.cs" %><BR><html><BR> <head><BR> <title>User Screen</title><BR> <BR> <script language="C#" runat="server"><BR> <BR> static void Edit_User()<BR> {<BR> if(Request.QueryString["user"]=="edit")<BR> { <BR> Response.Write("<tr><td width='18%'><font face='verdana' size='2' color='#000099'><b>Select User to be Edited:</b></font></td><td> </td></tr>");<BR> /*Call a fuction from the code behind file */<BR> //FuncSelectUser();<BR> }<BR> }<BR> </script><BR><BR> <BR> <BR> </head><BR> <body><BR> <br /><BR> <br /><BR> <br /><BR> <form runat="server"><BR> <table border="1" width="100%"><BR> <script language="C#" runat="server"><BR> <BR> Edit_User();<BR> <BR> </script><BR> <tr><BR> <td colspan="2"><hr /></td><BR><BR>So how do i call it at this time with out getting that error?<BR><BR>Thanks in advance<BR><BR>Lsomeone must be able to figure it out, maybe I will forward it to the software engineers if I can get an answer ill get back to you guys.<BR><BR>Lshow your code behind file with the method you callThe method is in the document I copied and pasted not in the code behind fileI dont think you can have script blocks once your start writing HTML. What I would try is make a label and then set the text of that label to be blank when you dont want to show the table and set it to the html of a table when you do. So something like.<BR><BR><script runat=server><BR>sub ButtonClick(obj as object, e as eventArgs)<BR> mylabel.Text = "<table><tr><td></td></tr></table><BR>end sub<BR></script><BR><BR><body><BR><asp:label id="mylabel" runat="server"/><BR><asp:button id="my Button" onClick="ButtonClick" runat="server" /><BR></body><BR><BR>Hope that works for yayou can use script tags anywhere inside the HTML... You can even call a function or sub that is in the code behind file.<BR><BR>i would put a table tag in your HTML whereever you want it... then give it an ID and a runat="server" and visible="false"<BR><BR>then in your page load... if whatever criteria is met for it to display... chance the visible property to true... and then generate the innerHTML for it... not sure if innerhtml works on tables though.. you might have to build it with row and cell objects.