Lowyat.NET Forums

Welcome Guest ( Log In | Register )

 
RSS feedBump TopicReply to this topicStart new topicStart Poll

Outline · [ Standard ] · Linear+

> VB ActiveX Control pass a value back to asp, please advise, thanks in advance!

lOvEbItE
post Jun 21 2006, 01:14 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #1


Casual
***

Group: Junior Member
Posts: 375
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Apr 2005






I've developed a VB ActiveX Control recently.

I'm able to pass the value to the ActiveX Control to proceed with CAPICOM signing.
But how can I pass the signed string back to the asp page?

The flow is when the page load, the ActiveX Control (.ctl) will be loaded, user can click on a commandbutton on the ActiveX Control, then a form (.frm) will be loaded, followed by few forms after that, finally pop up a message box to show the signed string. All these have been done. Now i'd like to pass the signed string back to the ASP page instead of pop-up message. Do I need to pass the value from form (.frm) back to the ActiveX Control (.ctl) then only pass back to ASP (.asp) page?

I need to either pass it back to the ASP page and assign it to a variable or assign it as a value in a hidden textbox.

I prefer to assign it to a variable. Any idea how to do it?
If it is impossible, then I'll choose the alternative to pass and assign the signed string in a hidden textbox in ASP page. How to do that?

Please advise.

Thanks in advance.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
anthony_yio
post Jun 21 2006, 03:42 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #2


........
Group Icon
Codemasters

Group: Elite
Posts: 1,794
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Jan 2003





QUOTE(lOvEbItE @ Jun 21 2006, 01:14 PM)
I've developed a VB ActiveX Control recently.

I'm able to pass the value to the ActiveX Control to proceed with CAPICOM signing.
But how can I pass the signed string back to the asp page?

The flow is when the page load, the ActiveX Control (.ctl) will be loaded, user can click on a commandbutton on the ActiveX Control, then a form (.frm) will be loaded, followed by few forms after that, finally pop up a message box to show the signed string. All these have been done. Now i'd like to pass the signed string back to the ASP page instead of pop-up message. Do I need to pass the value from form (.frm) back to the ActiveX Control (.ctl) then only pass back to ASP (.asp) page?

I need to either pass it back to the ASP page and assign it to a variable or assign it as a value in a hidden textbox.

I prefer to assign it to a variable. Any idea how to do it?
If it is impossible, then I'll choose the alternative to pass and assign the signed string in a hidden textbox in ASP page. How to do that?

Please advise.

Thanks in advance.
*



The user control object will expose Hyperlink property which you can use to navigate between pages.

Probably you could use the querystring method to pass the value between pages.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
anthony_yio
post Jun 21 2006, 03:57 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #3


........
Group Icon
Codemasters

Group: Elite
Posts: 1,794
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Jan 2003





If you want to pass a value back to the current page, just use HyperLink property to navigate to yourself and construct querystring type URL. In your ASP page top segment, handle postback condition.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
lOvEbItE
post Jun 21 2006, 05:19 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #4


Casual
***

Group: Junior Member
Posts: 375
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Apr 2005






Sorry I don't get what you guys mean...

Can you explain further please?

Do you mean I code it that way that the ActiveX Control will open 1 browser with querystring data? Then what about the Session?

Please advise.

Thanks.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
anthony_yio
post Jun 21 2006, 05:34 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #5


........
Group Icon
Codemasters

Group: Elite
Posts: 1,794
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Jan 2003





QUOTE(lOvEbItE @ Jun 21 2006, 05:19 PM)
Sorry I don't get what you guys mean...

Can you explain further please?

Do you mean I code it that way that the ActiveX Control will open 1 browser with querystring data? Then what about the Session?

Please advise.

Thanks.
*


Firstly, check for Hyperlink property of ur control.

then, check NavigateTo function in the Hyperlink property.

object.NavigateTo Target [, Location [, FrameName]]

User is offlineProfile CardPM
Go to the top of the page
+Quote Post
anthony_yio
post Jun 21 2006, 05:39 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #6


........
Group Icon
Codemasters

Group: Elite
Posts: 1,794
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Jan 2003





QUOTE(lOvEbItE @ Jun 21 2006, 05:19 PM)
Sorry I don't get what you guys mean...

Can you explain further please?

Do you mean I code it that way that the ActiveX Control will open 1 browser with querystring data? Then what about the Session?

Please advise.

Thanks.
*


Probably you can't get the session data in your activeX control. (just my hunch. may be there are some workaround which I am not aware of.)



User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Seventh7
post Jun 21 2006, 09:46 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #7


Regular
******

Group: Senior Member
Posts: 1,247
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Sep 2004




if u r using ActiveX on the web and want to communicate with the web, use VBScript..
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
lOvEbItE
post Jun 22 2006, 09:23 AM
Show posts by this member only |This post's rating (0+, 0-) | Post #8


Casual
***

Group: Junior Member
Posts: 375
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Apr 2005






anthony_yio:
by using object.NavigateTo Target [, Location [, FrameName]], I am able to get it work! Thanks! But the problem is the length of the encrypted message is 3000++ characters, therefore the form cannot get the correct value. Any idea how to solve this issue?

Seventh7:
Can the method you've suggested solve the issue above? Btw I've tried to use VBscript to pass value into the ActiveX Control but no success, still trying to google and testing the codes. If I can pass the value back from ActiveX Control to ASP webpage, that means the 3000++ characters issue will be wiped away?

My current code is something like this:
<form name="formUser">
<Object id="objUser".... >
<Param name="uid" value="lovebite">
</Object>
</form>

<script language="VBScript">
' pass value to activex?
Sub Window_OnLoad
document.formUser.objUser.uid = "lovebite"
End Sub

' get value from activex?
Sub Window_OnExit
msgbox document.formUser.objUser.uid
End Sub
</SCRIPT>

Is the code looks like this ar? Please advise.

Thanks in advance!


This post has been edited by lOvEbItE: Jun 22 2006, 11:03 AM
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
lOvEbItE
post Jun 22 2006, 11:04 AM
Show posts by this member only |This post's rating (0+, 0-) | Post #9


Casual
***

Group: Junior Member
Posts: 375
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Apr 2005






I've edited the my previous post, please advise.

Thanks in advance.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Bump TopicReply to this topicTopic OptionsStart new topic
 

Lo-Fi Version Time is now: 21st March 2010 - 11:54 PM
All Rights Reserved 2003-2009 Vijandren Ramadass (~living on a prayer~)