WebBrowser Name

  • Thread starter Thread starter Craig Francis
  • Start date Start date
C

Craig Francis

When your using JavaScript in an IE window (WebBrowser)
you can return or set the name of the window using the
following...

<script type="text/javascript">
window.name="New Name";
alert (window.name);
</script>

Is it possible to-do the same thing in VB.NET?

I'm not sure, but you might be able to use...

Browser1.GetProperty("???")

NOTE: Already posted in
microsoft.public.inetsdk.programming.webbrowser_ctl, but
no reply, if a solution is found then I will also post in
there (as I hate finding when other people have a
problem, but the solution wasn't printed)

Thanks in Advance
Craig
 
Hi Craig,
I think not, this is Client side.
And with VB.net you are mostly working on the serverside.
So what you can do is past a piece like this in your aspx file
Or just send a page with a message label (Or another control) back.
I hopes this helps a little bit,
Cor

ps. the browser class is for browsing like IE with a window form.
 
Hi Craig,
I think it can be done like this,
I think there must be a better way to transport the name to the client page.
But I could not find it.
If you find it, tell us please.
<script type="text/javascript">
window.name=document.all.item('label1').innerText;
document.all.item('label1').innerText=""
alert (window.name);
</script>
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Me.Label1.Text = "The first text"
End Sub
Private Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
Me.Label1.Text = "A new text"
End Sub
End Class

Funny excercise
Cor
 
Back
Top