jl39775
Dec 10th, 2002, 01:12 PM
I have the following code in my Page_load event. Can someone tell me how I can add carriage returns at the end of each line of my javascript string? When VB renders the HTML I want my javascript to look nice. At the moment my javascript is written on one line.
Dim sScript As String
sScript = "<script language=javascript> "
sScript += "Function Wait(agr)"
sScript += "{"
sScript += "document.body.style.cursor='wait';__doPostBack(agr, '');"
sScript += "}"
sScript += "function __doPostBack(eventTarget, eventArgument)"
sScript += "{"
sScript += "var theform = document._ctl0;"
sScript += "theform.__EVENTTARGET.value = eventTarget;"
sScript += "theform.__EVENTARGUMENT.value = eventArgument;"
sScript += "theform.submit();"
sScript += "</script>"
If (Not IsClientScriptBlockRegistered("MyScript")) Then
RegisterClientScriptBlock("MyScript", sScript)
End If
Company.Attributes.Add("onChange", "Wait('Company','');")
Thanks
James
Dim sScript As String
sScript = "<script language=javascript> "
sScript += "Function Wait(agr)"
sScript += "{"
sScript += "document.body.style.cursor='wait';__doPostBack(agr, '');"
sScript += "}"
sScript += "function __doPostBack(eventTarget, eventArgument)"
sScript += "{"
sScript += "var theform = document._ctl0;"
sScript += "theform.__EVENTTARGET.value = eventTarget;"
sScript += "theform.__EVENTARGUMENT.value = eventArgument;"
sScript += "theform.submit();"
sScript += "</script>"
If (Not IsClientScriptBlockRegistered("MyScript")) Then
RegisterClientScriptBlock("MyScript", sScript)
End If
Company.Attributes.Add("onChange", "Wait('Company','');")
Thanks
James