|
|
Can you please tell me how?
Thanks
|
|
|
|
|
Hi ,
i am using the following code in html to play videos in media player. But i want to give the filename based on the value present in radiobuttonlist. But how to do this? I am confused. Any help ?
<object id="mediaplayer" classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" style="width: 216px; height: 168px">
<param name="FileName" value="funny.wmv" />
Chaitra N
|
|
|
|
|
<a href = "http://www.killersites.com/mvnforum/mvnforum/viewthread?thread=3602#18305" rel="nofollow">http://www.killersites.com/mvnforum/mvnforum/viewthread?thread=3602#18305</a>
<pre>
<script type="text/javascript">
function play(media){
document.getElementById('mediaplayer').innerHTML=
'<object classid="clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95"'
+'type="application/x-oleobject" width="320" height="285">'
+'<param name="showControls" value="false">'
+'<param name="fileName" value="'+media+'">'
+'<embed type="application/x-mplayer2" width="320" height="285"'
+'showcontrols="false" src="'+media+'"><\/embed><\/object>'
}
</script>
Add this to the CSS:
#mediaplayer {
width: 320px;
height: 285px;
background: #000;
}
And put this in the html where you want the videos to play and menu:
<div id="mediaplayer"></div>
<ul id="menu">
<li><a onclick="play("<b>mymovie1.wmv</b>");return false" href="">Movie 1</a></li>
<li><a onclick="play("<b>mymovie2.wmv</b>");return false" href="">Movie 2</a></li>
</ul></pre>
<b>Note that OBJECT tag won't work on Firefox. </b>
Edit: Text editor is really bad for posting code..
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Hi Michael,
The code i sent is working fine but i want it to get displayed based on the title present in bulletedlist.
See I am storing the path of the video files in my database. I am using the following code to retrieve the path of the file. What I am finding difficult is to assign that path to the " filename " of the mediaplayer object
Protected Sub Show_Products(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.BulletedListEventArgs) Handles BulletedList1.Click
Dim SQLString As String = "SELECT filepath FROM pictures WHERE title = '" & BulletedList1.Items(e.Index).Text & "'"
Dim dr As Data.SqlClient.SqlDataReader
Dim comm As New Data.SqlClient.SqlCommand(SQLString, dbconn)
If dbconn.State <> ConnectionState.Open Then
dbconn.Open()
End If
Dim str As String
dr = comm.ExecuteReader
While dr.Read
str = dr.Item(0)
End While
dr.Close()
str = str
End Sub
|
|
|
|
|
Hi all,
i need a validation rule for date dd/MM/yyyy that applies rule of leap year.
thanks
|
|
|
|
|
Try with this code
TWO STEPS TO INSTALL VALIDATE DATE:
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<br />
<HEAD><br />
<br />
<SCRIPT LANGUAGE="JavaScript"><br />
<br />
<!-- This script and many more are available free online at --><br />
<!-- The JavaScript Source!! http:
<!-- Original: Torsten Frey (tf@tfrey.de) --><br />
<!-- Web Site: http:
<br />
<!-- Begin<br />
function check_date(field){<br />
var checkstr = "0123456789";<br />
var DateField = field;<br />
var Datevalue = "";<br />
var DateTemp = "";<br />
var seperator = ".";<br />
var day;<br />
var month;<br />
var year;<br />
var leap = 0;<br />
var err = 0;<br />
var i;<br />
err = 0;<br />
DateValue = DateField.value;<br />
<br />
for (i = 0; i < DateValue.length; i++) {<br />
if (checkstr.indexOf(DateValue.substr(i,1)) >= 0) {<br />
DateTemp = DateTemp + DateValue.substr(i,1);<br />
}<br />
}<br />
DateValue = DateTemp;<br />
<br />
<br />
if (DateValue.length == 6) {<br />
DateValue = DateValue.substr(0,4) + '20' + DateValue.substr(4,2); }<br />
if (DateValue.length != 8) {<br />
err = 19;}<br />
<br />
year = DateValue.substr(4,4);<br />
if (year == 0) {<br />
err = 20;<br />
}<br />
<br />
month = DateValue.substr(2,2);<br />
if ((month < 1) || (month > 12)) {<br />
err = 21;<br />
}<br />
<br />
day = DateValue.substr(0,2);<br />
if (day < 1) {<br />
err = 22;<br />
}<br />
<br />
if ((year % 4 == 0) || (year % 100 == 0) || (year % 400 == 0)) {<br />
leap = 1;<br />
}<br />
if ((month == 2) && (leap == 1) && (day > 29)) {<br />
err = 23;<br />
}<br />
if ((month == 2) && (leap != 1) && (day > 28)) {<br />
err = 24;<br />
}<br />
<br />
if ((day > 31) && ((month == "01") || (month == "03") || (month == "05") || (month == "07") || (month == "08") || (month == "10") || (month == "12"))) {<br />
err = 25;<br />
}<br />
if ((day > 30) && ((month == "04") || (month == "06") || (month == "09") || (month == "11"))) {<br />
err = 26;<br />
}<br />
<br />
if ((day == 0) && (month == 0) && (year == 00)) {<br />
err = 0; day = ""; month = ""; year = ""; seperator = "";<br />
}<br />
<br />
if (err == 0) {<br />
DateField.value = day + seperator + month + seperator + year;<br />
}<br />
<br />
else {<br />
alert("Date is incorrect!");<br />
DateField.select();<br />
DateField.focus();<br />
}<br />
}<br />
</script><br />
<br />
</HEAD><br />
<br />
<!-- STEP TWO: Copy this code into the BODY of your HTML document --><br />
<br />
<BODY><br />
<br />
<CENTER><br />
<FORM name="datecheck"><br />
<TABLE border="0" width="60%"><br />
<TR><br />
<TD><br />
Enter Date (Use European format shown at right)<P><br />
<INPUT type="text" name=testdat size='10' maxlength="10" onblur="check_date(this)"><br />
<INPUT type= "submit" name="button" value="Press to Validate"><p><br />
(Date is validated after leaving the field.)<br />
</TD><br />
<TD><br />
ddmmyy (171201) or <BR><br />
ddmmyyyy (17122001) or <BR><br />
ddXmmXyy (17-12-01 or 17y12q01 ... ) or <BR><br />
ddXmmXyyyy (17.12.2001 or 17,12,2001 ...) <br><br />
where "X" is any sign not in 0..9, i.e. "-" or "/"<p><br />
</TD><br />
</TR><br />
</TABLE><br />
</FORM><br />
</CENTER><br />
Hope this will help you.
SSK.
|
|
|
|
|
heyyyyy
just apply the condition leap year is in four year
so if a >= 4 then leap year
else not a leap year
byeee
lucky
|
|
|
|
|
I have two listboxes ,one of the listbox data is populate in database. And I have two buttons Add and Remove.
Once I click the add the button , the selected items is populated in another list box by using Javascript.
Similarly Remove also.
Give the javascript code or suitable link for the above scenrio
|
|
|
|
|
Use the Following code:
function f_optionMove(s_from, s_to)
{
var e_from = document.getElementById(s_from), e_to = document.getElementById(s_to);//test_form.elements[s_from],e_to = document.forms['test_form'].elements[s_to];
if (!e_from.name)
return alert ("Error: selectbox with name '" + s_from + "' can't be found.");
if (!e_to.name)
return alert ("Error: selectbox with name '" + s_from + "' can't be found.");
var n_moved = 0;
for (var i = 0; i < e_from.options.length; i++)
{
if (e_from.options[i].selected)
{
var name = e_from.options[i].text;
var ID = e_from.options[i].value;
e_from.options[i] = null;
e_to.options[e_to.options.length] = new Option (name,ID);
n_moved++;
}
}
if (n_moved)
e_from.options.length = e_from.options.length;
else
alert("You haven't selected any options");
}
function f_optionMoveAll(s_from, s_to)
{
var e_from = document.getElementById(s_from), e_to = document.getElementById(s_to);
if (!e_from.name)
return alert ("Error: selectbox with name '" + s_from + "' can't be found.");
if (!e_to.name)
return alert ("Error: selectbox with name '" + s_from + "' can't be found.");
var cntDesc = e_from.options.length;
var cntSource = e_to.options.length;
for (var i = 0; i < cntDesc; i++)
{
var name = e_from.options[i].text;
var ID = e_from.options[i].value;
e_to.options[cntSource] = new Option (name,ID);
cntSource++;
}
e_from.options.length = 0;
}
<
table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
<asp:listbox id="lstsource" runat="server" selectionmode="Multiple">
|
|
|
| <
asp:ListBox ID ="lstdestination" runat="server" SelectionMode ="Multiple">
|
|
|
|
|
|
how can i store the values in the 'lstdestination' listbox. Suppose i select the three values from the lstsource. How can i reterive the three values in server side ie., Code behind.
|
|
|
|
|
What is the exact functionality u want, please explain that so that I can give u the proper suggestion.
|
|
|
|
|
hi
found this in codeproject
http://www.codeproject.com/useritems/Listbox_or_combo_box.asp
winnie
|
|
|
|
|
Hi All,
I need to show textbox control in gridview row on mouse over (any other event as I am not sure which event should I capture) and on mouse out it should be a normal row.
Next on Mouse over if I change the value of the textbox then its should change the value of all the dependent textbox, like we have in excel ie; if I have the 10 in A1 cell and 15 in B1 cell and C1 is the sum of A1 and B1 then if I change the value of any of the cells (A1 or B1) then it automatically reflects in C1.
Finally I need to write this in XML file as I dont want to update my Database with this new values.
Please help me...
Thanks in advance...
|
|
|
|
|
When I do UsersDataTable it gives me following error
The type or namespace name 'UsersDataTable' could not be found (are you
missing a using directive or an assembly reference?)
Label2.Text = "Total Record count in the gridview above= " +
((UsersDataTable)e.ReturnValue).Count.ToString();
seema
|
|
|
|
|
I've never heard of that type, where do you expect it to come from ? Or do you just mean DataTable ? You can use the debugger to find out what type e is.
Have you considered using real variable names, or are you entering a code obsfucation contest ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
seemamltn wrote: When I do UsersDataTable it gives me following error
What is UsersDataTable ? Is it a datatable instance ? Check you are using namespace System.Data
|
|
|
|
|
Don't you need UsersDataTable.Rows.Count (if UsersDataTable is the ID of your GridView) ?
|
|
|
|
|
Hi, I am adding fields to my grid view on the fly
but when i try to define the DataNavigateUrlFields = "pid" i have this error
Value of type 'String' cannot be converted to '1-dimensional array of String'.
here is the code, how can i fix that
<br />
SqlDataSource1.SelectCommand = "SELECT * FROM [products]"<br />
Dim lnk As HyperLinkField<br />
lnk = New HyperLinkField<br />
lnk.DataTextField = "pname"<br />
lnk.NavigateUrl = "home.aspx"<br />
lnk.DataNavigateUrlFields = "pid"<br />
lnk.DataNavigateUrlFormatString = "~/home.aspx?pid={0}"<br />
Dim bFld As BoundField = Nothing<br />
bFld = New BoundField()<br />
bFld.DataField = "pid"<br />
GridView1.Columns.Add(bFld)<br />
GridView1.Columns.Add(lnk)<br />
any help
|
|
|
|
|
How do I debug an ASP.NET app in Vista ? On XP I would attach to the aspnet process, in Vista I am attaching to w3wp.exe, and my middle tier code seems to break OK, but my web pages never do.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Fixed it with a reboot. Stupid Vista...
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
|
Michael Sync wrote: I have rebooted my laptop so many times but it still doesn't work..
Better Uninstall the .net Framework and reinstall it and try again.
SSK.
|
|
|
|
|
I have a print button on my aspx page which prints only a particular <div> section of the page. The javascript for this print is coded in vb.net.
When I click on print and refresh the page, the print button click method is getting called once again. I do not want the button click to respond to the event on every refresh.
How can I do this?
Thank you
|
|
|
|
|
Not sure if it explains your situaton, but the answer to the broad question is, if you handle OnClientClick on your button with javascript that returns false, your server click will not occur.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|