C
Carl Mercier
Hi,
I am trying to resize a textbox at runtime depending on the browser but for
whatever reason, the textbox is not resized. It stays at the original size.
How can I do what I want?
Here's the code I have in my web user control:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim browser As String = Request.Browser.Type.ToUpper
If browser.IndexOf("NETSCAPE") > -1 Or browser.IndexOf("NS") > -1
Then
textBoxWidth = 15
ElseIf browser.IndexOf("IE") > -1 Then
textBoxWidth = 75
ElseIf browser.IndexOf("OPERA") > -1 Then
textBoxWidth = 15
End If
txtUser.Width = New UI.WebControls.Unit(textBoxWidth)
End Sub
I am trying to resize a textbox at runtime depending on the browser but for
whatever reason, the textbox is not resized. It stays at the original size.
How can I do what I want?
Here's the code I have in my web user control:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim browser As String = Request.Browser.Type.ToUpper
If browser.IndexOf("NETSCAPE") > -1 Or browser.IndexOf("NS") > -1
Then
textBoxWidth = 15
ElseIf browser.IndexOf("IE") > -1 Then
textBoxWidth = 75
ElseIf browser.IndexOf("OPERA") > -1 Then
textBoxWidth = 15
End If
txtUser.Width = New UI.WebControls.Unit(textBoxWidth)
End Sub