difference between <script> and <%%

WrormLogsmola

New Member
I just wanted to know what the difference was between the <script runat=server> tags, and the old style ASP blocks<BR><BR>there&#039s obviously a difference because I guess objects are not persisted between them... I tried to print out something that worked great in the PageLoad sub, in another render block, and I got this error:<BR>--------------------<BR>Compiler Error Message: BC30455: No argument specified for non-optional parameter &#039Number&#039 of method &#039Conversion.Function Str(ByVal Number As System.[Object]) As String&#039.<BR>--------------------<BR><BR>This is my code:<BR>---------------------<BR><script language="VB" runat=server><BR> Sub Page_Load(Source as Object, E as EventArgs)<BR><BR>&#039connect to a DB and get a dataset<BR><BR>dim str as string<BR> for each item in ds.tables("dsName").rows<BR> str &= item("Item_ID").tostring() & "---> "<BR> next<BR><BR> end sub<BR></script><BR><BR><%= str %><BR>----------------<BR><BR>Thanks in advance<BR>Joel MartinezJust a guess (since I still haven&#039t got the SDK installed) but your variable str is defined within the scope of Page_Load, so it&#039s a local, not a page-level variable and can only be used within that Sub.<BR><BR>Dunc
 
Back
Top