Edit: had chance to look at it.
Sheppard earlier seems to have hit on the cause - at the end of the Ticker_Tick sub Studio will be set to 13.
Is there a reason you need to check the value so early on in the routine - you will reset it as part of the for next loop anyway.
Although the value of Studio does seem to be reference in several places - one of the downside of using global variables is that things can get confusing, plus changes can have unforseen consequences.
You maybe better of moving some of those variables into classes or structures and providing Methods / Properties to acces them - at least that way you can see when they are being modified and provide centralised validation.
You have entered text into a textbox that contains potentially dangerous or malicious content (probably HTML tags) - this is blocked by default.
If you want to allow this kind of input - open the aspx page in the html view and find the page directive <@% Page ....%> bit near the top and before the closing %> add
validateRequest=false
However this could open your website to abuse / attack.
It may be helpful if you give us a bit more background on what you are doing - there may be an easier/safer alternative.
not tested but a quick port to vb.net
Function CropSentence(ByVal strText As String, ByVal intLength As Integer, ByVal strTrial As String) As String
Dim wsCount As Integer
Dim intTempSize As Integer
Dim intTotalLen As Integer
Dim strTemp As String
Dim arrTemp() As String
wsCount = 0
intTempSize = 0
intTotalLen = 0
intLength = intLength - Len(strTrial)
strTemp = ""
If strText.Length > intLength Then
arrTemp = strText.Split(" ")
For Each x As String In arrTemp
If strTemp.Length <= intLength Then
strTemp = strTemp & x & " "
End If
Next
Return strTemp.Substring(0, strTemp.Length - 1) & strTrial
Else
Return strText
End If
End Function
Easiest way is create a class to hold the items you want and override the tostring method to return what you would like displayed.
The listbox.items.add() method takes any object and calls it's ToString method to get the text to display.
If you want to get the control to appear on the toolbox the easiest way is create a new project (or add a new project to the solution) and select windows control library.
Delete the control that's part of the project and move your control to the new project and build the solution.
If you right click on the tool box and select add/remove items (i think) and then browse for the dll that was created from the new project. Select it and your control should now appear on the toolbox.
That would have been the problem - if IIS is installed then it integrates as part of the VS installation, if it isn't the n you need to do the fix I posted above.
As to working remotely if the server has .NET framework and Frontpage extensions installed then when you create a new project you can enter a url of http://remote server/websitename and it should work.
You could throw an exception if the parameters aren't valid but that wouldn't get round this problem.
You could make the Sub new private (or protected) and provide a shared public sub that accepts the parameters and does the validation - if everything's fine it creates and returns a valid instance, if not it returns nothing.
e.g.
Public Class TestClass
Private X, Y As Integer
Private Sub New(ByVal i As Integer, ByVal j As Integer)
X = i
Y = j
End Sub
Public Shared Function CreateTest(ByVal i As Integer, ByVal j As Integer) As TestClass
If i < j Then 'Do your validation
Dim tmp As New TestClass(i, j)
Return tmp
Else
Return Nothing
End If
End Function
End Class
this can be called like
Dim t As New TestClass 'invalid
Dim t1 As TestClass
t1 = TestClass.CreateTest(1, 2) 'valid instance returned
Dim t2 As TestClass
t2 = TestClass.CreateTest(2, 1) 'nothing is returned
Just tried it here - very odd.
The buttons code behind is just
Label1.Text = RadioButtonList1.SelectedIndex.ToString
put a break point on the line and RadioButtonList1.SelectedIndex.ToString shows up as "2" in hte watch window. Step into the code and you still get the NullReferenceException
If you just selected the C++ Console application (.Net) template then by default it does use the .Net Framework.
If you went for a Win32 console project that doesn't.
If you need to check - bring up the project properties and under 'configuration properties' -> 'general' you shoul find an entry for 'Managed Extensions'.
If this is set to false then the framework is not required. However you may still need to deploy C runtime / MFC runtimes depending on other options.
You can declare a variable in the code-begind of the same name and type
e.g. If you drag a webcontrol of type mycontrol onto a webpage and it has the name mycontrol1 in the code behind declare it as
protected mycontrol1 as mycontrol
looks like the framework didn't register with IIS (happens from time to time)
what you'll need to do is the following.
Open a new command prompt
Change to the drive windows is installed in (e.g. c:\)
cd Windows\microsoft.net\framework
depending on the version of the frame work you have you will have to cd into either v1.0.3705 or v1.1.4322 - if both folders are present go for the v1.1.4322 one
then type aspnet_regiis /i and let it do it's stuff.
when it finishes - try to run the web app again and see what happens.
The problem you are having is that GetValue is a shared class member and Run isn't.
Shared members of a class work without a specific instance i.e. you could do something like
Class1.GetValue("dsafsdafsadf")
but non-shared members need a specific instance to be created i.e.
dim c as new class1
c.Run("ewrewrwerwerewr")
Is there any reason GetValue is shared? It may help if you gave a bit more background on what you are trying to do though.