Just change this:
sqlReader = sqlCmd.ExecuteReader()
If (sqlReader.HasRows) Then
While (sqlReader.Read())
'This grabs the details for the specific centre from the database using the data reader.
ListBox1.DataSource = sqlReader
ListBox1.DataBind()
EndWhile
to this:
Dim table As New...
Well that is not possible by default. Rather you have to create a virtual directory in IIS for the folder which is not in the scope of your website.
Then you will be able to access the files inside that folder.
Try something like this (please be aware that test.txt needs to be located somewhere into the web app):
Dim MyTestFile As String = IO.Path.Combine(Server.MapPath("~", "test.txt")
If IO.File.Exists(MyTestFile ) Then
Dim sr As New StreamReader(MyTestFile )
TextBox1.Text =...
It's all the same Hugo. You can read the content of the txt file no matter how it has been created. Please give it a try. If any problems do not hesitate to reply here.
Welcome to the forum :)
Ha it's because you've only pasted the converted code and it was not wired to the Load event. That's why it worked for me.
C# code differs in that sense. Ok i am glad you have it working there.
Actually it works for me too. When i run the project the dropdownlist is populated correctly.
However you should first ADD the Dictionary items and then use Insert method e.g.
RegionList.Items.Insert(0, new ListItem("---Please select---", "0"))
Well you can reference the Insert button using the FindControl method from DetailsView e.g.
Dim InsertButton As LinkButton = CType(Me.DetailsView1.FindControl("MyInsertButton"), LinkButton)
InsertButton.Attributes.Add("onclick", "javascripthere")
However, i would suggest to use template for...
Just add this code to the button TAG(s) and it will work:
OnClientClick="return confirm('Do you really want to insert this data?')"
So now, a pop up will come up with the Question. If they hit Ok, the page will post back and save the information, if they hit cancel, the form will be not submitted.
Hey i am trying to help you while You are trying to be funny. And again it does not work. At least it does not work in a way you explained that you want it to work.
However if you are happy with that then i have no reason to insist. It works woohooo .. cool
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.