Foros del Web » Programando para Internet » ASP Clásico »

Ocx

Estas en el tema de Ocx en el foro de ASP Clásico en Foros del Web. Saben como usar un ocx con asp, lo que pasa es que quiero ocupar un calendario DTPicker thank you ;) DD...
  #1 (permalink)  
Antiguo 15/07/2002, 11:01
Avatar de dobled  
Fecha de Ingreso: enero-2002
Ubicación: Rancagua - Chile
Mensajes: 1.328
Antigüedad: 22 años, 4 meses
Puntos: 2
Ocx

Saben como usar un ocx con asp, lo que pasa es que quiero ocupar un calendario
DTPicker

thank you

;)

DD
  #2 (permalink)  
Antiguo 15/07/2002, 15:08
 
Fecha de Ingreso: mayo-2002
Mensajes: 83
Antigüedad: 22 años, 1 mes
Puntos: 0
Re: Ocx

asi se usa...el DTPicker
<div id="popCalE2" onclick="event.cancelBubble=true" style="BORDER-BOTTOM: 2px ridge; BORDER-LEFT: 2px ridge; BORDER-RIGHT: 2px ridge; BORDER-TOP: 2px ridge; POSITION: absolute; VISIBILITY: hidden; WIDTH: 10px; Z-INDEX: 100">
<font face="Verdana" size="2" color="#FFFFFF">
<iframe frameBorder="0" height="185" name="popFrameE2" scrolling="no" src="DTPicker.htm" width="180"></font>
</iframe>
</div>
<p><font color="#FFFFFF" face="Verdana" size="2">Fecha Ingreso</font></p>
<td width="157" height="23" colspan="2">
<font color="#FFFFFF" face="Verdana" size="2"><input name="Ingreso" readonly style="HEIGHT: 22px; WIDTH: 93px"><input type="button" value=" >" onclick="popFrameE2.fPopCalendar(Ingreso,Ingr eso,popCalE2);return false" name="Calendario1" style="BACKGROUND-COLOR: #e6e6e6; HEIGHT: 20px; WIDTH: 25px"></font>


chausito ;)
  #3 (permalink)  
Antiguo 15/07/2002, 15:56
Avatar de dobled  
Fecha de Ingreso: enero-2002
Ubicación: Rancagua - Chile
Mensajes: 1.328
Antigüedad: 22 años, 4 meses
Puntos: 2
Re: Ocx

OK pero aky haces mencion a src="DTPicker.htm"

de donde lo saco o estan las dos en el codigo??


  #4 (permalink)  
Antiguo 15/07/2002, 16:13
 
Fecha de Ingreso: mayo-2002
Mensajes: 83
Antigüedad: 22 años, 1 mes
Puntos: 0
Re: Ocx

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Untitled&l t;/title>

<meta content="Microsoft FrontPage 4.0" name="GENERATOR"></head>
<body leftMargin="0" topMargin="0">
<script language="JScript">
<!--
var gdCtrl = new Object();
var gcGray = "#7b9cb5";//Color números mes anterior y posterior
var gcToggle = "#abcce5";//Color selección
var gcBG = "#d9e5ea";//Fondo Calendario (números)

var gdCurDate = new Date();
var giYear = gdCurDate.getFullYear();
var giMonth = gdCurDate.getMonth()+1;
var giDay = gdCurDate.getDate();
var VicPopCal = new Object();

function fPopCalendar(popCtrl, dateCtrl, popCal){
parent.event.cancelBubble=true;
VicPopCal = popCal;
gdCtrl = dateCtrl;
fSetYearMon(giYear, giMonth);
var point = fGetXY(popCtrl);
with (VicPopCal.style) {
left = point.x;
top = point.y+popCtrl.offsetHeight+1;
visibility = 'visible';
}


VicPopCal.focus();

}

function fSetDate(iYear, iMonth, iDay){
//gdCtrl.value = iMonth+"-"+iDay+"-"+iYear;
gdCtrl.value = iDay+"-"+gMonths[iMonth-1]+"-"+iYear;
VicPopCal.style.visibility = "hidden";
}

function fSetSelected(aCell){
var iOffset = 0;
var iYear = parseInt(tbSelYear.value);
var iMonth = parseInt(tbSelMonth.value);

aCell.bgColor = gcBG;
with (aCell.children["cellText"]){
var iDay = parseInt(innerText);
if (color==gcGray)
{ if (iDay < 15)
{ iOffset = 1;}
else
{iOffset = -1;}
}
iMonth += iOffset;
if (iMonth<1) {
iYear--;
iMonth = 12;
}else if (iMonth>12){
iYear++;
iMonth = 1;
}
}
fSetDate(iYear, iMonth, iDay);
}

function Point(iX, iY){
this.x = iX;
this.y = iY;
}

function fBuildCal(iYear, iMonth) {
var aMonth=new Array();
for(i=1;i<7;i++)
aMonth[I]=new Array(i);

var dCalDate=new Date(iYear, iMonth-1, 1);
var iDayOfFirst=dCalDate.getDay();
var iDaysInMonth=new Date(iYear, iMonth, 0).getDate();
var iOffsetLast=new Date(iYear, iMonth-1, 0).getDate()-iDayOfFirst+1;
var iDate = 1;
var iNext = 1;

for (d = 0; d < 7; d++)
aMonth[1][d] = (d<iDayOfFirst)?-(iOffsetLast+d):iDate++;
for (w = 2; w < 7; w++)
for (d = 0; d < 7; d++)
aMonth[w][d] = (iDate<=iDaysInMonth)?iDate++iNext++);
return aMonth;
}

function fDrawCal(iYear, iMonth, iCellWidth, iDateTextSize) {
var WeekDay = new Array("Do","Lu","Ma" ,"Mi","Ju","Vi",&quo t;Sa");
var styleTD = " bgcolor='"+gcBG+"' width='"+iCellWidth+"' bordercolor='"+gcBG+"' valign='middle' align='center' style='font:bold "+iDateTextSize+" Courier;";

with (document) {
write("<tr>");
for(i=0; i<7; i++)
write("<td "+styleTD+"color:#104A84' >" + WeekDay[i] + "</td>");
write("</tr>");

for (w = 1; w < 7; w++) {
write("<tr>");
for (d = 0; d < 7; d++) {
write("<td id=calCell "+styleTD+"cursor:hand;' onMouseOver='this.bgColor=gcToggle' onMouseOut='this.bgColor=gcBG' onclick='fSetSelected(this)'>");
write("<font id=cellText> </font>");
write("</td>")
}
write("</tr>");
}
}
}

function fUpdateCal(iYear, iMonth) {
myMonth = fBuildCal(iYear, iMonth);
var i = 0;
for (w = 0; w < 6; w++)
for (d = 0; d < 7; d++)
with (cellText[(7*w)+d]) {
Victor = i++;
if (myMonth[w+1][d]<0) {
color = gcGray;
innerText = -myMonth[w+1][d];
}else{
color = ((d==0)||(d==6))?"red":"black" ;
innerText = myMonth[w+1][d];
}
}
}

function fSetYearMon(iYear, iMon){
tbSelMonth.options[iMon-1].selected = true;
for (i = 0; i < tbSelYear.length; i++)
if (tbSelYear.options[i].value == iYear)
tbSelYear.options[i].selected = true;
fUpdateCal(iYear, iMon);
}

function fPrevMonth(){
var iMon = tbSelMonth.value;
var iYear = tbSelYear.value;

if (--iMon<1) {
iMon = 12;
iYear--;
}

fSetYearMon(iYear, iMon);
}

function fNextMonth(){
var iMon = tbSelMonth.value;
var iYear = tbSelYear.value;

if (++iMon>12) {
iMon = 1;
iYear++;
}

fSetYearMon(iYear, iMon);
}

function fGetXY(aTag){
var oTmp = aTag;
var pt = new Point(0,0);
do {
pt.x += oTmp.offsetLeft;
pt.y += oTmp.offsetTop;
oTmp = oTmp.offsetParent;
} while(oTmp.tagName!="BODY");
return pt;
}

var gMonths = new Array("Jan","Feb","Mar&qu ot;,"Apr","May","Jun&quot ;,"Jul","Aug","Sep", "Oct","Nov","Dec" );

with (document) {
write("<table id='popTable' border='0' bgcolor='#b0c4de'>");
write("<TR>");
write("<td valign='middle' align='center'><input type='button' name='PrevMonth' value='<' style='height:20;width:20;FONT:16 Fixedsys' onClick='fPrevMonth()'>");
write(" <select name='tbSelMonth' onChange='fUpdateCal(tbSelYear.value, tbSelMonth.value)' Victor='Won'>");
for (i=0; i<12; i++)
write("<option value='"+(i+1)+"'>"+gMonths+"</option>");
write("</SELECT>");
write(" <SELECT name='tbSelYear' onChange='fUpdateCal(tbSelYear.value, tbSelMonth.value)' Victor='Won'>");
for(i=1900;i<2100;i++)
write("<OPTION value='"+i+"'>"+i+"</OPTION>");
write("</SELECT>");
write(" <input type='button' name='PrevMonth' value='>' style='height:20;width:20;FONT:16 Fixedsys' onclick='fNextMonth()'>");
write("</td>");
write("</TR><TR>");
write("<td align='center'>");
write("<DIV style='background-color:teal;'><table width='100%' border='0' cellpadding='2'>");
fDrawCal(giYear, giMonth, 19, 12);
write("</table></DIV>");
write("</td>");
write("</TR><TR><TD align='center'>");
write("<font style='cursor:hand;font:12 Fixedsys' onclick='fSetDate(giYear,giMonth,giDay)' onMouseOver='this.style.color=gcToggle' onMouseOut='this.style.color=0'>Today:&nbsp ; "+gMonths[giMonth-1]+" "+giDay+", &qu ot;+giYear+"</font>");
write("</TD></TR>");write("</TD></TR>");
write("</TABLE>");
}
// -->
</script>
</body>
</html>



Este es el DTPicker.htm...
son 5 lucas :)
Chausito...

Yoston: Ingeniero en busca de pega jejeje
  #5 (permalink)  
Antiguo 15/07/2002, 16:49
Avatar de dobled  
Fecha de Ingreso: enero-2002
Ubicación: Rancagua - Chile
Mensajes: 1.328
Antigüedad: 22 años, 4 meses
Puntos: 2
Re: Ocx

OK este lo que ando buscando !!!

Pero!!!!

el dtpicker.htm si lo habro solo lo veo...
al abrirlo desde la otra llamada no pasa nada..

:(
  #6 (permalink)  
Antiguo 15/07/2002, 17:10
 
Fecha de Ingreso: mayo-2002
Mensajes: 83
Antigüedad: 22 años, 1 mes
Puntos: 0
Re: Ocx

fijate bienn...
debes llamarlo asi...
arriba de esto debe ir el DIV

Cita:
<input name="Ingreso" readonly style="HEIGHT: 22px; WIDTH: 93px"><input type="button" value=" >" onclick="popFrameE2.fPopCalendar(Ingreso,Ingr eso,popCalE2);
le das de parametros el nombre del imput y el div...
fijate bien....


chausito... :cantar:
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 23:25.