How can I pass a value from Javascript to VB.NET?
87907
The previous answer is correct.  The Javascript prompt just gets the value into the CLIENT side - it does not invoke the SERVER side, where the aspx runs.  Somehow, after you do this, you have to send the request to the server.\n\nLogically, in you application, is there a form the user is filling in?  If so, pass the value in the form as a hidden field or on the query string.\n\nOr, are you wanting to end the current page right after the prompt, and go directly to the page the aspx builds?  If so, immediately after your prompt, do a\nlocation.replace="http://...nameofpage?valueInAspx="+variablevalue\nand pick in up in the request collection.
999825
textbox1.text = date.today()\nOr\ndateTimePicker1.value = date.today()
935764
u get all the values from an input table or something...assign the inputs to variables..code the update button to input those variable values into the database
796435
Hello,\n\nWell, I havent used VB 6 for a long time (i using c++ now) but if I not mistaken it does write integer and infact any data type (including the ones you may have created yourself) to files...\n\nIt'd be better if you could post your code.\n\n[]s
743647
Dim i, total As Integer\ntotal = 0\nFor i = 0 To Integer.Parse(TextBox1.Text) Step 2\n     total += i\nNext\nMsgBox(total.ToString())
282906
Try using an includes file. If you have the VB script, then you can either put it into a file called VB.inc and then reference it like this:\n<!--#include virtual="VB.inc"-->\n\nThis should all you to use the code you currently have in your site. If you want to write to the page, try using\n<script language="visualbasic">\n//your script here.\n</script>\n\nFinally you can save it as a vbscript and reference it as shown above. \n\nGood luck!
329175
I'm assuming your accessing it from another class? \n\nPrivate declaration stops this from occuring. You need to provide a public property ie.\n\nprivate _str as string = ""\nPublic Property etc as string\nGet\nreturn _str\nEnd Get\nSet(value as string)\n_str = value\nEnd Set\nEnd Property\n\nOtherwise if you are accessing a class-scope variable normally, you could do:-\n\nPublic class Class1\n Private Str as string = ""\n Private Sub New()\n   Str = "Hehehe"\n End Sub\nEnd Class\n\nQuestion wasn't clearly stated, but i think that should answer it...
475336
since you probably know how to get the X,Y coord relative to the form, all you need to do is add the X,Y coordinates of the form itself. that is, just add me.Location.X and me.Location.Y\n\nhere is something i wrote just now. when you click anywhere on the form, it changes the button text to be the x,y coordinates relative to the top left corner of the screen.\n\n    Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown\n        Button1.Text = (e.X + Me.Location.X) & " " & (e.Y + Me.Location.Y)\n    End Sub
234455
Try PlanetSourceCode:\n\nhttp://www.planetsourcecode.com/vb/default.asp?lngWId=4
673564
It appears to be a string function, one that looks at the character at the position indicateded.  Don't quote me on VB syntax, but something like this \n\nvar string mystring = "Hello";\nmystring.IndexOf('e');  <-- this would give you a value of "1" (one), assuming the indexing starts at zero.
470920
I am assuming that the code - \nstrSQL = "SELECT * FROM tbl_Hardware WHERE Hardware_ID = 2" \n\nis in a <script language=vbscript> block....\n\nIf I am correct, then that part of the code will be available on the client side, whereas the code that you have in the <%%> block is a sever side code available on the server side.\n\nIf the value of strSql does not change on the client side then one way of doing this is\n\n<%\ndim sql\nsql = "SELECT * FROM tbl_Hardware WHERE Hardware_ID = 2" \n%>\n<script language=vbscript>\nstrSQL = <%=sql%>\n </script>\n<%\nSet rs = cnnLogin.Execute(sql)\n%>\n\nIf the Value of the strSQL changes on the client side, then you need to pass it back to the server on submit using some sort of hidden fields.\n\n-jainnys\nMind Experts Inc\nhttp://www.mindexp.com
1044662
There can be different ways. Let me just state two.\n\n1. Declare a public variable in the general declaration section.\n2. Assign the value to that variable\n3. And just print the value of that variable on the other form.\n\nThe other way is just to use ADO(ActiveX Data Objects) to transfer data from one form to the other.
290269
'first of all you'll have to declare your variables\n'this is only mini code for you, i'll not do yer homework :P\nDim credit As Integer\n    Dim Days As Integer\n    'i'm not sure if you can case them aswell, i'm not building the app for ye, you can do it yourself\n    Private Sub RadioButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadioButton1.Click\n        If RadioButton1.Checked = True Then\n            credit = 0\n        End If\n    End Sub\n    Public Sub GradeSelector()\n        Dim TotalGrade As Integer = credit + Days\n        Dim FinalScore As Integer\n        'i'm going to take it groupbox 1 has 3 radio buttons\n        FinalScore = TotalGrade\n        'sorting out the final grade\n        Select Case FinalScore\n            Case TotalGrade = 0\n                textbox.text = "f"\n            Case TotalGrade = 3\n                textbox.text = "e"\n        End Select\n\ni've left out a lot of the code, but ye can probably see where its goin, enjoy coding\n\nR3dm0
1151425
it's been a while since i've used VB but give this a try\n\nIF (listbox.listitem[0].selected) AND (listbox.listitem[1].selected) THEN\nEND IF
787937
This example sets the value of the cell A1 with the answer to a messagebox with Yes and No options:\nDim Msg, Style, Title, Response, MyString\nMsg = "Is that ok?"    \nStyle = vbYesNo + vbCritical + vbDefaultButton2\nTitle = "Question"\nResponse = MsgBox(Msg, Style, Title)\nIf Response = vbYes Then    ' User chose Yes.\n    MyString = "Yes"\nElse    ' User chose No.\n    MyString = "No"\nEnd If\nActiveSheet.Cells(1, 1).FormulaR1C1 = MyString\n\n\nAnother example: User enter a value for the cell A1,using InputBox:\n\nDim Message, Title, Default, MyValue\nMessage = "Enter a value for the cell A1"\nTitle = "Value for A1"\nDefault = ActiveSheet.Cells(1, 1).FormulaR1C1 ' Get the previous value from the cell\nMyValue = InputBox(Message, Title, Default)\nActiveSheet.Cells(1, 1).FormulaR1C1 = MyValue 'Set the new value for the cell
693009
This code is from 4guysfromrolla.com.  There are other ways to accomplish this as well.  Hope this helps!\n\n\n<script language="vb" runat="server">\n  ...\n   \n  Sub dgPopularFAQs_ItemDataBound(sender as Object, e as DataGridItemEventArgs)\n    ' First, make sure we're NOT dealing with a Header or Footer row\n    If e.Item.ItemType <> ListItemType.Header AND _\n         e.Item.ItemType <> ListItemType.Footer then\n      'Now, reference the LinkButton control that the Delete ButtonColumn \n      'has been rendered to\n      Dim deleteButton as LinkButton = e.Item.Cells(0).Controls(0)\n\n      'We can now add the onclick event handler\n      deleteButton.Attributes("onclick") = "javascript:return " & _\n                 "confirm('Are you sure you want to delete FAQ #" & _\n                 DataBinder.Eval(e.Item.DataItem, "FAQID") & "?')"    \n    End If\n  End Sub\n</script>\n\n<form runat="server">\n  <asp:datagrid id="dgPopularFAQs" runat="server"\n      ...\n      OnItemDataBound="dgPopularFAQs_ItemDataBound">\n\n      ...\n  </asp:datagrid>\n</form>
37333
Assuming you are writing your macro in VbScript:\nsResult = Inputbox("Prompt", "Input box title")