<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Tips &amp; Tricks</title><link>http://forums.asp.net/53.aspx</link><description>Cool code and exciting examples, provided by our members.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Calling a method sent as a parameter</title><link>http://forums.asp.net/thread/3564154.aspx</link><pubDate>Mon, 14 Dec 2009 14:01:30 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3564154</guid><dc:creator>dihola15</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3564154.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=53&amp;PostID=3564154</wfw:commentRss><description>&lt;p&gt;Exactly.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Calling a method sent as a parameter</title><link>http://forums.asp.net/thread/3564149.aspx</link><pubDate>Mon, 14 Dec 2009 13:59:12 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3564149</guid><dc:creator>MetalAsp.Net</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3564149.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=53&amp;PostID=3564149</wfw:commentRss><description>&lt;p&gt;I don&amp;#39;t think he has a problem.&amp;nbsp; This is the Tips &amp;amp; Tricks section.&amp;nbsp; People share, well, their Tips &amp;amp; Tricks so others may benefit from them.&lt;/p&gt;</description></item><item><title>Re: Calling a method sent as a parameter</title><link>http://forums.asp.net/thread/3564142.aspx</link><pubDate>Mon, 14 Dec 2009 13:56:32 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3564142</guid><dc:creator>_voidstar_</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3564142.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=53&amp;PostID=3564142</wfw:commentRss><description>&lt;p&gt;Ok...what is&amp;nbsp;your problem?&amp;nbsp;&amp;nbsp;You have&amp;nbsp;asked no questions.&amp;nbsp;&lt;/p&gt;</description></item><item><title>Calling a method sent as a parameter</title><link>http://forums.asp.net/thread/3233635.aspx</link><pubDate>Mon, 15 Jun 2009 10:26:27 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3233635</guid><dc:creator>dihola15</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3233635.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=53&amp;PostID=3233635</wfw:commentRss><description>&lt;p&gt;Below is some code I use it to call different methods in a web service. Each method has different parameters and return types, and I just wanted a generic method that I could call for all of them.&lt;br /&gt;More importantly, for every call to the service, I needed to do some further processing to check if the ticket used to identify my call to the service) was expired. If I didn&amp;#39;t have a generic method like this, I would need to implement the check with every call:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static object CallService(string ServiceMethod, object[] ServiceMethodParams)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; object Result = null;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Reflection.MethodInfo mi = MyService.GetType().GetMethod(ServiceMethod); &lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Result = mi.Invoke(MyService, ServiceMethodParams);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // If the request comes back with a &amp;quot;Ticket expired&amp;quot; header, re-login and attempt to call the method again&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (MyService.TicketHeaderValue.Expired == 1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ServiceLogin();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Result = mi.Invoke(MyService, ServiceMethodParams);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return Result;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>