Hi Imar,
I am developing a web project(vs 2005 & MsAccess) with
vb.net .In my Home page I want to give some updates as alerts when a end user access or refresh the page.Here I am using RegisterStratupScript method to give alerts to page onload method.every thing is alright means I am getting only one alert ,it means the page is emiting only one alert. I want give 2 to 3 updates as alerts by calling RegisterStartupScript method.please help me how can I do it.I tried in many ways and searched google also. thanks in advance.
I am giving my code here.
Dim count as Integer=ds.Tables(0).Rows.count
Dim i as Integer
For i =0 to count
If i>=count then
exit For
Else
Dim dr As DataRow=ds.Tables(0).Rows(i)
Dim strNews As String=dr("News")
Dim strDate As dateAndTime=dr("startdate")
Dim strMsg As String=strNews & "" & strDate
Dim strScript As String="[script language=JavaScript]function Page_load(){alert('" & strMsg & "');}"
strScript +="[/"
strScript +="script]"
Dim s As String=convert.ToString(i) 'key value
Dim strAlert(count) As String 'string value
strAlert(i)=strScript
If not page.IsPostBack then
If not ClientScript.IsStartupScriptRegistered(s) then
ClientScript.RegisterStartupScript(s,strAlert( i))
End If
End If
End if
Next
In my table I have 3 updates,with above coding I am getting 3rd update only,Please help me how to get 3 updates as alerts.Sorry for my poor English,
Thanks in advance.
shanwaj