|
Here is a piece of code I use for that:
<br />
<object classid="clsid:fbbaa605-56d2-11d2-a7f8-00a0cc2001a3" codeBase="client.cab#version=0,4,0,25" id="mase" width="1" height="1"><br />
</object><br />
The version-part is the version-resource of an active-x, contained in the cab file.
This only works with IE (no IE-version-checking here). I think Netscape does not/just partly (through 3rd party plugins) support ActiveX.
So you should use ActiveX only when you know the target platform (e.g. Intranet).
|
|
|
|
|
Hi,
There is an article in MSDN "Internet First Steps: Upgrading an Existing ActiveX Control", which explains how to package controls for the downloading.
Regards,
Alex Gorev,
Dundas Software.
|
|
|
|
|
I am a beginning level programmer.
I am doing expanding tree and collaspe tree in Netscape but it doesn't work well.
Here is my code
[pre>
[blockquote>
[div id="root" class=root>
[a href="#" onClick="expand(node1)">Root
[/div>
[div id="node1" class=node>
[a href="#" onClick="expand()">Node1
[div id="subnode1" class=node>
[a href="#" onClick="expand(leaf1)">SubNode1
[div id="leaf1" class=leaf>
leaf1
leaf2
leaf3
[/div>
[a href="#" onClick="expand(leaf2)">SubNode2
[div id="leaf2" class=leaf>
something1
something2
something3
[/div>
[/div>
[a href="#" onClick="expand()">Node2
....
[a href="#" onClick="expand()">Node3
....
[a href="#" onClick="expand()">Node4
...
[/div>
[/blockquote>
[/pre>
The problem is I can't expand the second level.
I just can do only expand for the first level
that is expand(node1) is perfectly done
But if I use to separate each block (each level)=> use it the same as ... It will cause some messy pages in IE.
Need help from generous people or professional or expert.
|
|
|
|
|
|
I am sure that everyone knows how to make a browser window scroll down to the specific place on the page:
all you need to do is add #MyTag at the end of your link. That works great when user clicks on the link. However, if you try to do the same thing with Response.Redirect "mypage.asp?Param1=1#MyTag" it doesn't work. Does anyone know of any way I can Response.Redirect and scroll the page at the same time?
TIA.
Kostya.
|
|
|
|
|
Tried this myself in IE, too. Seems that this does not work.
You could try:
- the Refresh meta-tag in the tag, instead of Response.Redirect or
- do some JavaScript in the OnLoad -event of the target page, to go to the anchor.
|
|
|
|
|
Thank you Uwe.
I did get it to work with JavaScript. My biggest problem was that I had no control over the body tag - I am trying to write an ASP script that would attach to any page. So I it took me a while to figure this one out.
What I had to do is define a script as <script for=window event=onload language=JavaScript>. That worked for IE. For Netscrape I had to define an empty layer with OnLoad event handling like <layer OnLoad="ScrollPage()"></layer>.
Thank you.
|
|
|
|
|
Let me guess - Nutscape will only allow 6 layers in one document, right?
I officially no longer support Nutscape, it is so *&^%$! crap.
I have spent days mucking around doing something so simple in concept and trying to get it to work in IE and Nutscape, and 99% of the problems have been with NS. This is the last straw, it is not capable of displaying anything but ridiculously simple DHTML. No wonder IE is more popular.
Comments?
|
|
|
|
|
I do not like Netscape myself, but I think that there is no 6 layers limitation there. Check this page out for example (it has about 20 layers): Sycamore Software.
Kostya.
|
|
|
|
|
I also dislike netscrap. But I also agree that there is not a 6 layer limit. For example this site http://legendweb.nmt.com has over 30 layers. Many third party .js libraries have requirements for how layers are initialized. You want to look out for this.
Good Luck!!
|
|
|
|
|
Thanks for the nice name NutScape, that is what such products are.
Aaah I hate netscape, oops Nutscape, Nutscape really sick
|
|
|
|
|
I think we've touched on this before but never really found a suitable solution. Is there a simple way to strip HTML from text, on the server, using ASP?
Ideally I'd like a function "StripHTML" which would take a string containing things like "<a href=http://blah.com'><b>My Site</b></a>" and would return "My Site".
I know I can use an ActiveX control (in fact Uwe has written a fantastic text replacement control we'll be using) but a quick simple solution would be wonderful.
|
|
|
|
|
Chris,
Here's a way you can do it in ASP below. I was trying to get just the MSHTML object loaded server side, but have been unsuccessful. There is the overhead of the whole IE instance with this method, but it works. Maybe you could load one for the ASP application and do a server lock and unlock before and after it's use then you only have 1 loaded for the whole application lifetime.
The Solution:
// IN ASP FILE
<%@language="vbscript"%>
<%
On Error Resume Next
Set DOMObject = CreateObject("InternetExplorer.Application")
'Initialize the document object
DOMObject.navigate "about:blank"
'set the inner HTML
' *** REPLACE WITH YOUR setting on RHS. be it from the
' Request object or a session variable.
DOMObject.document.body.innerHTML = "FooBar"
%>
<%=DOMObject.document.body.outerText%>
<%
' Free the IE instance
DOMObject = Nothing
%>
-Erik Thompson
|
|
|
|
|
Thank you!
I'll do some performance testing to see how bad the hit is - but it seems the only way, apart from writing a server side ActiveX component. Konstantin Vasserman has written such a control so I'll compare methods.
cheers
Chris
|
|
|
|
|
Hey, a maybe good idea comes in my mind: You could eliminate those things (which are really just something like an opening bracket "< ", followed by some stuff and a closing bracket "> ") by using regular expressions.
This should be very easily acchieved by temporarly switching from VBScript as the ASP scripting language to JScript and use their powerful (?) regular expression syntax.
Or even better, switch temporarly to PerlScript , from www.activestate.com, which can do this even better.
|
|
|
|
|
I've written VERY little ASPs so please be kind .....
Would it be possible to spawn an MFC app from an ASP that could then read my custom database (can't be eg. Access as anyone can read it!), and display the data etc?
Thanks
|
|
|
|
|
You can write an ActiveX control to do the database reading, and it can return a recordset for you to use. OR, if the database can be read using Access or SQLServer then ADO in ASP is dead simple (see my article)
|
|
|
|
|
http://www.autodidact.co.il/
|
|
|
|
|
I have an ATL component that passes back an IDispatch of a _RecordsetPtr as the VT_DISPATCH of a VARIANT.
e.g.
STDMETHODIMP CBASE::GetRecordSet(BSTR sql, VARIANT *Result)
{
_variant_t vBuffer;
...
vBuffer = static_cast<idispatch*>(m_recordset);
*Result = vBuffer.Detach();
}
From my C++ MFC app I can call GetRecordSet() and access the recordset using the pdispVal of the VARIANT
....
VARIANT Result;
hr = IBaseInst->GetProfile( _bstr_t("SELECT name FROM emps"), &Result);
_RecordsetPtr pRecordSet;
pRecordSet = Result.pdispVal;
if( !pRecordSet->adoEOF)
{
....
}
I am trying to perform similar actions from an ASP page but do not know how to access the recordset correctly.
I can access fields assuming they exist using:
Dim rs
rs = Ibase.GetRecordSet( "SELECT name FROM emps")
gName = rs("name")
But I can not do much else; rs.bof fails with 'Object doesn't support this property or method'.
I obvioulsy need to do something to get at the recordset from the returned VARIANT, but what ? Can anyone help with suggestions or code examples.
|
|
|
|
|
I see your using MFC but my ATL code should still help you
STDMETHODIMP CDoc_Session::SQLSearch(BSTR bstrSQL, Recordset ** ppRecSet)
{
HRESULT hr;
try
{
_bstr_t bstrSearch(bstrSQL);
if(bstrSearch.length()>0)
{
_RecordsetPtr piRS;
hr = piRS.CreateInstance(__uuidof(Recordset));
if(FAILED(hr)) return hr;
piRS->CursorLocation = adUseClient;
piRS->Open(bstrSearch, m_piConn->ConnectionString, adOpenForwardOnly,adLockReadOnly,adCmdUnknown);
if(VARIANT_FALSE == piRS->GetADOEOF())
return piRS->QueryInterface(__uuidof(_Recordset), reinterpret_cast<void**>(ppRecSet));
else
return E_FAIL;
}
else
return E_FAIL;
}
catch (_com_error e)
{
::MessageBox(NULL, e.Description(), "DNS", MB_OK);
return e.Error();
}
catch (...)
{
return E_FAIL;
}
return S_OK;
}
1. You need to change your variant return value to a Recordset ** ppRecSet. You will need to do a #importlib of the msado15.dll in the library section of your .idl file. This is so the midl compiler will be able to marshell the Recordset type.
2. Next you need to make sure returning
Recordset->CursorLocation=adUseClient;
3. Finally you need do a QueryInterface on the local Recordset so that can intialize the returing record set.
If you need more help on this I think I might be able to find some old MFC code that does this same thing.
Good Luck
|
|
|
|
|
You see, I could make a particular page error
by adding errorme('')<script> to my forum
How can i avoid this at my site asp?
|
|
|
|
|
Anyone know how to attach multiple conditions to a click event?
For example if a user clicks on a submit button....how can I specify an if then else condition?
i know its pretty easy but im new to Jave Script.
thanks in advance.
|
|
|
|
|
Just call a function in the onClick() event and do what you want in that function.
|
|
|
|
|
please teach me
may be... use the CreateObject ??
or... i have no idea.
tell me tell me loving you ( -_-... sorry )
bye
|
|
|
|
|
Hi,
You can create any COM object like this:
Set MyObj = Server.CreateObject("Object.Prog.ID")
....
Set MyObj = Nothing 'Destroying object
If you still do not fill comfortable about it... Check our company's WEB site at www.dundas.com. We have FREE ASP components like pie chart and mailer with examples of how to use them in ASP pages.
Regards,
Alex Gorev,
Dundas Software
|
|
|
|