Skip to content
View in the app

A better way to browse. Learn more.

Thailand News and Discussion Forum | ASEANNOW

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

"classic" (i.e. Old) Asp Question

Featured Replies

Hi

I'm trying to write some code that allows my colleagues to fill in a brokers booking page with customers' details from within a browser. For example, I have a browser split into two vertical frames - the left side holds our customers details (name, email address etc.) and the right frame holds the brokers booking page. I want to be able to populate the right frame form fields with the data from the left frame with as few key strokes as possible.

This is easy enough using VisualBasic (which I've done for use in the office) as I can interrogate the HTML code in the VB browser and fill the fields in from our database. I would like to be able to create a browser version of this so that urgent bookings can be made via a PDA.

I was wondering if anyone had come across anything similar using ASP.?

Guess it cannot be done but I thought that I'd ask.

Cheers

Mick

It can be done .... I am sure. With Dreamweaver, Ajax and a little bit of coding you can make a gallery where if you click on a thumbnail on one side, the full picture comes up on the other side. No frames needed.

Too complex though to get into details though ...

Search ....

Edited by sniffdog

What version of Visual Basic are you using? If you are using VB.NET this can be done fairly easily with ASP.NET, but personally I would not use frames in the interface because it complicates things considerably. Similar effects can be created using DIV tags and CSS.

  • Author

Thanks for the replies.

I'm using VB6 in the office for the administration system. I haven't really gotten into VB.NET/ASP.NET (know of anywhere in Bangkok where I can pay for some training?).

I'm using frames as the left frame is our site and the site in the right frame doesn't belong to us.

I found a not so clean work around in ASP. In IE I can put a button next to a text box that, when clicked, copies the contents of the text box to the clipboard then it's just a matter of pasting the clipboard into our brokers' site.

Have to get some training in VB.NET - ideas anyone?

Thanks

Mick

Well, I don't know where you can get VB.NET training in Bangkok, but I might be able to point the way how to solve this issue with ASP.NET.

The way I would handle a scenario like this is to build a parser to load the fields you are interested in into an object and then allow the user to load the data from the object as default values into your form. Then they can just submit the form back to save the data in your datastore.

In ASP.NET it is a pretty simple operation to get the text output of a web site using the WebRequest and WebResponse objects (in the System.Net namespace). Here is a code sample how to do it.

'Gets the output of a webpage as utf-8 encoded text

Public Function GetUrlOutput(ByVal url As String) As String

Dim wr As WebRequest = WebRequest.Create(url)

Dim resp As WebResponse

Try

'Get the page

resp = wr.GetResponse

Try

'Return resp.GetResponseStream.ToString

Dim reader As New StreamReader(resp.GetResponseStream, System.Text.Encoding.UTF8)

Return reader.ReadToEnd

Finally

resp.Close()

End Try

Catch ex As System.Net.WebException

'This will trap any nonresponsive page so we

'can safely ignore it

Return ex.Message

End Try

End Function

This function just returns the raw HTML from a given URL. From there, I would use regular expressions to parse out the fields I am interested in, but some people find regular expressions a bit difficult to adjust to. There is no reason why you couldn't just manually create parsing code in VB though. Either way, you will need to make changes to your code when the 3rd party website changes.

Another route you might try is to see if the owner of the website has or would be willing to create an XML web service to supply the data to you. This of course depends on the specific type of relationship you have with the owner of that website.

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.