Browse by Tags
All Tags »
.net (RSS)
A veces es necesario realizar ciertas acciones antes de que un updatePanel realice el update o cuando recibe la operación del servidor, para este tipo de cosas una opción es realizarlas por código javascript, solo tienes que poner el siguiente código en el bloque <SCRIPT type="text/javascript"> de la página aspx en la que quieras realizar las acciones antes y depués del postback. En este código lo único que se hace es un alert antes del request y cuando este termina, pero tal vez el concepto os sirva para alguna cosa en vuestros desarrollos con Ajax.
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_initializeRequest(InitializeRequest);
prm.add_endRequest(EndRequest);
function InitializeRequest(sender, args)
{
alert('inicio');
}
function EndRequest(sender, args)
{
alert('fin');
}
El código y un artículo en inglés bastante más detallado sobre el tema lo podeis encontrar en:
http://www.singingeels.com/Articles/AJAX_Client_Side_Actions_Before_and_After_PostBack.aspx
Estos días teniamos problemas con la perdida de las variables de sesión de una forma aparentemente incomprensible. Finalmente investigando por internet descubrí que el problema está en el framework 2.0 de .net y que trabajando con Directory.Delete() se borran las variables de sesion tipo Session["tuvariable"] que tuviesemos guardadas.
La solución en el caso de la aplicación en la que estabamos trabajando fue borrar los archivos que contenían estas carpetas, y posterioremente cuando ya no eran necesarias las variables de sesión borrar todo.
Si me entero de alguna forma de solucionar esta perdida de variables de sesión os lo comentaré, por ahora tener cuidado cuando trabajeis mezclando las variables de sesión y el Directory.Delete().
Aquí teneis un hilo de un foro en inglés hablando sobre el tema:
http://forums.asp.net/p/1056323/1504793.aspx
Y un artículo en inglés sobre el tema:
http://www.vikramlakhotia.com/Deleting_Directory_in_ASPnet_20.aspx
Espero que os sea útil y os libre de más de un quebradero de cabeza, pasar buen fin de semana, saludos
Lo que nos encontramos en el msdn sobre este error:
http://msdn.microsoft.com/es-es/library/bb310803.aspx
La tecnología utilizada .net asp 2.0 y ajax,
En mi caso este error salia al intentar descargar un archivo, al darle al botón descargar me salia el error:
Sys.WebForms.PageRequestManagerErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
En un principio leí por ahí que podría tratarse de que los updatepanels no se llevarán bien con el Response.WriteFile que utilizaba pero finalemente la solución es tan sencilla como registrar en el ScriptManager de la página web el botón de la descarga y que era el que ejecutaba el response, con el siguiente código dentro del pageload de la página :
Normal
0
21
false
false
false
ES
X-NONE
X-NONE
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Tabla normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin-top:0cm;
mso-para-margin-right:0cm;
mso-para-margin-bottom:10.0pt;
mso-para-margin-left:0cm;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-fareast-font-family:"Times New Roman";
mso-fareast-theme-font:minor-fareast;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;}
protected void Page_Load(object
sender, EventArgs e)
{
Normal
0
21
false
false
false
ES
X-NONE
X-NONE
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Tabla normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin-top:0cm;
mso-para-margin-right:0cm;
mso-para-margin-bottom:10.0pt;
mso-para-margin-left:0cm;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-fareast-font-family:"Times New Roman";
mso-fareast-theme-font:minor-fareast;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;}
ScriptManager.GetCurrent(this.Page).RegisterPostBackControl(btn_Descargar);
Normal
0
21
false
false
false
ES
X-NONE
X-NONE
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Tabla normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin-top:0cm;
mso-para-margin-right:0cm;
mso-para-margin-bottom:10.0pt;
mso-para-margin-left:0cm;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-fareast-font-family:"Times New Roman";
mso-fareast-theme-font:minor-fareast;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;}
// El resto de tu código ...
}
Espero que os sirva, saludos
Por defecto en los webmethods de los web services las variables de sesión están deshabilitadas, como por ejemplo en el siguiente código:
[english] Webmethods has disabled the session variables by default:
[WebMethod]
public void Example()
{
// WebMethod Code
}
Para habilitar las varibles de sesión lo único que tenemos que hacer es:
[english] To enable the session variables just we need to write:
[WebMethod(EnableSession
= true)]
public void Example2()
{
// WebMethod Code
}
Espero os sea útil, hasta luego
I hope it will be usefull for you byeeeeee
Bueno después del primer día de charlas, el balance es bastante bueno.
Hoy nos han contado muchas cositas, WPF, Software Engineer, Sharepoint services, Ajax, security.
Pero lo que mejor pinta tiene como avisa el título del post ruby(un lenguaje de programación) y linQ(acceso a datos desde .net para diferentes fuentes de forma uniforme, xml, sql, objetos).
Varios de los ponentes han hablado bastante bien de ruby, habrá que probarlo :D.
Para los amantes de C# comentar que incluso gente que sabe mucho de VisualBasic ha comentado que C# es "mejor" en ciertos aspectos.
Bueno para la gente que no tenga ni idea de que son algunas es normal, yo hace unos meses tampoco la tenía, para los curiosos siempre quedará la wikipedia, y en la bloguera seguro que postearemos más cositas al respecto de estas nuevas tecnologías de microsoft para profesionales.
Y mañana más!! nos vamos a dormirrrrrrr zz zzzzz zzzzzz
Luego pondremos alguna fotillo.
Ramón y Sebas @ Malaga, Torremolinos SaludeTES
Hemos llegado bien STOP
La Alhambra y las cañitas de Granada (Nuestra parada para la comida) STOP
Despues de una larga de charlita tecnológica muy interesante esta noche nos vamos a dormir, que mañana a las 7 y 15 arriba STOP
Las wifi sin seguridad son lo mejor!! STOP
En próximos Posts intentaré contar más cosas sobre las conferencias, dice Ramón que apague el ordenador y me vaya para la cama :D:D:D, hasta mañana
Continuará
Los días 15 y 16 de Octubre se celebra en Málaga el OktoberFest
Es la primera Conferencia a la que voy a asistir e más de un día, y la verdad es que me resulta bastante atractiva la idea, son muchos conceptos en muy poco tiempo pero tal vez eso es lo bonito de este tipo de eventos, luego cada uno tendrá tiempo de profundizar más en las tecnologías que mas les hayan gustado o las que necesiten y puedan ser realmente útiles en el día a día de su trabajo.
Intentaré comentar algo sobre ella en próximos posts.
Objetivos para un novatillo en este mundillo como yo:
- Intentar coger el máximo número de conceptos posibles.
- Conocer gente y reencontrarse con viejos conocidos, incluso poner cara a algunos de los blogs tecnológicos que suelo leer en geeks.ms y en labloguera.net .
- Disfrutar, porque aunque a algunos les parezca mentira, el mundillo de la informática también puede llegar a ser divertido, y que mejor que hacer en la mayor medida tu trabajo algo que te divierta.
- Y BUSCAR NUEVOS BLOGUERS para LABLOGUERA.NET
- Requisitos necesarios: Querer hacerse un blog técnico en el cual ir compartiendo las experiencias tecnológicas con todos los internautas.
- El blog es gratuito, puedes hablar de cualquier tipo de tecnología, tienes la ventaja de ser miembro de una comunidad, la unión hace la fuerza. En la bloguera tienen cabida todo tipo de gente a la que le guste la tecnología.
Os podeis apuntar directamente creando un usuario en www.labloguera.net y despues enviando un correo a lablogueraARROBAgmail.com diciendo cual es vuestro usuario en la bloguera, cual quereis que sea el título de vuestro blog y sobre que vais a hablar. O si teneis alguna duda más enviarme un correo a mi dirección sebichusARROBAgmail.com
Bueno esto es una tontería para los más expertos, pero para gente que este empezando a trabajar con el visual stdio puede llevar un rato encontrar el como activar los números de linea del código que aparecen a la izquierda y que son muy útiles para la depuración.
Primero en la barra de menu ir a Herramientas, luego dentro de herramientas ir a opciones y te saldrá el siguiente cuadro de dialogo...

Dentro de esta ventana tienes que ir a Editor de Texto, luego Todos los lenguajes y finalmente tienes que seleccionar en Mostrar Números de línea.
Es una opción que inicialmente en mi visual studio 2005 venía desactivada y supongo que le habrá pasado a más gente. Esta es la razón principal del post. Espero que os sea útil.
________________________________________________________________________
IN ENGLISH ...
For the most experts this post has nonsense, but for the visual studio begginers could spend a while till find how swith on the option of display line numbers which appear at the left of the document which you are working and they are so usefull for debug.
First of all at the menu bar click Tools, then click options and the dialog box which is in this post picture will appear.In the dialog box you have to go to text editor, then to all languages and finally go to Show and check the line number option.
Is an option that in my visual studio 2005 was uncheck and I guess that it happens to more people, this is the main reason of this post. I hope it will be helpful.
sorry for my english
IN ENGLISH ...
In a web service which was working I had to change the .cs file because I had changed the code, and after change it in the iis when I called the webservice url, happens the error in line xx <connectionStrings/>
Finally I solved it changing the permisions of the folder in the IIS and giving all the permisions again less the examine permision. The problems of permisions usually give a lot of headhaches :D ...
sorry for my english
EN ESPAÑOL ...
Problemas publicando Web Service Error<connectionStrings/> en IIS
En un web service que estaba funcionando tenía que cambiar el archivo .cs ya que lo había modificado, y después de modificarlo al llamar a la url del web service que comenzó a salir el error en linea XX <connectionStrings/>
Al final lo solucioné cambiando los permisos de la carpeta en el IIS y volviendole a dar todos los permisos menos el de examinar. Los problemas de permisos, que suelen dar mucho quebraderos de cabeza.
ALGO CURIOSO que encontré mientras buscaba que podía estar pasando.
Como hacer un web service con el editor de notas, en elguille.net ...
http://www.elguille.info/NET/ASPNET/crearServicioWeb.aspx
Un link a un foro en el que se explica Como publicar un web service en el IIS:
http://www.baleareson.net/forums/t/183.aspx
These days I am working with a webservice which has to work creating, deleting file and folders. In this post i will try to explain how I worked with the elements about File and folders which are in the .net framework.
About Files:
You can work with File or FileInfo both in System.IO . Since my point of view depending what do you need to do is better use one or another. File is for work with files in a quick way, just make an action and forget it, the most of the methods needs the url file and they return void, a quick action like :
File.AppendAllText("c:/error.txt",
"Text to add in the file error.txt");
This line create the file error.txt if it doesn't exist and append the text. there are more methods you can just look it in the VStudio's intellisense. And one advantage is that you don't need to create a File object to work with it, because is a static class.
And the second way FileInfo is maybe a better way if you will work more than once with the same file, if you need give it permissions, or do more than one action, because first you have to create the object:
FileInfo file = new FileInfo("UrlFILE");
and then you can make till I saw more or less the same actions than with File but without put the url each time.
With Directories is more or less the same
, the .net framework has Directory y DirectoryInfo
they have the same use than File and FileInfo, but with the differents with Files.
For example Directory.Copy doesn't Exist, so We had to make our own directory library, for example the Copy method is :
public void CopyDirectory(string url_source,string
url_destine,bool overwrite)
{
if(overwrite)
Directory.Delete(url_destine,true);
if(!Directory.Exists(url_destine))
Directory.CreateDirectory(url_destine);
string path_file_destine = string.Empty;
foreach (string file in Directory.GetFiles(url_source))
{
path_file_destine= url_destine+Path.GetFileName(file);
File.Copy(file, path_file_destine);
}
foreach (string
sub_dir in Directory.GetDirectories(url_source))
CopyDirectory(sub_dir+"/",
dir_Destino+Path.GetFileName(sub_dir)+"/",overwrite);
}
When you can't delete a Directory sometimes is because you are working with it, or another program is working with it or because some file or directory which is in the Directory has ReadOnly permissions, to change a file permissions:
File.SetAttributes("path_file", FileAttributes.Normal);
and for change the Attributes to a directory you need to use DirectoryInfo, it isn't in Directory
Sorry for my English
Luego cuando tenga un rato, lo pongo también en español.
Bueno hace unas semanas empezé a buscar cosas sobre el framework 3.5, encontrando bastante poco sobre el tema, pero al final he encontrado algo interesante que os dejo aquí...
Some weeks ago I began to search things about the framework 3.5, I found few about it, but finally i have found something interesting ...
Para descargarlo / To download it
http://www.microsoft.com/downloads/details.aspx?familyid=d2f74873-c796-4e60-91c8-f0ef809b09ee&displaylang=en
Mejor descargarse también el Orcas (Visual Studio 2008) Beta2, porque lleva ya el framework 3.5
Better download Orcas (VS 2008) because it has the framework 3.5
http://www.microsoft.com/downloads/details.aspx?familyid=1DF11844-3C90-4FB8-A78F-4BA95ED0B370&displaylang=en
Un video con los detalles generales del framework 3.5 es en inglés/ A video with the generic details
http://channel9.msdn.com/Showpost.aspx?postid=333940
El video esta bien pero es un vistazo demasiado general, sobre todo para los que quieran saber más sobre el framework.
The video is ok but is just a generic look
Posts de donde he sacado información.. / Posts from I toke information ...
http://geeks.ms/blogs/amezcua/archive/2007/08/17/un-vistazo-de-alto-nivel-a-las-novedades-de-net-3-5.aspx
http://geeks.ms/blogs/jorge/archive/2007/08/08/los-nuevos-controles-de-asp-net-3-5.aspx
Continuará ...
to be continued ...
Descripción del problema : Problemas con la consistencia de los datos en campos que tienen que tener una determinada estrutura como el mail. El viejo código aceptaba ñs, y aceptaba acentos, supongo que dependerá del idioma del explorador lo que acepte. El siguiente link muestra un ejemplo para hacerlo a través de código, cuya expresión regular no me sirvio.
Problem Description : Problems with the data consistency in fields which must has a structure like the email. The next link has an example (is in spanish, but the code is the code so ...) to validate mail adresses. Maybe with an english browser you don't have this kind of problems, but with a spanish browser I had it.
http://msdn2.microsoft.com/es-es/library/01escwtf(VS.80).aspx
Otro link interesante para poder quitar carácteres no válidos de strings es el siguiente :
Another link, this one to delete characters which isn't valid
http://msdn2.microsoft.com/es-es/library/844skk0h(VS.80).aspx
más links para trabajar con expresiones regulares / more links for work with regular expresions ...
MICROSOFT WEB http://www.microsoft.com/spanish/msdn/articulos/archivo/201205/voices/regex.mspx
http://www.regular-expressions.info/
MUY BUEN LINK / VERY GOOD LINK
Las expresiones regulares con las que trabajé yo ... / The regular expresions which I have worked ...
El código antiguo / The old code:
"\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
El código nuevo / The new code:
"[a-zA-Z0-9._]+([-+.][a-zA-Z0-9._]+)*@[a-zA-Z0-9._]+([-.][a-zA-Z._]+)*\.[a-zA-Z._]{2,4}"
Y para los más curiosos. Link a posts escritos por Ramón Tebar en su blog, también sobre expresiones regulares ...
http://labloguera.net/blogs/rtb/archive/tags/Expresiones+regulares/default.aspx(SPANISH)
Googleando un poco ya se puede ver info acerca de la próxima imagine cup ...
Googling a little you can find info about the next imagine cup ...
http://jaimelopezvivas.wordpress.com/2007/07/24/imagine-cup-2008/(spanish)
también se puede ver el que parece ser el logo ...
And you can see the posible logo ...
http://chesini.blogspot.com/2007/07/imagine-cup-2008-tenemos-logo.html(spanish)
Cosas que ya habían dicho en la bloguera también :
http://labloguera.net/blogs/rtb/archive/2007/07/07/imagine-cup-2008.aspx(spanish)
Y como dicen que cuando el rio suena agua lleva.
And as the people say when the river sounds it brings water (this is a bad translation of the topic setence that i wrote before)
Asi pues dos palabras / So two words :
Medio Ambiente / Nature Enviroment
Francia / France
TO BE CONTINUED (como dice Peter el compilador de mundos)
Continuará ...
I read this
the other day ...
http://www.subgurim.net/Articulos/asp-net-general-articulo123.aspx (IN SPANISH)
It has
an interesting link, where you can learn more about connection strings to
whatever data base
http://www.connectionstrings.com/
I hope the
link will be useful
Leí esto el otro día sobre connection strings
http://www.subgurim.net/Articulos/asp-net-general-articulo123.aspx
Tiene un link muy interesante, donde puedes parender mas sobre cadenas de conexión a cualquier bbdd
http://www.connectionstrings.com/
Espero que os se util!!