You are getting the ArrayOfString in the client, because you are using Add Service Reference to add a reference to the asmx service. You can get the string[] in the client in one of two ways: a) by creating a WCF service instead of an ASMX service, and using Add Service Reference. b) by keeping the asmx service, and using Add Web Reference instead of Add Service Reference.from: https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=406109&wa=wsignin1.0 found through: http://forums.asp.net/t/1369531.aspx If you are creating your web service client proxy in a separate class library project, (which you are forced to if you are using Web Site instead of Web Application and want to extend your proxy generated classes using partial classes), you have to make this a .NET Framework 2.0 project. Otherwise you won't even find the "Add Web Reference" option in the right-click menu, only "Add Service Reference".
Monday, August 17, 2009
The curious/furious case of ArrayOfString class
If you happened to have a problem with Visual Studio generating an ArrayOfString class instead of simple string[] in your web service client proxy, then this might be useful:
Wednesday, April 15, 2009
Send all NHibernate SQL queries to console output
When using a separate XML file to configure NHibernate (e.g. the hibernate.cfg.xml):
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="dialect">NHibernate.Dialect.MsSql2005Dialect</property>
<property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
<property name="connection.connection_string">Server=(local);Database=NHibernateFAQ;Integrated Security=SSPI;</property>
<property name="show_sql">true</property>
</session-factory>
</hibernate-configuration>
When using ActiveRecord and Web.config:
<configuration>
<configSections>
<section name="activerecord" type="Castle.ActiveRecord.Framework.Config.ActiveRecordSectionHandler, Castle.ActiveRecord" />
</configSections>
<appSettings>
</appSettings>
<activerecord>
<config>
<add key="hibernate.connection.driver_class" value="NHibernate.Driver.OracleClientDriver" />
<add key="hibernate.dialect" value="NHibernate.Dialect.OracleDialect" />
<add key="hibernate.connection.provider" value="NHibernate.Connection.DriverConnectionProvider" />
<add key="hibernate.connection.connection_string" value="Data Source=sss;User ID=uuu;Password=ppp;" />
<add key="hibernate.show_sql" value="true" />
</config>
</activerecord>
</configuration>
Thanks to: http://nhforge.org/wikis/howtonh/configure-log4net-for-use-with-nhibernate.aspx.
Monday, March 30, 2009
Autowidening DropDownList (IE only!)
<asp:DropDownList ID="ddl" runat="server" Width="100px" onmouseover="this.style.width = 'auto';" onfocus="this.hasFocus = true;" onblur="this.style.width = 100; this.hasFocus = false;" onmouseout="if (!this.hasFocus) this.style.width = 100;" />
Works in Internet Explorer only - in Firefox the control does not narrow back.
Saturday, January 31, 2009
Send file to browser
private void SendFile(string fileText, string fileName, string contentType) {
this.Response.Clear();
this.Response.AddHeader("content-disposition", "attachment;filename=" + fileName);
this.Response.ContentType = contentType;
this.Response.Write(fileText);
this.Response.End();
}
Typical content types:
Text "text/plain"
PDF "application/pdf"
Got it from: http://coercedcode.blogspot.com/2007/08/sending-files-and-file-contents-to.html.
Starting the download with a button inside an UpdatePanel? Register the button for a regular, not partial postback:
ScriptManager.GetCurrent(this.Page).RegisterPostBackControl(exportButton);
Tuesday, January 27, 2009
Page transfer effect that works in Internet Explorer (blendTrans effect)
I can never remember this.
<meta http-equiv="Page-Enter" content="blendTrans(Duration=0.0)">
Monday, January 19, 2009
Quickly check web page performance
Paste this somewhere in your codebehind, putting the dt definitions around the suspected code:
DateTime dt = DateTime.Now;
DateTime dt2 = DateTime.Now;
DateTime dt3 = DateTime.Now;
this.debugLiteral.Text = string.Format("<div>|{0}||{1}||{2}|</div>", dt, dt2, dt3);
And paste this somewhere in your aspx:<asp:Literal ID="debugLiteral" runat="server" />
Monday, December 15, 2008
Google hosted jQuery
Link to jQuery library hosted on Google's CDN:http://encosia.com/2008/12/10/3-reasons-why-you-should-let-google-host-jquery-for-you/<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
Subscribe to:
Posts (Atom)