Microsoft KB Archive/279409

= BUG: WebClass ProcessTag event fails to execute =

Article ID: 279409

Article Last Modified on 10/1/2004

-

APPLIES TO


 * Microsoft Visual Basic 6.0 Learning Edition
 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition Service Pack 4

-



This article was previously published under Q279409



SYMPTOMS
When you run a WebClass project from within Visual Basic 6.0 Service Pack 4, and there is more than one WebClass tag in a Web document, the WebClass ProcessTag events may fail to execute. This does not occur if you browse the Active Server Pages (ASP) page directly.



CAUSE
This problem occurs if the previous execution of the ProcessTag event did not change the value of the TagContents variable. If your ProcessTag event never sets or modifies the value of the TagContents variable, every other tag is skipped.



RESOLUTION
To resolve this problem, while you are developing the WebClass project from within Visual Basic, set or modify the value of the TagContents variable every time the ProcessTag event executes. To do this, add the following line at the beginning of your ProcessTag event: TagContents = TagContents This line can be commented out or removed when the Web project is put into production, but it must be put back next time you run the WebClass project from within Visual Basic.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



Steps to Reproduce Behavior
  Use the following template to create a WebClass project: ProcessTag Event Test ProcessTag Event Test The following should show three lines: One, abc & Three Instead, it shows these three lines: One, Two & Three To fix this problem, uncomment the code: TagContents = TagContents One Two Three   In the WebClass project, paste the following code: Private Sub TagTemplate_ProcessTag(ByVal TagName As String, _       TagContents As String, SendTags As Boolean) 'Uncomment the following line to correct the problem. 'TagContents = TagContents Select Case TagName Case &quot;WC@ONE&quot; 'Do some work Case &quot;WC@TWO&quot; 'Do some work TagContents = &quot;abc&quot; Case &quot;WC@THREE&quot; 'Do some work Case Else 'Do some work End Select End Sub

Private Sub TagTemplate_Respond TagTemplate.WriteTemplate End Sub

Private Sub WebClass_Start Set NextItem = TagTemplate End Sub </li>  After you uncomment the following line of code: TagContents = TagContents you must refresh the page in the browser to see the change. </li></ol>

For more detailed information on how to create a WebClass project in Visual Basic, see our sample projects at the following Microsoft Developer Network (MSDN) Web sites:

WCDemo Sample Project

http://msdn.microsoft.com/library/devprods/vs6/vbasic/vb98/vbsmpwebclassdemoapplication(wcdemovbp)professionalenterpriseedition.htm

Support1 Sample Project

http://msdn.microsoft.com/library/devprods/vs6/vbasic/vb98/vbsmpsupportapplicationprofessionalenterpriseeditions.htm

Support1 WebClass Tutorial

http://msdn.microsoft.com/library/devprods/vs6/vbasic/vbcon98/vbhowCreatingaWebclass.htm

<div class="references_section">