I'm new in ASP.Net.
Recently I tried to create a window control library and to use it in aspx web page but it seem like cannot recognize as user control in the page.
I tried to use the user control from the sample web site "http:// www.4guysfromrolla.com/articles/052604-1.aspx" and it work!
Then when i try to debug and notice the different:
Sample user control from www.4guysfromrolla.com:
WinControl
. The user control i created:
objtest
My user control appear as {Object} instead of {ControlAxSourcingSite}.
and when i alert the parameter it only show me "undefined".
I'm not sure what am I missing or do wrong. I try to find out why but end up no clue...not even Google can help. It's really frustrated.
Hope there are some one can help me.
Sorry if I'm for asking stupid question.
sample code in aspx:
<object id="objtest" height="0" width="0" classid="uscControl/uscTest.dll#uscTest.uscTest" VIEWASTEXT>
<param name="Response" value="test" />
</object>
<object id="MyWinControl1" height="200" width="240" classid="uscControl/WinControls.dll#WinControls.WinTreeview" VIEWASTEXT>
<param name="sCode" value="My Code1"/>
</object>
to call:
<input type="button" value="CallTest" onclick="CallTest();" />
...
function CallTest() {
alert(window.document.getElementById("objtest").Response);
alert(window.document.getElementById("MyWinControl1").sCode);
}
Thanks God..finally i found out the answer by myself.
The main cause is when I create the window control library I did not modify the "AssemblyInfor.cs" to set [assembly: ComVisible(true)]. This is the main cause the object return undefined in aspx.
Hope it help the others as well :)
Related
I'm trying the code below but its not working..
<object width="425" height="344">
<embed src="C:\Users\fortress\Desktop\AppointmentApp.swf" type="application/x-shockwave-flash" width="425" height="344"></embed>
</object>
Also tried this. Not working also.
<object width="425" height="344">
<embed src="~/Styles/Images/AppointmentApp.swf" type="application/x-shockwave-flash" width="425" height="344"></embed>
</object>
Problem:
The swf is not displaying.
I saw an error when I open the designer saying that "A control type was not specified or the specified type could not be found." I already import the shockwave-player for flash but still this error appeared..
I want also that the .swf will be fullscreen played in .aspx.
I'm newbie in ASP.net.. SO yeah, please explain also the code if its okay...
Here's the output in client-side:
Here's the whole code for my client-side:
Thanks!
This isn't ASP.NET, this is HTML. It might be served to the client by an ASP.NET server-side application, but that makes no difference to the client.
As far as HTML goes, your paths are broken. In both cases:
C:\Users\fortress\Desktop\AppointmentApp.swf
~/Styles/Images/AppointmentApp.swf
In the first case you're referencing a file system path. This wouldn't work on any client computer which doesn't have that file. If the file is on the web server then no client will be able to access the web server's C: drive. In the second case you're using a server-side relative path with a ~, and no client will be able to make sense of that.
When the page renders, the path needs to reference the file from the client's perspective. Something like this:
/Styles/Images/AppointmentApp.swf
Or perhaps:
../../Styles/Images/AppointmentApp.swf
Or whatever the path is from the rendered page to the SWF file.
I'm not 100% sure if this works well for object/embed tags, but you might be able to use the ~ path reference if you make the tag a server-side control. That should just be as easy as adding runat="server" to the tag:
<embed runat="server" src="~/Styles/Images/AppointmentApp.swf" type="application/x-shockwave-flash" width="425" height="344"></embed>
This would indicate to the ASP.NET application that the control needs some server-side processing before it's rendered to the client, and that processing would include evaluating relative paths.
You need both <param> movie tag and <embed>. Try this:
<object type="application/x-shockwave-flash" width="425" height="344">
<param name="movie" value="/Styles/Images/AppointmentApp.swf">
<embed src="/Styles/Images/AppointmentApp.swf" type="application/x-shockwave-flash" width="425" height="344"></embed>
</object>
Good luck!
I have searched and searched to no avail. I am using
<telerik:RadDatePicker ID="prev_startempdate" runat="server" Width="115px">
<Calendar ShowRowHeaders="False" Width="160" />
</telerik:RadDatePicker>
When my page first loads it works fine, but when the page does a partial update to show more fields depending on a certain answer the calendar popups stop working. If I manually type a date, they get removed from the box as well. Any help is appreciated.
Hello all, i have a theoretical question.
With flash you can dynamically load flashvars to a video or audio flashobject.
But: I would already have a flash video which loads the flashvars like that. But i want to create html5 code (either audio/video) around it. Can i use the flash vars outside of the element/flash object?
Like loading the flash source (mp3) also to the HTML5 audio element, which surrounds the flash element?
To make it more visual:
HTML(5) Page.
Contains a flash object, nested within a HTML5 audio/video element.
C# page.
Dynamically loads the flashvars & params to the flash object. For example mp3source.
Problem:
Can i also load the mp3source flashvar/param to the HTML5 video/audio in some way?
To load the vars i would use htmlgenericcontrols. If someone has an idea about how/if i could create something like this... Please share it! :)
Thanks for the answers!
PS: Some Code (!Not working, just to give you a clue!)
C# Param
var mp3param = new HtmlGenericControl("param");
mp3param.Attributes.Add("name", "thevars");
var thevars= "mp3=" + src;
HTML Output
<audio id="htmlaudio" controls="">
<source src="thisshouldbetheflashmp3source" type="audio/mpeg">
<object type="application/x-shockwave-flash" data="audioplayer.swf" width="xx" height="xx" id="flashaudio" style="visibility: visible;">
<param name="thevars" value="mp3=Theflashmp3sourcethatdoesworkbutshouldalsobeusedinhtmlaudio">
</object>
</audio>
Lets assume, this is your object tag
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="550" height="400" id="movie_name" align="middle">
<param name="movie" value="<%=MovieName%>"/>
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="<%=MovieName%>" width="550" height="400">
<param name="movie" value="<%=MovieName%>"/>
<!--<![endif]-->
<a href="http://www.adobe.com/go/getflash">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player"/>
</a>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
You can now create a property in the code behind to grab the data dynamically. Sample code below
public string MovieName{
get { return "Movie_name.swf"; }
}
I'm just preparing the release of a library site builded in asp.net:
http://213.133.103.5/gramma_prod/Site/Index.aspx
All it's working great on FF and Chrome but on IE the asp button click event is not working.
Please notice the most important buttons: "Adauga in cos" (Add to basket)...
I'm just struggling to find out the problem...
I've checked the forms to not have nested ones but they seems ok.
Could you provide any other ideea?
ps: I did not post any code because this problem occurs on all pages...
Thanks in advance.
Edit:
Code for "Add to basket"(Adauga in cos) button from the index:
<asp:ImageButton ID="imgBtnCosBooksFeatured" runat="server"
OnCommand="addProductToBasket_Click"
CommandName="Click" CommandArgument='<%# Eval("Carti_id").ToString()+","+Eval("Titlu").ToString()+","+Eval("Autor").ToString()%>'
ImageUrl="../Site/images/featured-cos.jpg" ToolTip="Adauga in cos" />
works ok on ff and chrome. Fails on IE :(
Are you sure, your button, have the click event, and enable post back?
I don't see any onclick event... here is the source. Am I missing something?
<div class="adauga">
<input type="image" name="Repeater2$ctl00$imgBtnCosBooksFeatured" id="Repeater2_ctl00_imgBtnCosBooksFeatured" title="Adauga in cos" src="../Site/images/featured-cos.jpg" style="border-width:0px;" />
</div>
SOLVED!!!
What a stupid thing: i had a user control for the header which contained a form tag. So basically, my index contained two form tags because the user control was included as well....Auchhhhhh!
I'm trying to apply the same animation to multiple TargetControlID's -- for example, in a modal dialog, I would like to have a cancel button and a little "x" graphic in the upper right, either of which closes the dialog.
Seems pretty inelegant to write two identical animations, one for each of these targets. I'd like to have one <AnimationExtender> and apply it to two controls.
Know what I mean? Any ideas?
Sounds like you want to use UpdateProgress control. It can be connected to an UpdatePanel for whatever buttons you have there.
(Or maybe I misunderstand you)
The animation extender adds (VIA JavaScript) a click handler to the target control to start the animation. One simple way to do what you're trying to do would be by simulating a click on the target control whenever your second control is clicked. The AjaxControlToolkit includes a function that can help you do this.
Add this javascript to your page. Set 'onclick' of your second control to call this function:
function secondControlClick() {
$common.tryFireEvent(yourtargetcontrol, 'click');
}
Let me know how this works out for you.
Gabriel
... Two years later...
So the trick is in changing the TargetControlId property of the animation as you guessed. While it's not as easy as jQuery's $["#MyControl"].hover(function {}); syntax it can be done.
There's a couple of hidden properties on the javascript objects that you need to use. The _onHoverOver, _animation, and _target properties, specifically.
For example let's say that you have a button that you'd like to resize if somebody hovers over it, you'd need to create your animation extender and a couple of javascript calls that you reference in your onmouseover event:
<ajaxToolkit:AnimationExtender id="aeAnimateClaimButtons"
runat="server" BehaviorID="showHover" TargetControlID="ctlNonExistent" >
<Animations>
<OnHoverOver>
<Sequence Duration=".4">
<Resize Width="500" Height="100" Unit="px" />
</Sequence>
</OnHoverOver>
<OnHoverOut>
<Sequence Duration=".4">
<Resize Width="200" Height="100" Unit="px" />
</Sequence>
</OnHoverOut>
</Animations>
</ajaxToolkit:AnimationExtender>
Then you'd need to create your functions:
<script type="text/javascript">
function hoverOverButton(senderId) {
var ae = $find("aeAnimateClaimButtons");
ae._onHoverOver._animation._target = $get(senderId);
ae._onHoverOver.play();
}
function hoverOutButton(senderId) {
var ae = $find("aeAnimateClaimButtons");
ae._onHoverOut._animation._target = $get(senderId);
ae._onHoverOut.play();
}
</script>
Then your button:
<input type="button" onmouseover="hoverOverButton(this)" onmouseout="hoverOutButton(this)" />
A word of caution here. The ctlNonExistent thing will probably make your page throw an exception. This is just an example to demonstrate the principle. Also I don't know if the _variables will end up disappearing. They don't seem like public API stuff to me.