difference between <script> and <%%

Results 1 to 2 of 2

Thread: difference between <script> and <%%

  1. #1
    Join Date
    Dec 1969

    Default difference between <script> and <%%

    I just wanted to know what the difference was between the &#060;script runat=server&#062; 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>&#060;script language="VB" runat=server&#062;<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() & "---&#062; "<BR> next<BR><BR> end sub<BR>&#060;/script&#062;<BR><BR>&#060;%= str %&#062;<BR>----------------<BR><BR>Thanks in advance<BR>Joel Martinez

  2. #2
    Join Date
    Dec 1969

    Default RE: difference between <script> and 

    Just 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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts