.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Who can translate this? Small PHP to ASP .NET

Posted By:      Posted Date: September 08, 2010    Points: 0   Category :ASP.Net
Hi,I'm a PHP Developer but I want to help one of my friends who is a newbie. Can anyone from here translate this code from PHP to ASP .NET?Part one: TO BE PLACED IN THE HEADER!/* BEGIN */if(isset($_REQUEST['ref']) && $_REQUEST['ref'] != ""){       $expire = time()+60*60*24*30; // 30 days     $do = setcookie('ref', $_REQUEST['ref'], $expire);    if( ! $do){        $_SESSION['ref'] = $_REQUEST['ref'];     }   }else{       $expire = time()+60*60*24*30; // 30 days     $do = setcookie('ref', '', $expire);    if( ! $do){        $_SESSION['ref'] = $_REQUEST['ref'];     }   }/* END */Part two: TO BE PLACED IN THE FORM! /* BEGIN */<input type="hidden" name="ref" value="<?php echo isset($_COOKIE['ref']) ? $_COOKIE['ref'] : $_SESSION['ref'];  ?>"/>/* END */The code tries to write a cookie with the name ref and if is not able to write that cookie it will create a session var with the name ref. The value must be retrieved after that in a hidden form field.Thank you in advance.Marius

View Complete Post

More Related Resource Links

I want Er Diagram for Fees System of small institution ,can u plz guide me what fields are necessary


I want Er Diagram for Fees System of small institution ,can u plz guide me what fields are necessary to store Fees information ...


{ End Bracket }: Translate This Page


This month we examine the Microsoft translation Web service and show you how you can incorporate translation services into your own Web application.

Sandor Maurice & Vikram Dendi

MSDN Magazine April 2009

XmlLite: A Small And Fast XML Parser For Native C++


XmlLite provides a high-performance, low-overhead XML reader and writer geared for applications written in native C++. Learn more here.

Kenny Kerr

MSDN Magazine April 2007

A small web application


Hi, I just a very small web project now I want to go further.

The question is that I have't found a proper direction to practice and improve myself. I downloaded dotnuke and found that is it too bigger and hard to learn for personal study. My goal is to do something like ajax+web sevices+sql etc.

Hopefully I can get some suggestion. Thanks.

How to create modile application with small DB?

Hi Friends, I am going to create my first Windows mobile application, I know Windows Form development. I want to know how to create mobile application with small DB. How I can use SQLlight DB or Shall I use text file to store that values? Which is the best way, I don't want to use SQL server..! Because I want to save few values that's all.   Thanks, Naga Harish .

Small issue extracting soap from xml using Xelement

The following code works fine, except it only gives me the value being returned (integer), with no XML tags at all.  I want the raw XML without the soap (not just the value). display code:                 Dim path1 As String                 path1 = "c:\temp\testing.xml"                 ExtractSoap()                 File.WriteAllText(path1, ExtractSoap.Value.ToString())   function: Public Function ExtractSoap() As XElement         internalStream.Position = 0         Dim xmlMessage As XElement = XElement.Load(XmlReader.Create(internalStream))         Dim soap As XNamespace = "http://schemas.xmlsoap.org/soap/envelope/"         Dim body As XElement = xmlMessage.Element(soap + "Body")         If body IsNot Nothing Then             Return DirectCast(body.FirstNode, XElement)         End

Small quible

Read about SSCE 4 and just installed it. It did not allow you to choose the install location, for 2mb Not too big a deal, But I like to have my development stuff separated from the rest...

translate vb.net to C# of property use

I have defined a property in a masterpage in vb.net.I want to use the same code in a C# project, but I have no idea how to translate it. And yes Ive seen pages like: http://www.carlosag.net/Tools/CodeTranslator/and http://support.microsoft.com/kb/319265But I'm new, so I have no idea.Here's the code:Public Property BreadCrumb() As String        Get            Return lblBreadcrumb.Text        End Get        Set(ByVal path As String)            Dim BreadCrumbBuilder As New StringBuilder            BreadCrumbBuilder.Append("<li><a title=""Home"" href=""/"">Home</a></li>")            If path <> "" Then                Dim a As Array = path.Split(";")                If a.Length = 2 Then                    BreadCrumbBuil

Is it possible to prevent seeing results if rowcount is small?

Hi, we are about to start a new project. In the project we won't be owning the data to be analysed. The data provider is going to require some special rules for the usage of data. This is because the nature of data the - the data is going to be information sensitive. They are asking if we could implement a restriction which would prevent to see results rows if there is less than five result rows. I couldn't find any ideas how this could be done. Is it possible? How? We are running Sql Server 2008. Thank you in advance, Teemu Ajalin

Proper Approach for Monthly PDF Reports for Small Business?

Hello, all. Previously, our environment included an installation of WSS 2.0.  One of our most widely-used "features" was a page of links to reports on network file shares.  No one liked or trusted the Document Libraries, so we continued to store our weekly & monthly reports at places like \\fileserver\r-drive\MonthlyReports\2010\08\Sales\LicenseActivationReport.pdf and then created a bird's nest of links on our WSS "Reports" page to allow folks to find the information they were looking for more easily.  I'm not talking about a Links List, but a page of text with about 30 links to individual reports whose locations changed at least monthly.  These reports are roughly 70% PDF (exported from Crystal Reports), 25% Excel, and 5% Word. Today, we have an installation of MOSS 2007 Standard.  The collaboration and document management features are taking off quite nicely, but the staff is understandably itching to migrate the above-described "Reports Page" from WSS 2.0 to MOSS 2007. I can think of a few different approaches to this situation: We could reproduce a text page with 30 links to places like file:\\server\share\report.xls, but this seems contrary to SharePoint's mission.  It's certainly contrary to what I told the staff during training:  "Don't turn SharePoint into a bird's nest of links to ext

Unable to translate Unicode character \uD8D6 at index 5 to specified code page.

I' have the error "Unable to translate Unicode character \uD8D6 at index 5 to specified code page." when I call a remote service, using a method that uploads some data (basically data readed from WMI and from Win Registry on the client host) from the client to the server. The server is wsHttpBinding, hosted in IIS7 via an ASP.NET 4.0 Web Site (svc file). The client is an exe, compiled in .NET 3.5 I've tried to set "textEncoding="utf-16"" on the binding, either on server and on client, but still the same. I've no idea about a solution :( Any idea? Thanks  

want to translate some text using globalization

Hi,   I am working on globalization project.In my search.aspx page I have PagedGridview.I has property called EmptyDataText which is set to "NoResults".(EmptyDataText="No Results") How can I translate "No Results" Within EmptyDataText?I tried to create key both global and local resource file.   In my local resource I tried in search.aspx.fr-FR.resx I have key called Search and its value is No Resu'dfd .Then in gridview I tried like EmptyDataText=<%=GetLocalResourceObject("Search") %> But it is not working.   Then I tried using global resource EmptyDataText=<%=Resources.Product.Seacrh%> where Product is resx(class)   <util:PagedGridView ID="product" runat="server" AllowPaging="true"         EmptyDataText="No Results" AllowSorting="true" PageSize="10"         OnPageIndexChanging="PageSearchResults" AutoGenerateColumns="false" OnRowCreated="HandleHeader"         >  

SS2008 Supported on Windows Server 2008 Small Business

I am planning to install Sql Server 2008 x64 on Windows Server 2008 x64. My question : Is it only SqlServer2008 Standard Edition x32 supported on SBS2008? I checked the chart of the SW requirements and I am not sure about it.

SSRS option to make capital first letter and rest small letters of a string

Hi, In the 'Name' field of String type is appearing all capital letters. I want to appear it as first letter is capital and rest all small. If there is space between two characters, then the second should appear as Caps again. Ex: 1. PETER Should appear like Peter 2. ALEXANDAR PETER Should appear as Alexander Peter Is it possible in SSRS or SQL Query ? I am using SQL Server 2005 SSRS Reporting Services. Thanks,

google Translate Encoding Problems With C#

//Create a Google Translate String To Translate From Google. string Translate(string inputStr, string fromLanguage, string toLanguage) { string url = string.Format("http://translate.google.com/translate_a/t?client=t&text={0}&hl=en&sl={1}&tl={2}&multires=1&pc=0&sc=1", inputStr, fromLanguage, toLanguage); WebClient tmpClient = new WebClient(); tmpClient.Encoding = System.Text.Encoding.UTF8; string result = tmpClient.DownloadString(url); return result; } Now The Problem is If You Pass something like that Translate("Hello","en","ur"); Return String: JSON String But Couldn't Really Get The Write Method to Get ???? ???? Instead Of ? ?? ?? ? { ur: [[["? ?? ?? ?","Hello World",""]],,"en"] }   In Browsers The URL is Showing Correct Returned String. Urdu is unicode Language. The String Return in result is Whole Messed up with ???? ?? ???? something like that. I tried to Convert it in Different Encodings But Not Couldn't get Anythine usefull. How Can I Correct That I Wanted To Further Save It In XML File.

Small problem with FOR XML EXPLICIT

Hello everyone, For my BizTalk application I need to receive "STRUCTURED" XML from SQL Server so I decided to use FOR XML EXPLICIT.  I have a pretty simple scenario. I have 2 tables in SQL. One is a table for invoices, the other one a table for items. One invoice can have many items. I use a stored procedure to retrieve invoices. Right now the returned XML only retrieves the items for the last invoice. So if the SP returns 3 invoices, the first 2 will only have the receipt number and supplierIdCompany and the last record will be complete with the items (as expected). My SP is as follows ALTER PROCEDURE [dbo].[RetrieveDeliveryreceipts] AS BEGIN SET NOCOUNT ON;     -- Insert statements for procedure here  SELECT 1 AS TAG, NULL AS PARENT,  tblDeliveryReceipts.dlrReceiptNumber AS [tblDeliveryReceipts!1!ReceiptNumber!ELEMENT],  tblDeliveryReceipts.dlrSupplierIdCompany AS [tblDeliveryReceipts!1!SupplierIdCompany!ELEMENT],  NULL AS [tblDeliveryReceiptLines!2!ItemDescription!ELEMENT],  NULL AS [tblDeliveryReceiptLines!2!Quantity!ELEMENT]  FROM tblDeliveryReceipts   WHERE tblDeliveryReceipts.dlrReceiptNumber = 'B 00000010' OR tblDeliveryReceipts.dlrReceiptNumber = 'B 00000011' OR tblDeliveryReceipts.dlrReceiptNumber = 'B 00000012'  UNION ALL  SELECT 2 AS TAG, 1 AS PARENT,  tblDeliveryRec

Why input text is so small in the People Seach box?


I have SharePoint Server 2010 Enterprise based intra.
I have added People search box.

I wonder why text is so small if I add search word.

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend