I don't know maybe I am missing something but, why doesn't the application path automaticaly get added to controls when you regsiter them for instance. if use this <%@ Register TagPrefix="vg" TagName="Header" src="/controls/header.ascx" %> it should find the control under http://localhost/applicationpath/controls/header.ascx but instead it looks for the control under http://localhost/controls/header.asxc If I wanted you use a control outside of my application path (which would rarely happen) and I should have to specific a complete url like "http://loclahost/sometthingelse/controls/header.ascx" since it doesn't do this how do i work around this ? this doesn't work. <%@ Register TagPrefix="vg" TagName="Header" src="<%=Request.ApplicationPath%>/controls/header.ascx" %> this is something else i don't understand why can't I put runtime expression into asp tags ? I know this will probably start a flame war but I can do all of the above with jsp :)
jpribele
Posts
-
application path and controls -
Invalid path for MapPathwould Request.FilePath do what you want. It will return the virtual path of the given request. But if the path your trying use is not the currenct request that is a problem.
-
c# no concept of scope ?leppie wrote: So C is not decent. Get a life or go back to whatever decent language you were using previously. you would think a made i made a comment about your mother. PS: did you even read my reply? i did read your reply but you didn't explain the problem you just posted a work around. PSSS: You are infact constructing your IEnumerator loop incorrectly. Here is the proper way: incorrectly ? there is very little difference between the two and in my opinion the while loop is more readably, you don't have an empty statement as in your for loop. what's the deal anyways. i make a couple of comments about the quirks in the language( every language has them ) and you go off on me like i declare C# as the worst language in the world and every programmer who uses is stupid. now if i have offended anyone, i apologize. but you should remember its just another programming language. i don't think knights running around defending its honour are necessary.
-
c# no concept of scope ?so its not a bug because they say its feature. nice. any other decent language would let this code compile. oh I'll just add it to my list of screwed up things c# does
-
c# no concept of scope ?i just did that as a short example. my actual code where i found that oddity does the same thing.
-
c# no concept of scope ?what scewey logic is c# using for scope? why does the second declaration of lenum cause this code not to compile ? but j is ok ?
using System; using System.Collections; public class Test { public static int Main(String[] args) { ArrayList b = new ArrayList(); ArrayList c = new ArrayList(); for( int i = 0; i < b.Count; i++ ) { if( true ) { IEnumerator lenum = b.GetEnumerator(); while( lenum.MoveNext() ) { int j = 0; j++; } } IEnumerator lenum = c.GetEnumerator(); while( lenum.MoveNext() ) { int j = 0; j++; } } return 0; } }
-
dynamically assign tag propertiesi figured that is what somebody was going to say. I can't really do databinding. what I have to display is to complicated and dynamic that is doesn't fit the very simply repeater pattern. thanks anyways
-
Loop thru ListBox selected items?protected void Add( object obj, CommandEventArgs args ) { ArrayList tmp = new ArrayList(); for( int i = 0; i < lstBox1.Items.Count;i++ ) { if( lstBox1.Items[i].Selected ) { lstBox2.Items.Add( listBox1.Items[i] ); tmp.Add( lstBox1.Items[i] ); } } for( int i = 0; i
for the remove change lstBox1 to listBox2 you should have to worry about duplicate because if you remove the items from lstBox1 after added them to lstBox2 you can't add a duplicate no guarentees on this code. i just whipped this up joe
-
dynamically assign tag propertieshere is a simplified version of the page i have <% for( int i =0; i < 10; i++ ) { %> <% }%> this doesn't assign the value of i the commandargument is assigns <%=i%> i also tried CommandArgument='<%i%>' assigns <%i%> CommandArgument='<%#i%>' doesn't compile can't find i is this possible in .net ?
-
com+ questionI have a simple little componnent below. Why is the ouput 1 then 0 ? I don't understand why the instance variable is reset after the transaction is completed ?
using System;
using System.Runtime.CompilerServices;
using System.EnterpriseServices;
using System.Reflection;
using System.Runtime.InteropServices;[assembly: ApplicationName("TestApp")]
[assembly: ApplicationAccessControl(false)]
[assembly: AssemblyKeyFileAttribute("TestApp.snk")][Transaction(TransactionOption.Required)]
[ClassInterface(ClassInterfaceType.AutoDispatch)]
public class Test : ServicedComponent
{
protected int i;
public int I
{
get
{
return i;
}
}[AutoComplete]
public void test()
{
i++;
Console.WriteLine( i );
}
}public class client
{
public static int Main()
{
Test t = new Test();
t.test();
Console.WriteLine( t.I );
return 0;
}
}