|
Message Closed
modified 17-Sep-17 23:56pm.
|
|
|
|
|
By running a few scans on your domain I was able to determine that you are running on a Unix server (Linux i wager) and that you are hosted by Verio[^].
From memory Verio do offer PHP support on their Unix servers. Just to be sure please place the following code into a file named "phptest.php" and stick it onto your server.
<?php
phpinfo();
?>
Once you have uploaded the file run it. If you get a long list of things about PHP then you have support for it. Please email the response (By right clicking and saying view source) at "brad [at] trueguava [dot] com"
-- modified at 20:26 Wednesday 20th December, 2006
Brad
Australian
"Keyboard? Ha! I throw magnets over the RAM chips!" - peterchen
|
|
|
|
|
ja, I got a ton of table data. So, now what?
~Idiots die, I evolve...
|
|
|
|
|
Does a version exist? The 1.0->1.5 one was marked as incompatible.
Kevin
|
|
|
|
|
I have a text document bound to asp:label control.I want to get the starting index and ending index of selected text in the document.
Here is my javascript:
function CallForAnnotation()
{
var text = document.getElementById('lbltext').innerText;//Entire text
var selectedText = document.selection.createRange().text;//selected text
if(selectedText == "")
{
alert("Please select text");
return;
}
document.getElementById('hdnselectedtext').value = selectedText;//for server side purpose
var selectedWordStartingIndex = text.indexOf(selectedText);//starting index
document.getElementById('hdnStartindex').value = selectedWordStartingIndex;
var selectedTextLength = selectedText.length;//length of selected text
var selectedWordEndingIndex = selectedWordStartingIndex + selectedTextLength;//ending index
document.getElementById('hdnEndindex').value = selectedWordEndingIndex;
}
The above script works fine.
But if i select a word that occured several times in the document,only the first occurence of that word is reflected all the time and thus starting and ending indexes of selected text that we are getting is wrong.
|
|
|
|
|
Use the range that you create instead of just the contents of the range.
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
I didn't exactly get you.......
can you please make it elaborate
|
|
|
|
|
You are creating a range to get the selected text, then you use the text to try to locate where the selected text is. This means that you are trying to recreate information that you already have.
Use the information in the range, instead of trying to recreate the information.
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
Hey
Im a total rookey in this forum, and my english sucks, but anyway i'm trying to think through how i can implement a browser based strategy game. As I see it, the game should look like a ordinary map, therefore I don't whant to use flash because of the vector based structure.
Therefore, what tech is googleearth build on, or is there anybody that has another good idea for a way to make a user interface that is built-in a web-page.
Best regards
Dennis
|
|
|
|
|
Google earth uses a technique called "Ajax" (Asynchronous Javascript And Xml).
There are way too many article on this topic, so a Google of "Ajax Tutorial" will tech you all you need to know about it. The maps on Google earth are hundreds of little pictures that are loaded depending on what you click.
However if you are making a game for the browser i heavily recommend Flash or Java Applets. Anything else will be HELL to make.
hope that helps.
Brad
Australian
"Keyboard? Ha! I throw magnets over the RAM chips!" - peterchen
|
|
|
|
|
Does anyone know where I can find information and tutorials to try to make a google earth like engine?
thanks
|
|
|
|
|
http://www.apress.com/book/bookDisplay.html?bID=10158[^]
That book will provide you with more information then any online tutorial.
My experience with Apress has always been fantastic. I read a book of theirs by Sas Jacobs about XML and it handled that boring subject in a way that actually kept me interested.
Brad
Australian
"Keyboard? Ha! I throw magnets over the RAM chips!" - peterchen
|
|
|
|
|
Dear friend,
online games is a growing industry which becomes more competitive every day.
we have developed many online games for different brands in Greece.
Some have had great success. Our latest work is here
http://the10thplanet.njoy.gr/EN/ep01/default.asp
have a look. This is the Enlgish version so you should be ok.
I would suggest using Flash! it is the finest technology for online gaming at the moment.
There is also WPF/E but its very new and still in beta version i think.
|
|
|
|
|
I have a composite custom web/server-side component that sends several controls to the client-side. If a user of my component wants to interact with it in their client-side javascript they would need to know the names of the various components that make up my component, which takes away from my component's apparent "whole-ness", if that's a word
Is there a way for my control to create a virtual control in the DOM with the id that the user gave it when they defined it in the source of the web-page? This way they could use the document.getElementById method or even the .<component id=""> espression to access it like other items in the form. Currently in javascript I've created a collection to manage my custom controls, but it would be nice if the DOM could manage them for me.
Thanks
|
|
|
|
|
You can create elements using the DOM and Javascript with their own unique ids. However, you have to recreate these elements each time the page is reposted or refreshed to keep your component's holistic experience.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Would these virtual elements be visable?
What I'm looking for are non-display elements that my component can update, which to the web-page developer look as it was the actual component.
Is that what you're saying can be done when you suggest creating elements in the DOM using Javascript?
|
|
|
|
|
I am assuming you are using ASP.NET or something similar where you create the web page dynamically on the web server. The controls you are refering to are just assemblied HTML code that displays in the client's web browser.
Another way of dynamically creating HTML via the DOM (DHTML), is creating elements and attributes via Javascript and the DOM. This process is very similar to the way that the XML DOM creates and updates nodes. However, this is a lot of work to create and manage using prewritten and dynamically created Javascript. If you are interested in controling a web page this way Google on DHTML and Javascript.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Thanks again. I'll tackle this one after I get my PostBack Data working.
|
|
|
|
|
|
Try creating an image of the symbols.
Make then very low res Gifs to reduce load times.
Brad
Australian
"Keyboard? Ha! I throw magnets over the RAM chips!" - peterchen
|
|
|
|
|
Can i use Both pull & push model to develope a single crystal report ??
If yes plzz tell
regards
jagmit
|
|
|
|
|
I wrote a custom combobox server control that inherited the webcontrols.listbox class so that I'd get all of the built-in list handling features. Then I added a textbox to allow me to type in a value that wasn't in the listbox, and some client-side javascript to set the textbox to the selected item in the list when one was clicked, select a matching item in the list when one was typed into the textbox, or to set the list's selectedIndex to -1 when the value typed into the textbox didn't match. All of this works fine.
The problem is that when the form posts back I don't see any of the data I expected, not the list selection, nor the textbox value.
As I said I expected the list selection to be returned automatically, but I didn't actually use that instance, opting instead to use a span container with the a textbox, another listbox, and an imagebutton added to the span's controls, then rendered from the span level. So, how do I get the data to post-back from these sub-controls?
I really don't want to use the original list that my control inherited, as I need the span container to make my control work in absolute position mode. However, to make my control work in non-absolute position mode, when the textbox's width is set to auto, I don't always render the span, instead I simply render the controls below the span and let the browser work out all of the widths.
Thank you in advance.
|
|
|
|
|
Using the following code I can see my data:
Dim CBX1 As cwcComboBox.cwcComboBox = Me.cwcComboBox1
Dim CBX1Value As String
Dim CBX1Values As String()
CBX1Value = CBX1.Page.Request.Params.Get(CBX1.ID)
CBX1Values = CBX1.Page.Request.Params.GetValues(CBX1.ID)
CBX1Value = "Three,3", CBX1Values(0)="Three", and CBX1Values(1)="3"
So the data is there. However, when I try to access the data the "correct" way by declaring a LoadPostData function as follows:
Public Function LoadPostData( ByVal Key As String, ByVal PostData As NameValueCollection ) As Boolean _
Implements IPostBackDataHandler.LoadPostData
:
End Function
The compiler says that IPostBackDataHandler is not implemented by this class, but my custom component inherits from the ListBox webcontrol. So at the top of my class, after the inherits statement, I tried using:
Implements System.Web.UI.IPostBackDataHandler
But the compiler says its already implemented by the listbox base class, which seems to disagree with the earlier compiler error!
Anyone know what's going on with this?
|
|
|
|
|
Here is an important missing piece that needs to be added after the inherits statement:
Implements INamingContainer
Now I no longer get the conflicting messages, only one that says:
'System.Web.UI.IPostBackDataHandler.LoadPostData' is already implemented by base class 'System.Web.UI.WebControls.ListBox' and cannot be implemented again.
So now my question is how do I override or shadow the one in the base class so I can capture the rest of the data that my component sends back?
My component is a combobox, and should send back the TextBox value and the ListBox Index.
Even if getting the LoadPostData to work, it isn't clear to me how you get both of these data values out of it. The example code I've seen so far says that the Key value is the name of my component, which is used as an index in the NameValueCollection paramenter, so it seems to only be set up to get one value.
Also, since I have two values, which one will it get?
|
|
|
|
|
This is a work around that I used after I got some help from Sebastián Streiger after posting a similar question on his article's feedback:
Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)
MyBase.OnInit(e)
Try
If Page.IsPostBack() Then
' The page can have many instances of this component, so don't want to push the
' cwcComboBoxInfo state class instance infomation through the ViewState, so put
' a reference to in a session variable, actually done at the end of the Render
' Sub.
'
' When the page is posted back, the component state is restored by setting the
cwcComboBoxInfo to the reference value saved in the session variable.
'
If Not HttpContext.Current.Session(cwcComboBoxInfo.ID) Is Nothing Then
cwcComboBoxInfo =
CType(HttpContext.Current.Session(cwcComboBoxInfo.ID),
cwcComboBoxInfoClass)
End If
' Get the postback data.
LoadPostData() ' There is a bug in VS.NET 2003 that prevents the LoadPostData
' function from overriding/shadowing the listbox base class's
' IPostBackDataHandler.LoadPostData and RaisePostDataChangeEvent
' implementation, so call the LoadPostData function directly to
' get the posted data.
End If
Catch Ex As Exception
Throw New cwcComboBoxException("OnLoad: Exception - Component " & Me.ID & ", " & _
Ex.Message)
End Try
End Sub
' -------------------------------------------------------------
' The following was a suggested fix to the IPostBackDataHandler implmentation problem, but
' it didn't seem to help. Instead, Sebastián Streiger suggested that the Impments ...
' statement should be removed from the LoadPostData function and RaisePostDataChangeEvent Sub
' declarations. However, while this allowed me to compile the code it doesn't seem to get
' called by the .NET Framework. So I implmemented a override LoadPostData function with no
' parameters that I directly call from the OnLoad event sub above.
Public Shadows Interface IPostBackDataHandler
Function LoadPostData(ByVal sPostData As String, _
ByVal oPostCollection As NameValueCollection) As Boolean
Sub RaisePostDataChangedEvent()
End Interface
' -------------------------------------------------------------
Private Enum EventsType
NoEvent
TextBoxValueChanged
SelectedListIndexChanged
End Enum
'
' This "global variable keeps track of the component's event that needs to be raised.
' Part of the IPostBackDataHandler workaround I'm using.
'
Private EventType As EventsType = EventsType.NoEvent
'
' Define a LoadPostData function that can be called from the OnLoad event
' just in case the IPostBackData Handler isn't called by the .NET Framework.
'
Private Function LoadPostData() As Boolean
Return LoadPostData(cwcComboBoxInfo.ID, Me.Page.Request.Params)
End Function
'
' Should be called by the .NET Framework do allow handling of the PostBack Data for this
' component. If that doesn't happen then the overload above can be called.
'
Public Overridable Function LoadPostData(ByVal Key As String, _
ByVal PostedValues As NameValueCollection) _
As Boolean
'
' Implements System.Web.UI.IPostBackDataHandler.LoadPostData
'
Dim Values As String() = PostedValues.GetValues(cwcComboBoxInfo.ID)
Dim OldValue, NewValue As String
Dim Result As Boolean
Select Case Values.Length
Case 0
' Use the component's custom exception
EventType = EventsType.NoEvent
Throw New cwcComboBoxException("LoadPostData: Exception - " & _
"No data found for the '" & _
cwcComboBoxInfo.ID & "' component!")
Case 1
OldValue = [Text]
NewValue = Values(0).Trim()
If [IgnoreCase] Then
Result = (OldValue.ToLower() = NewValue.ToLower())
Else
Result = (OldValue = NewValue)
End If
If Result Then
[SelectedListIndex] = NOTHINGSELECTED
[Text] = NewValue
EventType = EventsType.TextBoxValueChanged
End If
Case 2
[SelectedListIndex] = Val(Values(1))
EventType = EventsType.SelectedListIndexChanged
Case Else
EventType = EventsType.NoEvent
Throw New cwcComboBoxException("LoadPostData: Exception - Too much data " & _
"posted for the '" & _
cwcComboBoxInfo.ID & "' component, " & _
Values.Length & " data items " & _
"(" & Me.Page.Request.Params.Get( _
cwcComboBoxInfo.ID) & ")!")
End Select
Return (EventType <> EventsType.NoEvent)
End Function
' -------------------------------------------------------------
Public Event TextBoxValueChanged As EventHandler
Protected Overridable Sub OnTextBoxValueChanged(ByVal Ex As EventArgs)
RaiseEvent TextBoxValueChanged(Me, Ex)
End Sub
' -------------------------------------------------------------
Public Event SelectListIndexChanged As EventHandler
Protected Overridable Sub OnSelectedListIndexChanged(ByVal Ex As EventArgs)
RaiseEvent SelectListIndexChanged(Me, Ex)
End Sub
' -------------------------------------------------------------
Public Overridable Shadows Sub RaisePostDataChangedEvent()
'
' Implements IPostBackDataHandler.RaisePostDataChangedEvent
'
' Figures out which event handler to use.
'
Select Case EventType
Case EventsType.NoEvent
' No Action - No event occurred.
Case EventsType.TextBoxValueChanged
OnTextBoxValueChanged(EventArgs.Empty)
Case EventsType.SelectedListIndexChanged
OnSelectedListIndexChanged(EventArgs.Empty)
End Select
End Sub
|
|
|
|